├── create-link-repo
├── .gitignore
├── src
│ ├── test
│ │ ├── java
│ │ │ └── .gitignore
│ │ ├── properties
│ │ │ └── local
│ │ │ │ └── alfresco-global.properties
│ │ └── resources
│ │ │ └── log4j.properties
│ └── main
│ │ ├── amp
│ │ ├── config
│ │ │ └── alfresco
│ │ │ │ ├── module
│ │ │ │ └── create-link-repo
│ │ │ │ │ ├── messages
│ │ │ │ │ ├── alfdev-repository.properties
│ │ │ │ │ ├── alfdev-repository_en.properties
│ │ │ │ │ ├── alfdev-repository_es.properties
│ │ │ │ │ └── alfdev-repository_fr.properties
│ │ │ │ │ ├── module-context.xml
│ │ │ │ │ ├── context
│ │ │ │ │ └── service-context.xml
│ │ │ │ │ └── log4j.properties
│ │ │ │ └── extension
│ │ │ │ └── templates
│ │ │ │ └── webscripts
│ │ │ │ └── com
│ │ │ │ └── alfdev
│ │ │ │ └── doclib
│ │ │ │ ├── create-link.post.json.ftl
│ │ │ │ ├── create-link.post.desc.xml
│ │ │ │ └── action.lib.ftl
│ │ └── module.properties
│ │ └── java
│ │ └── com
│ │ └── alfdev
│ │ └── alfresco
│ │ └── repo
│ │ └── web
│ │ └── scripts
│ │ └── doclib
│ │ └── CreateLinkPost.java
├── tomcat
│ └── context.xml
└── pom.xml
├── create-link-share
├── .gitignore
├── src
│ ├── main
│ │ ├── java
│ │ │ └── .gitignore
│ │ └── amp
│ │ │ ├── file-mapping.properties
│ │ │ ├── config
│ │ │ └── alfresco
│ │ │ │ ├── messages
│ │ │ │ ├── alfdev.properties
│ │ │ │ ├── alfdev_en.properties
│ │ │ │ ├── alfdev_es.properties
│ │ │ │ └── alfdev_fr.properties
│ │ │ │ ├── site-webscripts
│ │ │ │ └── com
│ │ │ │ │ └── alfdev
│ │ │ │ │ └── alfresco
│ │ │ │ │ └── modules
│ │ │ │ │ └── documentlibrary
│ │ │ │ │ ├── create-link.get.desc.xml
│ │ │ │ │ ├── create-link.get_es.properties
│ │ │ │ │ ├── create-link.get.html.ftl
│ │ │ │ │ ├── create-link.get.properties
│ │ │ │ │ ├── create-link.get_en.properties
│ │ │ │ │ └── create-link.get_fr.properties
│ │ │ │ ├── web-extension
│ │ │ │ └── alfdev-context.xml
│ │ │ │ ├── alfdev-share-documentlibrary-config.xml
│ │ │ │ └── module
│ │ │ │ └── create-link-share
│ │ │ │ └── log4j.properties
│ │ │ ├── web
│ │ │ ├── components
│ │ │ │ └── documentlibrary
│ │ │ │ │ ├── actions
│ │ │ │ │ └── alfdev-create-link-16.png
│ │ │ │ │ └── alfdev-actions.js
│ │ │ └── modules
│ │ │ │ └── documentlibrary
│ │ │ │ └── alfdev-create-link.js
│ │ │ └── module.properties
│ └── test
│ │ ├── java
│ │ └── .gitignore
│ │ ├── properties
│ │ └── local
│ │ │ └── alfresco-global.properties
│ │ └── resources
│ │ └── log4j.properties
├── tomcat
│ └── context.xml
└── pom.xml
├── .gitignore
├── README.md
└── LICENSE
/create-link-repo/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 |
--------------------------------------------------------------------------------
/create-link-repo/src/test/java/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/create-link-share/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 |
--------------------------------------------------------------------------------
/create-link-share/src/main/java/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/create-link-share/src/test/java/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/file-mapping.properties:
--------------------------------------------------------------------------------
1 | /web=/
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | build
3 | alf_data_dev
4 | .classpath
5 | .project
6 | .settings
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/messages/alfdev.properties:
--------------------------------------------------------------------------------
1 | # Document Library Actions
2 | actions.alfdev.create-link=Create Link
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/module/create-link-repo/messages/alfdev-repository.properties:
--------------------------------------------------------------------------------
1 | # CreateLinkPost custom message
2 | link_to=Link to
3 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/messages/alfdev_en.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | actions.alfdev.create-link = Create Link
4 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/extension/templates/webscripts/com/alfdev/doclib/create-link.post.json.ftl:
--------------------------------------------------------------------------------
1 | <#import "action.lib.ftl" as actionLib />
2 | <@actionLib.resultsJSON results=results />
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/messages/alfdev_es.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | actions.alfdev.create-link = Crear Enlace
4 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/messages/alfdev_fr.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | actions.alfdev.create-link = Cr\u00E9er un lien
4 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/module/create-link-repo/messages/alfdev-repository_en.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | link_to = Link to
4 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/module/create-link-repo/messages/alfdev-repository_es.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | link_to = Enlace a
4 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/module/create-link-repo/messages/alfdev-repository_fr.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | link_to = Lien vers
4 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/web/components/documentlibrary/actions/alfdev-create-link-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skomarica/alfresco-share-create-link/HEAD/create-link-share/src/main/amp/web/components/documentlibrary/actions/alfdev-create-link-16.png
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/site-webscripts/com/alfdev/alfresco/modules/documentlibrary/create-link.get.desc.xml:
--------------------------------------------------------------------------------
1 |
2 | alfdev-create-link
3 | Create Link module for Document Library
4 | /modules/documentlibrary/alfdev/create-link
5 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/site-webscripts/com/alfdev/alfresco/modules/documentlibrary/create-link.get_es.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skomarica/alfresco-share-create-link/HEAD/create-link-share/src/main/amp/config/alfresco/site-webscripts/com/alfdev/alfresco/modules/documentlibrary/create-link.get_es.properties
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/site-webscripts/com/alfdev/alfresco/modules/documentlibrary/create-link.get.html.ftl:
--------------------------------------------------------------------------------
1 | <#--
2 | The html template from global-folder will be loaded separately.
3 | This template only brings in new i18n-messages.
4 | -->
5 |
8 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/site-webscripts/com/alfdev/alfresco/modules/documentlibrary/create-link.get.properties:
--------------------------------------------------------------------------------
1 | ## Create Link
2 | create-link.title.single=Create Link to {0} in...
3 | create-link.title.multi=Create {0} links in...
4 | create-link.button=Create Link
5 | create-link.message.please-wait=Link being created...
6 | create-link.message.success=Successfully created {0} link(s)
7 | create-link.message.failure=Link creation could not be completed
8 | create-link.message.no-files=At least one file must be supplied
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/extension/templates/webscripts/com/alfdev/doclib/create-link.post.desc.xml:
--------------------------------------------------------------------------------
1 |
2 | Create Link (Shortcut) to a document (folder)
3 | Action - Create Link
4 | /slingshot/doclib/action/alfdev/create-link/node/{store_type}/{store_id}/{id}
5 | argument
6 | user
7 | required
8 | internal
9 |
10 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/site-webscripts/com/alfdev/alfresco/modules/documentlibrary/create-link.get_en.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | create-link.button = Create Link
4 | create-link.message.failure = Link creation could not be completed
5 | create-link.message.no-files = At least one file must be supplied
6 | create-link.message.please-wait = Link being created...
7 | create-link.message.success = Successfully created {0} link(s)
8 | create-link.title.multi = Create {0} links in...
9 | create-link.title.single = Create Link to {0} in..
10 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/site-webscripts/com/alfdev/alfresco/modules/documentlibrary/create-link.get_fr.properties:
--------------------------------------------------------------------------------
1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
2 |
3 | create-link.button = Cr\u00E9er un lien
4 | create-link.message.failure = Impossible de cr\u00E9er un lien
5 | create-link.message.no-files = Au moins un fichier doit \u00EAtre pr\u00E9sent
6 | create-link.message.please-wait = Lien en cours de cr\u00E9ation...
7 | create-link.message.success = {0} lien(s) cr\u00E9\u00E9 avec succ\u00E9s
8 | create-link.title.multi = Cr\u00E9ation de {0} lien dans...
9 | create-link.title.single = Cr\u00E9ation du lien {0} dans..
10 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/extension/templates/webscripts/com/alfdev/doclib/action.lib.ftl:
--------------------------------------------------------------------------------
1 | <#macro resultsJSON results>
2 | <#escape x as jsonUtils.encodeJSONString(x)>
3 | {
4 | "totalResults": ${results?size?c},
5 | "overallSuccess": ${overallSuccess?string},
6 | "successCount": ${successCount?c},
7 | "failureCount": ${failureCount?c},
8 | "results":
9 | [
10 | <#list results as r>
11 | {
12 | <#list r?keys as key>
13 | <#assign value = r[key]>
14 | <#if value?is_number || value?is_boolean>
15 | "${key}": ${value?string}<#if key_has_next>,#if>
16 | <#else>
17 | "${key}": "${value}"<#if key_has_next>,#if>
18 | #if>
19 | #list>
20 | }<#if r_has_next>,#if>
21 | #list>
22 | ]
23 | }
24 | #escape>
25 | #macro>
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/web-extension/alfdev-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | alfresco.messages.alfdev
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | classpath:alfresco/alfdev-share-documentlibrary-config.xml
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/module/create-link-repo/module-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/module/create-link-repo/context/service-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | alfresco.module.create-link-repo.messages.alfdev-repository
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/alfdev-share-documentlibrary-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | onAlfdevActionCreateLink
19 | evaluator.doclib.action.isLocked
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/web/components/documentlibrary/alfdev-actions.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | YAHOO.Bubbling.fire("registerAction",
3 | {
4 | actionName: "onAlfdevActionCreateLink",
5 | fn: function alfdev_onActionCreateLink(record) {
6 |
7 | if (!this.modules.createLink)
8 | {
9 | this.modules.createLink = new Alfresco.module.alfdev.DoclibCreateLink(this.id + "-createLink");
10 | }
11 |
12 | var DLGF = Alfresco.module.DoclibGlobalFolder;
13 |
14 | var allowedViewModes =
15 | [
16 | DLGF.VIEW_MODE_RECENT_SITES,
17 | DLGF.VIEW_MODE_FAVOURITE_SITES,
18 | DLGF.VIEW_MODE_SITE,
19 | DLGF.VIEW_MODE_SHARED
20 | ];
21 |
22 | if (this.options.repositoryBrowsing === true)
23 | {
24 | allowedViewModes.push(DLGF.VIEW_MODE_REPOSITORY);
25 | }
26 |
27 | allowedViewModes.push(DLGF.VIEW_MODE_USERHOME)
28 |
29 | this.modules.createLink.setOptions(
30 | {
31 | allowedViewModes: allowedViewModes,
32 | mode: "create-link",
33 | siteId: this.options.siteId,
34 | containerId: this.options.containerId,
35 | path: this.currentPath,
36 | files: record,
37 | rootNode: this.options.rootNode,
38 | parentId: this.getParentNodeRef(record)
39 | }).showDialog();
40 | }
41 | });
42 | })();
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/config/alfresco/module/create-link-repo/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #-----------------------------------------------------------------------
16 | # ${artifactId} module log4j.properties
17 | #
18 | # NOTE
19 | # ----
20 | # Log4j uses the following logging levels:
21 | # debug,info,warn,error,fatal
22 | #
23 | # To set the logging level of {fullClassName} to {loglevel},
24 | # add a line to this file of the following form:
25 | #
26 | # log4j.logger.{fullClassName}={loglevel}
27 | #
28 | # For example, to make 'com.example.MyExample' produce 'debug'
29 | # logs, add a line like this:
30 | #
31 | # log4j.logger.com.example.MyExample=debug
32 | #
33 | #
34 | # WARNING
35 | # -------
36 | # Log properties in this log4j.properties file override/augment
37 | # those in the webapp's main log4j.properties.
38 | #
39 | #-----------------------------------------------------------------------
40 | log4j.logger.com.alfdev.alfresco=${module.log.level}
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/config/alfresco/module/create-link-share/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #-----------------------------------------------------------------------
16 | # ${artifactId} module log4j.properties
17 | #
18 | # NOTE
19 | # ----
20 | # Log4j uses the following logging levels:
21 | # debug,info,warn,error,fatal
22 | #
23 | # To set the logging level of {fullClassName} to {loglevel},
24 | # add a line to this file of the following form:
25 | #
26 | # log4j.logger.{fullClassName}={loglevel}
27 | #
28 | # For example, to make 'com.example.MyExample' produce 'debug'
29 | # logs, add a line like this:
30 | #
31 | # log4j.logger.com.example.MyExample=debug
32 | #
33 | #
34 | # WARNING
35 | # -------
36 | # Log properties in this log4j.properties file override/augment
37 | # those in the webapp's main log4j.properties.
38 | #
39 | #-----------------------------------------------------------------------
40 | log4j.logger.com.alfdev.alfresco=${module.log.level}
--------------------------------------------------------------------------------
/create-link-repo/tomcat/context.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
--------------------------------------------------------------------------------
/create-link-share/tomcat/context.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/amp/module.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 |
17 |
18 | # SDK Sample module
19 |
20 | # ==== Beginning of Alfresco required/optional properties ====== #
21 | # NB: These properties are filtered at build time by Maven, single
22 | # sourcing from POM properties
23 | module.id=${project.artifactId}
24 | #module.aliases=myModule-123, my-module
25 | module.title=${project.name}
26 | module.description=${project.description}
27 | module.version=${noSnapshotVersion}
28 |
29 | # The following optional properties can be used to prevent the module from being added
30 | # to inappropriate versions of the WAR file.
31 | # module.repo.version.min=2.0
32 | # module.repo.version.max=2.1
33 |
34 | # FIXME: This dependencies should come out of mvn dependencies on amp
35 |
36 | # The following describe dependencies on other modules
37 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} or later
38 | # module.depends.net.sf.myproject.module.SupportModuleA=${version}-*
39 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0
40 | # module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0
41 | # Depends on net.sf.myproject.module.SupportModuleC - any version
42 | # module.depends.net.sf.myproject.module.SupportModuleB=*
43 |
44 |
45 | # ==== End of Alfresco required/optional properties ======= #
46 |
47 |
48 | # ==== Beginning of module required properties/optional ====== #
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/module.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 |
17 |
18 | # SDK Sample module
19 |
20 | # ==== Beginning of Alfresco required/optional properties ====== #
21 | # NB: These properties are filtered at build time by Maven, single
22 | # sourcing from POM properties
23 | module.id=${project.artifactId}
24 | #module.aliases=myModule-123, my-module
25 | module.title=${project.name}
26 | module.description=${project.description}
27 | module.version=${noSnapshotVersion}
28 |
29 | # The following optional properties can be used to prevent the module from being added
30 | # to inappropriate versions of the WAR file.
31 | # module.repo.version.min=2.0
32 | # module.repo.version.max=2.1
33 |
34 | # FIXME: This dependencies should come out of mvn dependencies on amp
35 |
36 | # The following describe dependencies on other modules
37 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} or later
38 | # module.depends.net.sf.myproject.module.SupportModuleA=${version}-*
39 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0
40 | # module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0
41 | # Depends on net.sf.myproject.module.SupportModuleC - any version
42 | # module.depends.net.sf.myproject.module.SupportModuleB=*
43 |
44 |
45 | # ==== End of Alfresco required/optional properties ======= #
46 |
47 |
48 | # ==== Beginning of module required properties/optional ====== #
--------------------------------------------------------------------------------
/create-link-repo/src/test/properties/local/alfresco-global.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 |
17 |
18 | # RUN TIME PROPERTIES
19 | # -------------------
20 |
21 | # Sample custom content and index data location
22 | # This will create alf_data Relative to appserver run folder
23 | # In this default file we take the property from the POM (for compatbility with local jetty and jboss deployments) but it can also be edited here.
24 | dir.root=${alfresco.data.location}
25 | # Allowed values are: NONE, AUTO, FULL
26 | index.recovery.mode=NONE
27 | # As we run embedded, we set Lucene
28 | index.subsystem.name=lucene
29 |
30 | #dir.keystore=.
31 | #keystore.password=storepassword
32 | #metadata.password=metapassword
33 |
34 | # Fail or not when there are node integrity checker errors
35 | integrity.failOnError=true
36 |
37 | # Database connection properties
38 | # These are also filtered from Maven at build time from POM properties.
39 | # Alternatively you can directly define them directly here
40 | db.driver=${alfresco.db.datasource.class}
41 | db.url=${alfresco.db.url}
42 | db.username=${alfresco.db.username}
43 | db.password=${alfresco.db.password}
44 | db.pool.initial=10
45 | db.pool.max=100
46 |
47 | # File servers related properties
48 | # For local builds we disable CIFS and FTP. Edit the following property to reenable them
49 | smb.server.enabled=false
50 | smb.server.name=CFS_SHARE_LOCAL
51 | smb.server.domain=mycompany.com
52 | smb.server.bindto=127.0.0.1
53 | smb.tcpip.port=1445
54 | netbios.session.port=1139
55 | netbios.name.port=1137
56 | netbios.datagram.port=1138
57 | ftp.server.enables=false
58 | ftp.port=1121
59 | ftp.authenticator=alfresco
--------------------------------------------------------------------------------
/create-link-share/src/test/properties/local/alfresco-global.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 |
17 |
18 | # RUN TIME PROPERTIES
19 | # -------------------
20 |
21 | # Sample custom content and index data location
22 | # This will create alf_data Relative to appserver run folder
23 | # In this default file we take the property from the POM (for compatbility with local jetty and jboss deployments) but it can also be edited here.
24 | dir.root=${alfresco.data.location}
25 | # Allowed values are: NONE, AUTO, FULL
26 | index.recovery.mode=NONE
27 | # As we run embedded, we set Lucene
28 | index.subsystem.name=lucene
29 |
30 | #dir.keystore=.
31 | #keystore.password=storepassword
32 | #metadata.password=metapassword
33 |
34 | # Fail or not when there are node integrity checker errors
35 | integrity.failOnError=true
36 |
37 | # Database connection properties
38 | # These are also filtered from Maven at build time from POM properties.
39 | # Alternatively you can directly define them directly here
40 | db.driver=${alfresco.db.datasource.class}
41 | db.url=${alfresco.db.url}
42 | db.username=${alfresco.db.username}
43 | db.password=${alfresco.db.password}
44 | db.pool.initial=10
45 | db.pool.max=100
46 |
47 | # File servers related properties
48 | # For local builds we disable CIFS and FTP. Edit the following property to reenable them
49 | smb.server.enabled=false
50 | smb.server.name=CFS_SHARE_LOCAL
51 | smb.server.domain=mycompany.com
52 | smb.server.bindto=127.0.0.1
53 | smb.tcpip.port=1445
54 | netbios.session.port=1139
55 | netbios.name.port=1137
56 | netbios.datagram.port=1138
57 | ftp.server.enables=false
58 | ftp.port=1121
59 | ftp.authenticator=alfresco
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Alfresco Share "Create Link" Action
2 | ===================================
3 |
4 | Description
5 | -----------
6 | **"Create Link"** is a custom Alfresco Share Document Library action, similar to "Copy to...", but instead of copying, it creates a link (shortcut, reference) to the document.
7 |
8 | With standard Alfresco Share, if you want a document to be accessible from multiple locations, it must be physically copied. "Create Link" action allows a single document stored in Alfresco to be accessible from multiple locations without duplicating the document. A user who is able to access the primary document is able to create a reference in any number of locations that links back to the physical document. Any changes made to the physical document or its metadata are immediately accessible from all referenced locations. Once you have a link created, you can use standard Alfresco Share actions to delete a link without affecting primary document, or to navigate to the folder where primary document resides.
9 |
10 | This project uses Alfresco (Maven) SDK. Implementation is based on Alfresco Explorer "Paste as Link" Shelf's functionality, which means that links created by either actions should behave the same way.
11 |
12 | Installation
13 | ------------
14 | You can find ready-to-install alfresco and share AMP's on [releases](https://github.com/skomarica/alfresco-share-create-link/releases) page.
15 |
16 | Alternatively, you can clone this repository and use `mvn install` to build AMP's from the latest source code.
17 |
18 | > ###Compatibility
19 | |Module version|Alfresco version|Java version|Alfresco (Maven) SDK|
20 | |--------------|----------------|------------|------------------|
21 | |v1.0.0|4.2.x, 5.0.a|Java 7|1.1.1|
22 |
23 | Using
24 | -----
25 | Using "Create Link" action is similar to using "Copy to..." or "Move to..." out-of-the box Alfresco Share actions:
26 |
27 | 1. Navigate to a document in your Document Library (e.g. "My File.docx") you want to create link to and execute "Create Link" action
28 | 2. Select a target folder where you want your link to be created and confirm the dialog (you will need write permissions on selected folder)
29 | 3. A node of type "app:filelink" pointing to "My File.docx" will be created within the selected folder, with appropriate thumbnail and name like "Link to: My File.docx"
30 |
31 | License, support, maintenance
32 | -----------------------------
33 | This is an open-source project, distributed under Apache License (v2.0). It's supplied free of charge, with no formal support, maintenance or warranty. If you find a bug related to this functionality or you have some nice enhancement in mind, feel free to raise an issue or, even better, implement a solution and contribute it back to the project.
34 |
35 | FAQ
36 | ---
37 | > #### What is an AMP file and how can I install it?
38 | An [AMP](https://wiki.alfresco.com/wiki/AMP_Files) file is a standard way of distributing Alfresco extensions. Use [Module Management Tool](https://wiki.alfresco.com/wiki/Module_Management_Tool) to apply "create-link-repo.amp" to "alfresco.war", and "create-link-share.amp" to "share.war" application. [Official documentation](http://docs.alfresco.com/) is always a good reference.
39 |
40 | > #### What is Alfresco (Maven) SDK and how can I use it?
41 | There is a great [tutorial](http://ecmarchitect.com/alfresco-developer-series-tutorials/maven-sdk/tutorial/tutorial.html) on how to get started with Alfresco Maven SDK. [Official documentation](http://docs.alfresco.com/) is always a good reference.
42 |
43 | > #### Can I create a link to folder?
44 | Although the creation of links to folder is supported by backend mechanism, I did not intentionally add "Create Link" action to the folder-browse and folder-details action groups. The reason for this is the way Alfresco Share application works with links (even with those created using Alfresco Explorer Shelf "Paste as Link" functionality):
45 | * Document link points to the document details view which is fine and expected
46 | * Folder link points to the folder details view and clicking the folder link will not navigate you to the linked folder path, displaying folder's content, but to the folder details view
47 |
48 | > #### Why am I getting an error "Link creation could not be completed"?
49 | Common reasons for getting such error message are:
50 | * You have not correctly installed "create-link-repo.amp" to "alfresco.war"
51 | * You already have a link with the same name within a selected folder
52 |
53 |
--------------------------------------------------------------------------------
/create-link-repo/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.alfdev.alfresco
6 | create-link-repo
7 | create-link-repo AMP project
8 | amp
9 | Manages the lifecycle of the create-link-repo AMP (Alfresco Module Package)
10 |
11 |
12 | org.alfresco.maven
13 | alfresco-sdk-parent
14 | 1.1.1
15 |
16 |
17 |
22 |
23 |
24 | org.alfresco
25 |
26 | 4.2.f
27 | WARN
28 | alf_data_dev
29 |
31 | alfresco
32 |
34 | org.alfresco
35 |
36 | 4.2.f
37 |
38 | local
39 |
40 |
41 |
43 |
44 |
45 |
49 |
50 | ${alfresco.groupId}
51 | alfresco-platform-distribution
52 | ${alfresco.version}
53 | pom
54 | import
55 |
56 |
57 |
58 |
61 |
62 |
63 | ${alfresco.groupId}
64 | alfresco-repository
65 |
66 |
67 |
68 | junit
69 | junit
70 | 4.8.1
71 | test
72 |
73 |
74 |
75 |
83 |
84 |
85 | alfresco-public
86 | https://artifacts.alfresco.com/nexus/content/groups/public
87 |
88 |
89 | alfresco-public-snapshots
90 | https://artifacts.alfresco.com/nexus/content/groups/public-snapshots
91 |
92 | true
93 | daily
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | org.eclipse.m2e
103 | lifecycle-mapping
104 | 1.0.0
105 |
106 |
107 |
108 |
109 |
110 |
111 | org.alfresco.maven.plugin
112 |
113 |
114 | alfresco-maven-plugin
115 |
116 |
117 | [1.1.1,)
118 |
119 |
120 | set-version
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 | org.codehaus.mojo
131 |
132 |
133 | build-helper-maven-plugin
134 |
135 |
136 | [1.8,)
137 |
138 |
139 |
140 | add-test-resource
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 | 1.0.0
156 |
157 |
--------------------------------------------------------------------------------
/create-link-share/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.alfdev.alfresco
6 | create-link-share
7 | 1.0.0
8 | create-link-share AMP project
9 | amp
10 | Manages the lifecycle of the create-link-share AMP (Alfresco Module Package)
11 |
12 |
13 | org.alfresco.maven
14 | alfresco-sdk-parent
15 | 1.1.1
16 |
17 |
18 |
23 |
24 |
25 | org.alfresco
26 |
27 | 4.2.f
28 | WARN
29 | alf_data_dev
30 |
32 | share
33 |
35 | org.alfresco
36 |
37 | 4.2.f
38 |
39 | local
40 |
41 |
42 |
44 |
45 |
46 |
50 |
51 | ${alfresco.groupId}
52 | alfresco-platform-distribution
53 | ${alfresco.version}
54 | pom
55 | import
56 |
57 |
58 |
59 |
62 |
63 |
64 | ${alfresco.groupId}
65 | alfresco-repository
66 |
67 |
68 |
69 | junit
70 | junit
71 | 4.8.1
72 | test
73 |
74 |
75 |
76 |
84 |
85 |
86 | alfresco-public
87 | https://artifacts.alfresco.com/nexus/content/groups/public
88 |
89 |
90 | alfresco-public-snapshots
91 | https://artifacts.alfresco.com/nexus/content/groups/public-snapshots
92 |
93 | true
94 | daily
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | org.eclipse.m2e
104 | lifecycle-mapping
105 | 1.0.0
106 |
107 |
108 |
109 |
110 |
111 |
112 | org.alfresco.maven.plugin
113 |
114 |
115 | alfresco-maven-plugin
116 |
117 |
118 | [1.1.1,)
119 |
120 |
121 | set-version
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | org.codehaus.mojo
132 |
133 |
134 | build-helper-maven-plugin
135 |
136 |
137 | [1.8,)
138 |
139 |
140 |
141 | add-test-resource
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/create-link-share/src/main/amp/web/modules/documentlibrary/alfdev-create-link.js:
--------------------------------------------------------------------------------
1 | Alfresco.module.alfdev = Alfresco.module.alfdev || {};
2 |
3 | /**
4 | * Document Library "Create Link" module for Document Library.
5 | *
6 | * @namespace Alfresco.module.alfdev
7 | * @class Alfresco.module.alfdev.DoclibCreateLink
8 | */
9 | (function()
10 | {
11 | Alfresco.module.alfdev.DoclibCreateLink = function(htmlId)
12 | {
13 | Alfresco.module.alfdev.DoclibCreateLink.superclass.constructor.call(this, htmlId);
14 |
15 | // Re-register with our own name
16 | this.name = "Alfresco.module.alfdev.DoclibCreateLink";
17 | var DLGF = Alfresco.module.DoclibGlobalFolder;
18 |
19 | Alfresco.util.ComponentManager.reregister(this);
20 |
21 | this.options = YAHOO.lang.merge(this.options,
22 | {
23 | allowedViewModes:
24 | [
25 | DLGF.VIEW_MODE_SITE,
26 | DLGF.VIEW_MODE_RECENT_SITES,
27 | DLGF.VIEW_MODE_FAVOURITE_SITES,
28 | DLGF.VIEW_MODE_SHARED,
29 | DLGF.VIEW_MODE_REPOSITORY,
30 | DLGF.VIEW_MODE_USERHOME
31 | ],
32 | extendedTemplateUrl: Alfresco.constants.URL_SERVICECONTEXT + "modules/documentlibrary/alfdev/create-link"
33 | });
34 |
35 | return this;
36 | };
37 |
38 | YAHOO.extend(Alfresco.module.alfdev.DoclibCreateLink, Alfresco.module.DoclibGlobalFolder,
39 | {
40 | /**
41 | * Set multiple initialization options at once.
42 | *
43 | * @method setOptions
44 | * @override
45 | * @param obj {object} Object literal specifying a set of options
46 | * @return {Alfresco.module.alfdev.DoclibCreateLink} returns 'this' for method chaining
47 | */
48 | setOptions: function DLCL_setOptions(obj)
49 | {
50 | var myOptions = {};
51 |
52 | myOptions.dataWebScript = "alfdev/create-link";
53 |
54 | myOptions.viewMode = Alfresco.util.isValueSet(this.options.siteId) ? Alfresco.module.DoclibGlobalFolder.VIEW_MODE_RECENT_SITES : Alfresco.module.DoclibGlobalFolder.VIEW_MODE_REPOSITORY;
55 | // Actions module
56 | this.modules.actions = new Alfresco.module.DoclibActions();
57 |
58 | return Alfresco.module.alfdev.DoclibCreateLink.superclass.setOptions.call(this, YAHOO.lang.merge(myOptions, obj));
59 | },
60 |
61 | /**
62 | * Event callback when superclass' dialog template has been loaded
63 | *
64 | * @method onTemplateLoaded
65 | * @override
66 | * @param response {object} Server response from load template XHR request
67 | */
68 | onTemplateLoaded: function DLCL_onTemplateLoaded(response)
69 | {
70 | // Load the UI template, which only will bring in new i18n-messages, from the server
71 | Alfresco.util.Ajax.request(
72 | {
73 | url: this.options.extendedTemplateUrl,
74 | dataObj:
75 | {
76 | htmlid: this.id
77 | },
78 | successCallback:
79 | {
80 | fn: this.onExtendedTemplateLoaded,
81 | obj: response,
82 | scope: this
83 | },
84 | failureMessage: "Could not load 'copy-link-to' template:" + this.options.extendedTemplateUrl,
85 | execScripts: true
86 | });
87 | },
88 |
89 | /**
90 | * Event callback when this class' template has been loaded
91 | *
92 | * @method onExtendedTemplateLoaded
93 | * @override
94 | * @param response {object} Server response from load template XHR request
95 | */
96 | onExtendedTemplateLoaded: function DLCL_onExtendedTemplateLoaded(response, superClassResponse)
97 | {
98 | // Now that we have loaded this components i18n messages let the original template get rendered.
99 | Alfresco.module.alfdev.DoclibCreateLink.superclass.onTemplateLoaded.call(this, superClassResponse);
100 | },
101 |
102 | /**
103 | * YUI WIDGET EVENT HANDLERS
104 | * Handlers for standard events fired from YUI widgets, e.g. "click"
105 | */
106 |
107 | /**
108 | * Dialog OK button event handler
109 | *
110 | * @method onOK
111 | * @param e {object} DomEvent
112 | * @param p_obj {object} Object passed back from addListener method
113 | */
114 | onOK: function DLCL_onOK(e, p_obj)
115 | {
116 | var files, multipleFiles = [], params, i, j,
117 | eventSuffix = "LinkCreated";
118 |
119 | // Single/multi files into array of nodeRefs
120 | if (YAHOO.lang.isArray(this.options.files))
121 | {
122 | files = this.options.files;
123 | }
124 | else
125 | {
126 | files = [this.options.files];
127 | }
128 | for (i = 0, j = files.length; i < j; i++)
129 | {
130 | multipleFiles.push(files[i].node.nodeRef);
131 | }
132 |
133 | // Success callback function
134 | var fnSuccess = function DLCL__onOK_success(p_data)
135 | {
136 | var result,
137 | successCount = p_data.json.successCount,
138 | failureCount = p_data.json.failureCount;
139 |
140 | this.widgets.dialog.hide();
141 |
142 | // Did the operation succeed?
143 | if (!p_data.json.overallSuccess)
144 | {
145 | Alfresco.util.PopupManager.displayMessage(
146 | {
147 | text: this.msg("message.failure")
148 | });
149 | return;
150 | }
151 |
152 | YAHOO.Bubbling.fire("files" + eventSuffix,
153 | {
154 | destination: this.currentPath,
155 | successCount: successCount,
156 | failureCount: failureCount
157 | });
158 |
159 | for (var i = 0, j = p_data.json.totalResults; i < j; i++)
160 | {
161 | result = p_data.json.results[i];
162 |
163 | if (result.success)
164 | {
165 | YAHOO.Bubbling.fire((result.type == "folder" ? "folder" : "file") + eventSuffix,
166 | {
167 | multiple: true,
168 | nodeRef: result.nodeRef,
169 | destination: this.currentPath
170 | });
171 | }
172 | }
173 |
174 | Alfresco.util.PopupManager.displayMessage(
175 | {
176 | text: this.msg("message.success", successCount)
177 | });
178 | YAHOO.Bubbling.fire("metadataRefresh");
179 | };
180 |
181 | // Failure callback function
182 | var fnFailure = function DLCL__onOK_failure(p_data)
183 | {
184 | this.widgets.dialog.hide();
185 |
186 | Alfresco.util.PopupManager.displayMessage(
187 | {
188 | text: this.msg("message.failure")
189 | });
190 | };
191 |
192 | // Construct webscript URI based on current viewMode
193 | var webscriptName = this.options.dataWebScript + "/node/{nodeRef}",
194 | nodeRef = new Alfresco.util.NodeRef(this.selectedNode.data.nodeRef);
195 |
196 | // Construct the data object for the genericAction call
197 | this.modules.actions.genericAction(
198 | {
199 | success:
200 | {
201 | callback:
202 | {
203 | fn: fnSuccess,
204 | scope: this
205 | }
206 | },
207 | failure:
208 | {
209 | callback:
210 | {
211 | fn: fnFailure,
212 | scope: this
213 | }
214 | },
215 | webscript:
216 | {
217 | method: Alfresco.util.Ajax.POST,
218 | name: webscriptName,
219 | params:
220 | {
221 | nodeRef: nodeRef.uri
222 | }
223 | },
224 | wait:
225 | {
226 | message: this.msg("message.please-wait")
227 | },
228 | config:
229 | {
230 | requestContentType: Alfresco.util.Ajax.JSON,
231 | dataObj:
232 | {
233 | nodeRefs: multipleFiles,
234 | parentId: this.options.parentId
235 | }
236 | }
237 | });
238 |
239 | this.widgets.okButton.set("disabled", true);
240 | this.widgets.cancelButton.set("disabled", true);
241 | },
242 |
243 | /**
244 | * Gets a custom message depending on current view mode
245 | * and use superclasses
246 | *
247 | * @method msg
248 | * @param messageId {string} The messageId to retrieve
249 | * @return {string} The custom message
250 | * @override
251 | */
252 | msg: function DLCL_msg(messageId)
253 | {
254 | var result = Alfresco.util.message.call(this, this.options.mode + "." + messageId, this.name, Array.prototype.slice.call(arguments).slice(1));
255 | if (result == (this.options.mode + "." + messageId))
256 | {
257 | result = Alfresco.util.message.call(this, messageId, this.name, Array.prototype.slice.call(arguments).slice(1))
258 | }
259 | if (result == messageId)
260 | {
261 | result = Alfresco.util.message(messageId, "Alfresco.module.DoclibGlobalFolder", Array.prototype.slice.call(arguments).slice(1));
262 | }
263 | return result;
264 | },
265 |
266 |
267 | /**
268 | * PRIVATE FUNCTIONS
269 | */
270 |
271 | /**
272 | * Internal show dialog function
273 | * @method _showDialog
274 | * @override
275 | */
276 | _showDialog: function DLCL__showDialog()
277 | {
278 | this.widgets.okButton.set("label", this.msg("button"));
279 | return Alfresco.module.alfdev.DoclibCreateLink.superclass._showDialog.apply(this, arguments);
280 | }
281 | });
282 |
283 | /* Dummy instance to load optional YUI components early */
284 | var dummyInstance = new Alfresco.module.alfdev.DoclibCreateLink("null");
285 | })();
--------------------------------------------------------------------------------
/create-link-repo/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # This is a full override of Alfresco 4.2.b log4j.properties
2 | # This file overwrites the alfresco.war log4j.properties
3 |
4 | # Set root logger level to error
5 | log4j.rootLogger=${app.log.root.level}, Console, File
6 |
7 | ###### Console appender definition #######
8 |
9 | # All outputs currently set to be a ConsoleAppender.
10 | log4j.appender.Console=org.apache.log4j.ConsoleAppender
11 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout
12 |
13 | # use log4j NDC to replace %x with tenant domain / username
14 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n
15 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
16 |
17 | ###### File appender definition #######
18 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
19 | log4j.appender.File.File=${app.log.dir}alfresco.log
20 | log4j.appender.File.Append=true
21 | log4j.appender.File.DatePattern='.'yyyy-MM-dd
22 | log4j.appender.File.layout=org.apache.log4j.PatternLayout
23 | log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
24 |
25 | ###### Hibernate specific appender definition #######
26 | #log4j.appender.file=org.apache.log4j.FileAppender
27 | #log4j.appender.file.File=hibernate.log
28 | #log4j.appender.file.layout=org.apache.log4j.PatternLayout
29 | #log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
30 |
31 | ###### Log level overrides #######
32 |
33 | # Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit)
34 | # Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime
35 | # control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via
36 | # Log4j addLoggerMBean as long as the logger exists and has been loaded.
37 |
38 | # Hibernate
39 | log4j.logger.org.hibernate=error
40 | log4j.logger.org.hibernate.util.JDBCExceptionReporter=fatal
41 | log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=fatal
42 | log4j.logger.org.hibernate.type=warn
43 | log4j.logger.org.hibernate.cfg.SettingsFactory=warn
44 |
45 | # Spring
46 | log4j.logger.org.springframework=warn
47 | # Turn off Spring remoting warnings that should really be info or debug.
48 | log4j.logger.org.springframework.remoting.support=error
49 | log4j.logger.org.springframework.util=error
50 |
51 | # Axis/WSS4J
52 | log4j.logger.org.apache.axis=info
53 | log4j.logger.org.apache.ws=info
54 |
55 | # CXF
56 | log4j.logger.org.apache.cxf=error
57 |
58 | # MyFaces
59 | log4j.logger.org.apache.myfaces.util.DebugUtils=info
60 | log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error
61 | log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error
62 | log4j.logger.org.apache.myfaces.taglib=error
63 |
64 | # OpenOfficeConnection
65 | log4j.logger.net.sf.jooreports.openoffice.connection=fatal
66 |
67 | # log prepared statement cache activity ###
68 | log4j.logger.org.hibernate.ps.PreparedStatementCache=info
69 |
70 | # Alfresco
71 | log4j.logger.org.alfresco=error
72 | log4j.logger.org.alfresco.repo.admin=info
73 | log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn
74 | log4j.logger.org.alfresco.repo.model.filefolder=warn
75 | log4j.logger.org.alfresco.repo.tenant=info
76 | log4j.logger.org.alfresco.repo.avm=info
77 | log4j.logger.org.alfresco.config=warn
78 | log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn
79 | log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn
80 | log4j.logger.org.alfresco.repo.management.subsystems=warn
81 | log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory=info
82 | log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext=warn
83 | log4j.logger.org.alfresco.repo.security.sync=info
84 | log4j.logger.org.alfresco.repo.security.person=info
85 |
86 | log4j.logger.org.alfresco.sample=info
87 | log4j.logger.org.alfresco.web=info
88 | #log4j.logger.org.alfresco.web.app.AlfrescoNavigationHandler=debug
89 | #log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug
90 | #log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug
91 | #log4j.logger.org.alfresco.web.bean.clipboard=debug
92 | log4j.logger.org.alfresco.repo.webservice=info
93 | log4j.logger.org.alfresco.service.descriptor.DescriptorService=info
94 | #log4j.logger.org.alfresco.web.page=debug
95 |
96 | log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error
97 | #log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info
98 |
99 | log4j.logger.org.alfresco.web.ui.common.Utils=error
100 | #log4j.logger.org.alfresco.web.ui.common.Utils=info
101 |
102 | log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info
103 | log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info
104 |
105 | # Specific patches
106 | log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info
107 | log4j.logger.org.alfresco.repo.version.VersionMigrator=info
108 | log4j.logger.org.alfresco.repo.admin.patch.impl.ResetWCMToGroupBasedPermissionsPatch=info
109 |
110 | log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info
111 | log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info
112 | log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info
113 | log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn
114 | log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn
115 | log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info
116 | log4j.logger.org.alfresco.repo.node.index.AVMFullIndexRecoveryComponent=info
117 | log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info
118 | log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn
119 | log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn
120 | log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn
121 | log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn
122 | log4j.logger.org.alfresco.util.AbstractTriggerBean=warn
123 | log4j.logger.org.alfresco.enterprise.repo.cache.cluster.KeepAliveHeartbeatReceiver=info
124 | log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn
125 |
126 | #log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug
127 |
128 | log4j.logger.org.alfresco.repo.workflow=info
129 |
130 | # CIFS server debugging
131 | log4j.logger.org.alfresco.smb.protocol=error
132 | #log4j.logger.org.alfresco.smb.protocol.auth=debug
133 | #log4j.logger.org.alfresco.acegi=debug
134 |
135 | # FTP server debugging
136 | log4j.logger.org.alfresco.ftp.protocol=error
137 | #log4j.logger.org.alfresco.ftp.server=debug
138 |
139 | # WebDAV debugging
140 | #log4j.logger.org.alfresco.webdav.protocol=debug
141 | log4j.logger.org.alfresco.webdav.protocol=error
142 |
143 | # NTLM servlet filters
144 | #log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug
145 | #log4j.logger.org.alfresco.repo.webdav.auth.NTLMAuthenticationFilter=debug
146 |
147 | # Kerberos servlet filters
148 | #log4j.logger.org.alfresco.web.app.servlet.KerberosAuthenticationFilter=debug
149 | #log4j.logger.org.alfresco.repo.webdav.auth.KerberosAuthenticationFilter=debug
150 |
151 | # File servers
152 | log4j.logger.org.alfresco.fileserver=warn
153 |
154 | # Repo filesystem debug logging
155 | #log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug
156 |
157 | # AVM filesystem debug logging
158 | #log4j.logger.org.alfresco.filesys.avm.AVMDiskDriver=debug
159 |
160 | # Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated
161 | log4j.logger.org.alfresco.repo.node.integrity=ERROR
162 |
163 | # Indexer debugging
164 | log4j.logger.org.alfresco.repo.search.Indexer=error
165 | #log4j.logger.org.alfresco.repo.search.Indexer=debug
166 |
167 | log4j.logger.org.alfresco.repo.search.impl.lucene.index=error
168 | log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=warn
169 | #log4j.logger.org.alfresco.repo.search.impl.lucene.index=DEBUG
170 |
171 | # Audit debugging
172 | # log4j.logger.org.alfresco.repo.audit=DEBUG
173 | # log4j.logger.org.alfresco.repo.audit.model=DEBUG
174 |
175 | # Forms debugging
176 | # log4j.logger.org.alfresco.web.forms=debug
177 | # log4j.logger.org.chiba.xml.xforms=debug
178 | log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error
179 | log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error
180 |
181 | # Property sheet and modelling debugging
182 | # change to error to hide the warnings about missing properties and associations
183 | log4j.logger.alfresco.missingProperties=warn
184 | log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn
185 | log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn
186 | #log4j.logger.org.alfresco.web.ui.repo.component.property=debug
187 |
188 | # Dictionary/Model debugging
189 | log4j.logger.org.alfresco.repo.dictionary=warn
190 | log4j.logger.org.alfresco.repo.dictionary.types.period=warn
191 |
192 | # Virtualization Server Registry
193 | log4j.logger.org.alfresco.mbeans.VirtServerRegistry=error
194 |
195 | # Spring context runtime property setter
196 | log4j.logger.org.alfresco.util.RuntimeSystemPropertiesSetter=info
197 |
198 | # Debugging options for clustering
199 | log4j.logger.org.alfresco.repo.content.ReplicatingContentStore=error
200 | log4j.logger.org.alfresco.repo.content.replication=error
201 |
202 | #log4j.logger.org.alfresco.repo.deploy.DeploymentServiceImpl=debug
203 |
204 | # Activity service
205 | log4j.logger.org.alfresco.repo.activities=warn
206 |
207 | # User usage tracking
208 | log4j.logger.org.alfresco.repo.usage=info
209 |
210 | # Sharepoint
211 | log4j.logger.org.alfresco.module.vti=info
212 |
213 | # Forms Engine
214 | log4j.logger.org.alfresco.repo.forms=info
215 | log4j.logger.org.alfresco.web.config.forms=info
216 | log4j.logger.org.alfresco.web.scripts.forms=info
217 |
218 | # CMIS
219 | log4j.logger.org.alfresco.opencmis=error
220 | log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error
221 | log4j.logger.org.alfresco.cmis=error
222 | log4j.logger.org.alfresco.cmis.dictionary=warn
223 | log4j.logger.org.apache.chemistry.opencmis=info
224 |
225 | # IMAP
226 | log4j.logger.org.alfresco.repo.imap=info
227 |
228 | # JBPM
229 | # Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler
230 | log4j.logger.org.jbpm.graph.def.GraphElement=fatal
231 |
232 | #log4j.logger.org.alfresco.repo.googledocs=debug
233 |
234 | ###### Scripting #######
235 |
236 | # Web Framework
237 | log4j.logger.org.springframework.extensions.webscripts=info
238 | log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn
239 | log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off
240 |
241 | # Repository
242 | log4j.logger.org.alfresco.repo.web.scripts=warn
243 | log4j.logger.org.alfresco.repo.web.scripts.BaseWebScriptTest=info
244 | log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=off
245 | log4j.logger.org.alfresco.repo.jscript=error
246 | log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn
247 | log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info
248 |
249 | log4j.logger.org.alfresco.repo.avm.actions=info
250 |
251 | # Freemarker
252 | # Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler
253 | log4j.logger.freemarker.runtime=
254 |
255 | # Metadata extraction
256 | log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn
257 |
258 | # Reduces PDFont error level due to ALF-7105
259 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal
260 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal
261 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal
262 |
263 | # no index support
264 | log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal
265 | log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal
266 | log4j.logger.com.alfdev.alfresco=DEBUG
--------------------------------------------------------------------------------
/create-link-share/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # This is a full override of Alfresco 4.2.b log4j.properties
2 | # This file overwrites the alfresco.war log4j.properties
3 |
4 | # Set root logger level to error
5 | log4j.rootLogger=${app.log.root.level}, Console, File
6 |
7 | ###### Console appender definition #######
8 |
9 | # All outputs currently set to be a ConsoleAppender.
10 | log4j.appender.Console=org.apache.log4j.ConsoleAppender
11 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout
12 |
13 | # use log4j NDC to replace %x with tenant domain / username
14 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n
15 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
16 |
17 | ###### File appender definition #######
18 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
19 | log4j.appender.File.File=${app.log.dir}alfresco.log
20 | log4j.appender.File.Append=true
21 | log4j.appender.File.DatePattern='.'yyyy-MM-dd
22 | log4j.appender.File.layout=org.apache.log4j.PatternLayout
23 | log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
24 |
25 | ###### Hibernate specific appender definition #######
26 | #log4j.appender.file=org.apache.log4j.FileAppender
27 | #log4j.appender.file.File=hibernate.log
28 | #log4j.appender.file.layout=org.apache.log4j.PatternLayout
29 | #log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
30 |
31 | ###### Log level overrides #######
32 |
33 | # Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit)
34 | # Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime
35 | # control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via
36 | # Log4j addLoggerMBean as long as the logger exists and has been loaded.
37 |
38 | # Hibernate
39 | log4j.logger.org.hibernate=error
40 | log4j.logger.org.hibernate.util.JDBCExceptionReporter=fatal
41 | log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=fatal
42 | log4j.logger.org.hibernate.type=warn
43 | log4j.logger.org.hibernate.cfg.SettingsFactory=warn
44 |
45 | # Spring
46 | log4j.logger.org.springframework=warn
47 | # Turn off Spring remoting warnings that should really be info or debug.
48 | log4j.logger.org.springframework.remoting.support=error
49 | log4j.logger.org.springframework.util=error
50 |
51 | # Axis/WSS4J
52 | log4j.logger.org.apache.axis=info
53 | log4j.logger.org.apache.ws=info
54 |
55 | # CXF
56 | log4j.logger.org.apache.cxf=error
57 |
58 | # MyFaces
59 | log4j.logger.org.apache.myfaces.util.DebugUtils=info
60 | log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error
61 | log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error
62 | log4j.logger.org.apache.myfaces.taglib=error
63 |
64 | # OpenOfficeConnection
65 | log4j.logger.net.sf.jooreports.openoffice.connection=fatal
66 |
67 | # log prepared statement cache activity ###
68 | log4j.logger.org.hibernate.ps.PreparedStatementCache=info
69 |
70 | # Alfresco
71 | log4j.logger.org.alfresco=error
72 | log4j.logger.org.alfresco.repo.admin=info
73 | log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn
74 | log4j.logger.org.alfresco.repo.model.filefolder=warn
75 | log4j.logger.org.alfresco.repo.tenant=info
76 | log4j.logger.org.alfresco.repo.avm=info
77 | log4j.logger.org.alfresco.config=warn
78 | log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn
79 | log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn
80 | log4j.logger.org.alfresco.repo.management.subsystems=warn
81 | log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory=info
82 | log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext=warn
83 | log4j.logger.org.alfresco.repo.security.sync=info
84 | log4j.logger.org.alfresco.repo.security.person=info
85 |
86 | log4j.logger.org.alfresco.sample=info
87 | log4j.logger.org.alfresco.web=info
88 | #log4j.logger.org.alfresco.web.app.AlfrescoNavigationHandler=debug
89 | #log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug
90 | #log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug
91 | #log4j.logger.org.alfresco.web.bean.clipboard=debug
92 | log4j.logger.org.alfresco.repo.webservice=info
93 | log4j.logger.org.alfresco.service.descriptor.DescriptorService=info
94 | #log4j.logger.org.alfresco.web.page=debug
95 |
96 | log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error
97 | #log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info
98 |
99 | log4j.logger.org.alfresco.web.ui.common.Utils=error
100 | #log4j.logger.org.alfresco.web.ui.common.Utils=info
101 |
102 | log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info
103 | log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info
104 |
105 | # Specific patches
106 | log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info
107 | log4j.logger.org.alfresco.repo.version.VersionMigrator=info
108 | log4j.logger.org.alfresco.repo.admin.patch.impl.ResetWCMToGroupBasedPermissionsPatch=info
109 |
110 | log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info
111 | log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info
112 | log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info
113 | log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn
114 | log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn
115 | log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info
116 | log4j.logger.org.alfresco.repo.node.index.AVMFullIndexRecoveryComponent=info
117 | log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info
118 | log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn
119 | log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn
120 | log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn
121 | log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn
122 | log4j.logger.org.alfresco.util.AbstractTriggerBean=warn
123 | log4j.logger.org.alfresco.enterprise.repo.cache.cluster.KeepAliveHeartbeatReceiver=info
124 | log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn
125 |
126 | #log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug
127 |
128 | log4j.logger.org.alfresco.repo.workflow=info
129 |
130 | # CIFS server debugging
131 | log4j.logger.org.alfresco.smb.protocol=error
132 | #log4j.logger.org.alfresco.smb.protocol.auth=debug
133 | #log4j.logger.org.alfresco.acegi=debug
134 |
135 | # FTP server debugging
136 | log4j.logger.org.alfresco.ftp.protocol=error
137 | #log4j.logger.org.alfresco.ftp.server=debug
138 |
139 | # WebDAV debugging
140 | #log4j.logger.org.alfresco.webdav.protocol=debug
141 | log4j.logger.org.alfresco.webdav.protocol=error
142 |
143 | # NTLM servlet filters
144 | #log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug
145 | #log4j.logger.org.alfresco.repo.webdav.auth.NTLMAuthenticationFilter=debug
146 |
147 | # Kerberos servlet filters
148 | #log4j.logger.org.alfresco.web.app.servlet.KerberosAuthenticationFilter=debug
149 | #log4j.logger.org.alfresco.repo.webdav.auth.KerberosAuthenticationFilter=debug
150 |
151 | # File servers
152 | log4j.logger.org.alfresco.fileserver=warn
153 |
154 | # Repo filesystem debug logging
155 | #log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug
156 |
157 | # AVM filesystem debug logging
158 | #log4j.logger.org.alfresco.filesys.avm.AVMDiskDriver=debug
159 |
160 | # Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated
161 | log4j.logger.org.alfresco.repo.node.integrity=ERROR
162 |
163 | # Indexer debugging
164 | log4j.logger.org.alfresco.repo.search.Indexer=error
165 | #log4j.logger.org.alfresco.repo.search.Indexer=debug
166 |
167 | log4j.logger.org.alfresco.repo.search.impl.lucene.index=error
168 | log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=warn
169 | #log4j.logger.org.alfresco.repo.search.impl.lucene.index=DEBUG
170 |
171 | # Audit debugging
172 | # log4j.logger.org.alfresco.repo.audit=DEBUG
173 | # log4j.logger.org.alfresco.repo.audit.model=DEBUG
174 |
175 | # Forms debugging
176 | # log4j.logger.org.alfresco.web.forms=debug
177 | # log4j.logger.org.chiba.xml.xforms=debug
178 | log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error
179 | log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error
180 |
181 | # Property sheet and modelling debugging
182 | # change to error to hide the warnings about missing properties and associations
183 | log4j.logger.alfresco.missingProperties=warn
184 | log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn
185 | log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn
186 | #log4j.logger.org.alfresco.web.ui.repo.component.property=debug
187 |
188 | # Dictionary/Model debugging
189 | log4j.logger.org.alfresco.repo.dictionary=warn
190 | log4j.logger.org.alfresco.repo.dictionary.types.period=warn
191 |
192 | # Virtualization Server Registry
193 | log4j.logger.org.alfresco.mbeans.VirtServerRegistry=error
194 |
195 | # Spring context runtime property setter
196 | log4j.logger.org.alfresco.util.RuntimeSystemPropertiesSetter=info
197 |
198 | # Debugging options for clustering
199 | log4j.logger.org.alfresco.repo.content.ReplicatingContentStore=error
200 | log4j.logger.org.alfresco.repo.content.replication=error
201 |
202 | #log4j.logger.org.alfresco.repo.deploy.DeploymentServiceImpl=debug
203 |
204 | # Activity service
205 | log4j.logger.org.alfresco.repo.activities=warn
206 |
207 | # User usage tracking
208 | log4j.logger.org.alfresco.repo.usage=info
209 |
210 | # Sharepoint
211 | log4j.logger.org.alfresco.module.vti=info
212 |
213 | # Forms Engine
214 | log4j.logger.org.alfresco.repo.forms=info
215 | log4j.logger.org.alfresco.web.config.forms=info
216 | log4j.logger.org.alfresco.web.scripts.forms=info
217 |
218 | # CMIS
219 | log4j.logger.org.alfresco.opencmis=error
220 | log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error
221 | log4j.logger.org.alfresco.cmis=error
222 | log4j.logger.org.alfresco.cmis.dictionary=warn
223 | log4j.logger.org.apache.chemistry.opencmis=info
224 |
225 | # IMAP
226 | log4j.logger.org.alfresco.repo.imap=info
227 |
228 | # JBPM
229 | # Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler
230 | log4j.logger.org.jbpm.graph.def.GraphElement=fatal
231 |
232 | #log4j.logger.org.alfresco.repo.googledocs=debug
233 |
234 | ###### Scripting #######
235 |
236 | # Web Framework
237 | log4j.logger.org.springframework.extensions.webscripts=info
238 | log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn
239 | log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off
240 |
241 | # Repository
242 | log4j.logger.org.alfresco.repo.web.scripts=warn
243 | log4j.logger.org.alfresco.repo.web.scripts.BaseWebScriptTest=info
244 | log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=off
245 | log4j.logger.org.alfresco.repo.jscript=error
246 | log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn
247 | log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info
248 |
249 | log4j.logger.org.alfresco.repo.avm.actions=info
250 |
251 | # Freemarker
252 | # Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler
253 | log4j.logger.freemarker.runtime=
254 |
255 | # Metadata extraction
256 | log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn
257 |
258 | # Reduces PDFont error level due to ALF-7105
259 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal
260 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal
261 | log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal
262 |
263 | # no index support
264 | log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal
265 | log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal
266 | log4j.logger.com.alfdev.alfresco=DEBUG
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/create-link-repo/src/main/java/com/alfdev/alfresco/repo/web/scripts/doclib/CreateLinkPost.java:
--------------------------------------------------------------------------------
1 | package com.alfdev.alfresco.repo.web.scripts.doclib;
2 |
3 | import java.io.IOException;
4 | import java.io.Serializable;
5 | import java.util.ArrayList;
6 | import java.util.HashMap;
7 | import java.util.List;
8 | import java.util.Map;
9 |
10 | import org.alfresco.error.AlfrescoRuntimeException;
11 | import org.alfresco.model.ApplicationModel;
12 | import org.alfresco.model.ContentModel;
13 | import org.alfresco.repo.i18n.MessageService;
14 | import org.alfresco.repo.search.QueryParameterDefImpl;
15 | import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
16 | import org.alfresco.service.cmr.dictionary.DictionaryService;
17 | import org.alfresco.service.cmr.repository.ChildAssociationRef;
18 | import org.alfresco.service.cmr.repository.NodeRef;
19 | import org.alfresco.service.cmr.repository.NodeService;
20 | import org.alfresco.service.cmr.repository.Path;
21 | import org.alfresco.service.cmr.search.QueryParameterDefinition;
22 | import org.alfresco.service.cmr.search.SearchService;
23 | import org.alfresco.service.cmr.site.SiteService;
24 | import org.alfresco.service.namespace.NamespaceService;
25 | import org.alfresco.service.namespace.QName;
26 | import org.alfresco.util.ISO9075;
27 | import org.apache.commons.logging.Log;
28 | import org.apache.commons.logging.LogFactory;
29 | import org.json.simple.JSONObject;
30 | import org.json.simple.parser.JSONParser;
31 | import org.json.simple.parser.ParseException;
32 | import org.springframework.extensions.webscripts.Cache;
33 | import org.springframework.extensions.webscripts.DeclarativeWebScript;
34 | import org.springframework.extensions.webscripts.Status;
35 | import org.springframework.extensions.webscripts.WebScriptException;
36 | import org.springframework.extensions.webscripts.WebScriptRequest;
37 |
38 | /**
39 | *
40 | * CreateLinkPost java web script controller. Web script accepts destination folder nodeRef as URL-path
41 | * parameter. JSON body contains list of nodeRefs to be linked and parentId (parent folder
42 | * nodeRef of specified nodeRefs). Creation of both file and folder links supported.
43 | *
44 | *
45 | *
46 | * Implementation is based on Alfresco REST API java-script controller copy-to.post.json.js (execution
47 | * flow, parameters checks and generating result part) and Alfresco Explorer's "Paste As Link" Shelf's functionality
48 | * (link creation part).
49 | *
50 | *
51 | * @author Sinisa Komarica
52 | *
53 | */
54 | public class CreateLinkPost extends DeclarativeWebScript
55 | {
56 | protected final Log logger = LogFactory.getLog(CreateLinkPost.class);
57 |
58 | private static final String LINK_NODE_EXTENSION = ".url";
59 | private static final String MSG_LINK_TO = "link_to";
60 |
61 | /** Shallow search for nodes with a name pattern */
62 | public static final String XPATH_QUERY_NODE_MATCH = "./*[like(@cm:name, $cm:name, false)]";
63 |
64 | protected NodeService nodeService;
65 | protected DictionaryService dictionaryService;
66 | protected SiteService siteService;
67 | protected SearchService searchService;
68 | protected MessageService messageService;
69 | protected NamespaceService namespaceService;
70 |
71 | @Override
72 | protected Map executeImpl(WebScriptRequest req, Status status, Cache cache)
73 | {
74 | // Extract mandatory destination folder NodeRef from URL
75 | NodeRef destinationRef = null;
76 | Map templateArgs = req.getServiceMatch().getTemplateVars();
77 |
78 | if (templateArgs.get("store_type") != null && templateArgs.get("store_id") != null
79 | && templateArgs.get("id") != null)
80 | {
81 | destinationRef = new NodeRef(templateArgs.get("store_type"), templateArgs.get("store_id"),
82 | templateArgs.get("id"));
83 | if (!nodeService.exists(destinationRef))
84 | {
85 | status.setCode(Status.STATUS_NOT_FOUND);
86 | status.setRedirect(true);
87 | return null;
88 | }
89 | }
90 | else
91 | {
92 | throw new WebScriptException(Status.STATUS_BAD_REQUEST, "No parent details found");
93 | }
94 |
95 | // Process the JSON post details
96 | JSONObject json = null;
97 | JSONParser parser = new JSONParser();
98 | try
99 | {
100 | json = (JSONObject) parser.parse(req.getContent().getContent());
101 | }
102 | catch (IOException io)
103 | {
104 | throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Invalid JSON: " + io.getMessage());
105 | }
106 | catch (ParseException pe)
107 | {
108 | throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Invalid JSON: " + pe.getMessage());
109 | }
110 |
111 | // Fetch necessary data from JSON
112 | List> sourceRefObjectList = (List>) json.get("nodeRefs");
113 |
114 | // Must have list of files
115 | if (sourceRefObjectList == null || sourceRefObjectList.isEmpty())
116 | {
117 | throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Invalid JSON: No files.");
118 | }
119 |
120 | List