diff --git a/build.gradle b/build.gradle
index 4faaac8596..bb38b225da 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,16 +15,6 @@ task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-8'
}
-task downloadAlfresco << {
-
- def address = "https://bamboo.alfresco.com/bamboo/artifact/ALF-ENTERPRISEV40/JOB1/build-891/ALL/alfresco-enterprise-4.0.1.zip?os_authType=basic&os_username=rwetherall&os_password=31vegaleg"
-
- def file = new FileOutputStream(file('alfresco.zip'))
- def out = new BufferedOutputStream(file)
- out << new URL(address).openStream()
- out.close()
-}
-
/** Subproject configuration */
subprojects {
@@ -50,6 +40,7 @@ subprojects {
jarFile = "${baseName}.jar"
ampFile = "${baseName}.amp"
tomcatRoot = System.getenv(tomcatEnv)
+ jarFilePath = "${buildLibDir}/${jarFile}"
sourceSets {
main {
@@ -161,7 +152,6 @@ subprojects {
task amp(dependsOn: 'jar') << {
- def jarFilePath = "${buildLibDir}/${jarFile}"
def jarFileObj = file(jarFilePath)
def configDirObj = file(configDir)
def sourceWebObj = file(sourceWebDir)
@@ -197,6 +187,46 @@ subprojects {
}
}
+ task deployExploded(dependsOn: 'jar') << {
+
+ def jarFileObj = file(jarFilePath)
+ def configDirObj = file(configDir)
+ def sourceWebObj = file(sourceWebDir)
+
+ explodedWebAppDir = new File("${tomcatRoot}/webapps/${webAppName}")
+ if (explodedWebAppDir.exists() == true) {
+
+ // copy module properties
+
+ // copy jars
+ if (jarFileObj.exists()) {
+ copy {
+ from jarFilePath
+ into "${explodedWebAppDir}/WEB-INF/lib"
+ }
+ }
+
+ // copy config
+ if (configDirObj.exists() == true) {
+ copy {
+ from(configDir) {
+ exclude "**/${moduleProperties}"
+ exclude "**/${fileMapping}"
+ }
+ into "${explodedWebAppDir}/WEB-INF/classes"
+
+ }
+ }
+
+ // copy web
+ if (sourceWebObj.exists() == true) {
+ }
+ }
+ else {
+ println "Exploded webapp directory ${explodedWebAppDir} does not exist."
+ }
+ }
+
task installAmp(dependsOn: ['amp', 'copyWar']) << {
def warFileLocation = file("${buildDistDir}/${warFile}")
diff --git a/rm-server/.classpath b/rm-server/.classpath
index 10f3e73b1d..e2ff39fa0f 100644
--- a/rm-server/.classpath
+++ b/rm-server/.classpath
@@ -249,7 +249,7 @@
-
+
diff --git a/rm-server/build.gradle b/rm-server/build.gradle
index 75520e3ae5..0008684d53 100644
--- a/rm-server/build.gradle
+++ b/rm-server/build.gradle
@@ -20,7 +20,4 @@ test {
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
- //onOutput { descriptor, event ->
- // logger.lifecycle(event.message)
- //}
}
\ No newline at end of file
diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-capabilities-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-capabilities-context.xml
index dce641860e..29354fe42d 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-capabilities-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-capabilities-context.xml
@@ -48,7 +48,6 @@
-
RECORD_CATEGORY
DISPOSITION_SCHEDULE
-
+
+
+
+
-
-
-
+
RECORD
@@ -827,7 +830,9 @@
-
+
diff --git a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js
new file mode 100644
index 0000000000..947666762f
--- /dev/null
+++ b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js
@@ -0,0 +1,264 @@
+const REQUEST_MAX = 1000;
+
+/**
+ * Main entry point: Create collection of documents and folders in the given space
+ *
+ * @method doclist_main
+ */
+function doclist_main()
+{
+ // Use helper function to get the arguments
+ var parsedArgs = ParseArgs.getParsedArgs();
+ if (parsedArgs === null)
+ {
+ return;
+ }
+
+ var filter = args.filter,
+ items = [];
+
+ // Try to find a filter query based on the passed-in arguments
+ var allNodes = [],
+ totalRecords = 0,
+ requestTotalCountMax = 0,
+ paged = false,
+ favourites = Common.getFavourites(),
+ filterParams = Filters.getFilterParams(filter, parsedArgs,
+ {
+ favourites: favourites
+ }),
+ query = filterParams.query;
+
+ if ((filter || "path") == "path")
+ {
+ // TODO also add DB filter by "node" (in addition to "path")
+ var parentNode = parsedArgs.pathNode;
+ if (parentNode !== null)
+ {
+ var skip = -1,
+ max = -1;
+
+ if (args.size != null)
+ {
+ max = args.size;
+
+ if (args.pos > 0)
+ {
+ skip = (args.pos - 1) * max;
+ }
+ }
+
+ var sortField = (args.sortField == null ? "cm:name" : args.sortField),
+ sortAsc = (((args.sortAsc == null) || (args.sortAsc == "true")) ? true : false);
+
+ // Get paged set
+ requestTotalCountMax = skip + REQUEST_MAX;
+ var pagedResult = parentNode.childFileFolders(true, true, filterParams.ignoreTypes, skip, max, requestTotalCountMax, sortField, sortAsc, "TODO");
+
+ allNodes = pagedResult.page;
+ totalRecords = pagedResult.totalResultCountUpper;
+ paged = true;
+ }
+ }
+ else
+ {
+ // Query the nodes - passing in sort and result limit parameters
+ if (query !== "")
+ {
+ allNodes = search.query(
+ {
+ query: query,
+ language: filterParams.language,
+ page:
+ {
+ maxItems: (filterParams.limitResults ? parseInt(filterParams.limitResults, 10) : 0)
+ },
+ sort: filterParams.sort,
+ templates: filterParams.templates,
+ namespace: (filterParams.namespace ? filterParams.namespace : null)
+ });
+
+ totalRecords = allNodes.length;
+ }
+ }
+
+ // Ensure folders and folderlinks appear at the top of the list
+ var folderNodes = [],
+ documentNodes = [];
+
+ for each (node in allNodes)
+ {
+ try
+ {
+ if (node.isContainer || node.isLinkToContainer)
+ {
+ folderNodes.push(node);
+ }
+ else
+ {
+ documentNodes.push(node);
+ }
+ }
+ catch (e)
+ {
+ // Possibly an old indexed node - ignore it
+ }
+ }
+
+ // Node type counts
+ var folderNodesCount = folderNodes.length,
+ documentNodesCount = documentNodes.length,
+ nodes;
+
+ if (parsedArgs.type === "documents")
+ {
+ nodes = documentNodes;
+ totalRecords -= folderNodesCount;
+ }
+ else
+ {
+ // TODO: Sorting with folders at end -- swap order of concat()
+ nodes = folderNodes.concat(documentNodes);
+ }
+
+ // Pagination
+ var pageSize = args.size || nodes.length,
+ pagePos = args.pos || "1",
+ startIndex = (pagePos - 1) * pageSize;
+
+ if (!paged)
+ {
+ // Trim the nodes array down to the page size
+ nodes = nodes.slice(startIndex, pagePos * pageSize);
+ }
+
+ // Common or variable parent container?
+ var parent = null;
+
+ if (!filterParams.variablePath)
+ {
+ // Parent node permissions (and Site role if applicable)
+ parent = Evaluator.run(parsedArgs.pathNode, true);
+ }
+
+ var isThumbnailNameRegistered = thumbnailService.isThumbnailNameRegistered(THUMBNAIL_NAME),
+ thumbnail = null,
+ locationNode,
+ item;
+
+ // Loop through and evaluate each node in this result set
+ for each (node in nodes)
+ {
+ // Get evaluated properties.
+ item = Evaluator.run(node);
+ if (item !== null)
+ {
+ item.isFavourite = (favourites[item.node.nodeRef] === true);
+ item.likes = Common.getLikes(node);
+
+ // Does this collection of nodes have potentially differering paths?
+ if (filterParams.variablePath || item.isLink)
+ {
+ locationNode = item.isLink ? item.linkedNode : item.node;
+ location = Common.getLocation(locationNode, parsedArgs.libraryRoot);
+ // Parent node
+ if (node.parent != null &&
+ (node.parent.hasPermission("Read") || node.parent.hasPermission("ReadRecords")))
+ {
+ item.parent = Evaluator.run(node.parent, true);
+ }
+ }
+ else
+ {
+ location =
+ {
+ site: parsedArgs.location.site,
+ siteTitle: parsedArgs.location.siteTitle,
+ sitePreset: parsedArgs.location.sitePreset,
+ container: parsedArgs.location.container,
+ containerType: parsedArgs.location.containerType,
+ path: parsedArgs.location.path,
+ file: node.name
+ };
+ }
+
+ // Resolved location
+ item.location = location;
+
+ // Check: thumbnail type is registered && node is a cm:content subtype && valid inputStream for content property
+ if (isThumbnailNameRegistered && item.node.isSubType("cm:content") && item.node.properties.content.inputStream != null)
+ {
+ // Make sure we have a thumbnail.
+ thumbnail = item.node.getThumbnail(THUMBNAIL_NAME);
+ if (thumbnail === null)
+ {
+ // No thumbnail, so queue creation
+ item.node.createThumbnail(THUMBNAIL_NAME, true);
+ }
+ }
+
+ items.push(item);
+ }
+ else
+ {
+ --totalRecords;
+ }
+ }
+
+ // Array Remove - By John Resig (MIT Licensed)
+ var fnArrayRemove = function fnArrayRemove(array, from, to)
+ {
+ var rest = array.slice((to || from) + 1 || array.length);
+ array.length = from < 0 ? array.length + from : from;
+ return array.push.apply(array, rest);
+ };
+
+ /**
+ * De-duplicate orignals for any existing working copies.
+ * This can't be done in evaluator.lib.js as it has no knowledge of the current filter or UI operation.
+ * Note: This may result in pages containing less than the configured amount of items (50 by default).
+ */
+ for each (item in items)
+ {
+ if (item.workingCopy.isWorkingCopy)
+ {
+ var workingCopySource = String(item.workingCopy.sourceNodeRef);
+ for (var i = 0, ii = items.length; i < ii; i++)
+ {
+ if (String(items[i].node.nodeRef) == workingCopySource)
+ {
+ fnArrayRemove(items, i);
+ --totalRecords;
+ break;
+ }
+ }
+ }
+ }
+
+ var paging =
+ {
+ totalRecords: totalRecords,
+ startIndex: startIndex
+ };
+
+ if (paged && (totalRecords == requestTotalCountMax))
+ {
+ paging.totalRecordsUpper = requestTotalCountMax;
+ }
+
+ return (
+ {
+ luceneQuery: query,
+ paging: paging,
+ container: parsedArgs.rootNode,
+ parent: parent,
+ onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"),
+ itemCount:
+ {
+ folders: folderNodesCount,
+ documents: documentNodesCount
+ },
+ items: items,
+ customJSON: slingshotDocLib.getJSON()
+ });
+}
diff --git a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/node.get.js b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/node.get.js
new file mode 100644
index 0000000000..145314fb8c
--- /dev/null
+++ b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/node.get.js
@@ -0,0 +1,77 @@
+
+
+
+/**
+ * Main entry point: Return single document or folder given it's nodeRef
+ *
+ * @method getDoclist
+ */
+function getDoclist()
+{
+ // Use helper function to get the arguments
+ var parsedArgs = ParseArgs.getParsedArgs();
+ if (parsedArgs === null)
+ {
+ return;
+ }
+
+ parsedArgs.pathNode = ParseArgs.resolveNode(parsedArgs.nodeRef);
+ parsedArgs.location = Common.getLocation(parsedArgs.pathNode, parsedArgs.libraryRoot);
+
+ var favourites = Common.getFavourites(),
+ node = parsedArgs.pathNode;
+
+ var isThumbnailNameRegistered = thumbnailService.isThumbnailNameRegistered(THUMBNAIL_NAME),
+ thumbnail = null,
+ item = Evaluator.run(node);
+
+ item.isFavourite = (favourites[node.nodeRef] === true);
+ item.likes = Common.getLikes(node);
+ item.location =
+ {
+ site: parsedArgs.location.site,
+ siteTitle: parsedArgs.location.siteTitle,
+ container: parsedArgs.location.container,
+ containerType: parsedArgs.location.containerType,
+ path: parsedArgs.location.path,
+ file: node.name
+ };
+
+ item.parent = {};
+ if (node.parent != null && (node.parent.hasPermission("Read") || node.parent.hasPermission("ReadRecords")))
+ {
+ item.parent = Evaluator.run(node.parent, true);
+ }
+
+ // Special case for container and libraryRoot nodes
+ if ((parsedArgs.location.containerNode && String(parsedArgs.location.containerNode.nodeRef) == String(node.nodeRef)) ||
+ (parsedArgs.libraryRoot && String(parsedArgs.libraryRoot.nodeRef) == String(node.nodeRef)))
+ {
+ item.location.file = "";
+ }
+
+ // Check: thumbnail type is registered && node is a cm:content subtype && valid inputStream for content property
+ if (isThumbnailNameRegistered && item.node.isSubType("cm:content") && item.node.properties.content.inputStream != null)
+ {
+ // Make sure we have a thumbnail.
+ thumbnail = item.node.getThumbnail(THUMBNAIL_NAME);
+ if (thumbnail === null)
+ {
+ // No thumbnail, so queue creation
+ item.node.createThumbnail(THUMBNAIL_NAME, true);
+ }
+ }
+
+ return (
+ {
+ container: parsedArgs.rootNode,
+ onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"),
+ item: item,
+ customJSON: slingshotDocLib.getJSON()
+ });
+}
+
+/**
+ * Document List Component: doclist
+ */
+model.doclist = getDoclist();
\ No newline at end of file
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java
index 92543eaf4b..9ab72d3ae2 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java
@@ -31,7 +31,7 @@ import java.util.Set;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
import org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService;
-import org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability;
+import org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionActionDefinition;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/AbstractCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/AbstractCapability.java
similarity index 91%
rename from rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/AbstractCapability.java
rename to rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/AbstractCapability.java
index 081d5db447..5ad0a2c4fa 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/AbstractCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/AbstractCapability.java
@@ -16,7 +16,7 @@
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see .
*/
-package org.alfresco.module.org_alfresco_module_rm.capability.impl;
+package org.alfresco.module.org_alfresco_module_rm.capability;
import java.util.ArrayList;
import java.util.List;
@@ -24,11 +24,6 @@ import java.util.List;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction;
-import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
-import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
-import org.alfresco.module.org_alfresco_module_rm.capability.RMEntryVoter;
-import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
-import org.alfresco.module.org_alfresco_module_rm.capability.RMSecurityCommon;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/DeclarativeCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/DeclarativeCapability.java
index 5b9927d1a5..40e1a9ac17 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/DeclarativeCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/DeclarativeCapability.java
@@ -26,7 +26,7 @@ import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.module.org_alfresco_module_rm.FilePlanComponentKind;
-import org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability;
+import org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
import org.springframework.beans.BeansException;
@@ -41,7 +41,7 @@ import org.springframework.context.ApplicationContextAware;
public class DeclarativeCapability extends AbstractCapability implements ApplicationContextAware
{
/** Application Context */
- private ApplicationContext applicationContext;
+ protected ApplicationContext applicationContext;
/** Required permissions */
private List permissions;
@@ -233,7 +233,7 @@ public class DeclarativeCapability extends AbstractCapability implements Applica
}
/**
- * @see org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability#hasPermissionImpl(org.alfresco.service.cmr.repository.NodeRef)
+ * @see org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability#hasPermissionImpl(org.alfresco.service.cmr.repository.NodeRef)
*/
@Override
public int evaluate(NodeRef nodeRef)
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/condition/FillingCapabilityCondition.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/condition/FillingCapabilityCondition.java
index 61366a9629..f199155f3e 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/condition/FillingCapabilityCondition.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/declarative/condition/FillingCapabilityCondition.java
@@ -18,14 +18,10 @@
*/
package org.alfresco.module.org_alfresco_module_rm.capability.declarative.condition;
-import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.AbstractCapabilityCondition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
-import org.alfresco.service.namespace.QName;
/**
* Filling capability condition.
@@ -34,17 +30,6 @@ import org.alfresco.service.namespace.QName;
*/
public class FillingCapabilityCondition extends AbstractCapabilityCondition
{
- /** Dictionary service */
- private DictionaryService dictionaryService;
-
- /**
- * @param dictionaryService dictionary service
- */
- public void setDictionaryService(DictionaryService dictionaryService)
- {
- this.dictionaryService = dictionaryService;
- }
-
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.declarative.CapabilityCondition#evaluate(org.alfresco.service.cmr.repository.NodeRef)
*/
@@ -53,65 +38,11 @@ public class FillingCapabilityCondition extends AbstractCapabilityCondition
{
boolean result = false;
- NodeRef filePlan = rmService.getFilePlan(nodeRef);
-
- if (permissionService.hasPermission(filePlan, RMPermissionModel.ROLE_ADMINISTRATOR) == AccessStatus.ALLOWED)
+ if (permissionService.hasPermission(nodeRef, RMPermissionModel.FILE_RECORDS) != AccessStatus.DENIED)
{
result = true;
}
- else
- {
- QName nodeType = nodeService.getType(nodeRef);
- if (rmService.isRecord(nodeRef) == true ||
- dictionaryService.isSubClass(nodeType, ContentModel.TYPE_CONTENT) == true)
- {
- // Multifiling - if you have filing rights to any of the folders in which the record resides
- // then you have filing rights.
- for (ChildAssociationRef car : nodeService.getParentAssocs(nodeRef))
- {
- if (car != null)
- {
- if (permissionService.hasPermission(car.getParentRef(), RMPermissionModel.FILE_RECORDS) == AccessStatus.ALLOWED)
- {
- result = true;
- break;
- }
- }
- }
- }
- else if (rmService.isRecordFolder(nodeRef) == true)
- {
- if (permissionService.hasPermission(nodeRef, RMPermissionModel.FILE_RECORDS) != AccessStatus.DENIED)
- {
- result = true;
- }
- }
- else if (rmService.isRecordCategory(nodeRef) == true)
- {
- if (permissionService.hasPermission(nodeRef, RMPermissionModel.FILE_RECORDS) != AccessStatus.DENIED)
- {
- result = true;
- }
- else if (permissionService.hasPermission(filePlan, RMPermissionModel.CREATE_MODIFY_DESTROY_FOLDERS) != AccessStatus.DENIED)
- {
- result = true;
- }
- }
- // else other file plan component
- else
- {
- if (permissionService.hasPermission(nodeRef, RMPermissionModel.FILE_RECORDS) != AccessStatus.DENIED)
- {
- result = true;
- }
- else if (permissionService.hasPermission(filePlan, RMPermissionModel.CREATE_MODIFY_DESTROY_FILEPLAN_METADATA) != AccessStatus.DENIED)
- {
- result = true;
- }
- }
-
- }
- return result;
+ return result;
}
}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeclareCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeclareCapability.java
index 9e696f855a..060b5f83c6 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeclareCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeclareCapability.java
@@ -20,9 +20,9 @@ package org.alfresco.module.org_alfresco_module_rm.capability.group;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
+import org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
-import org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability;
import org.alfresco.service.cmr.repository.NodeRef;
/**
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeleteCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeleteCapability.java
index 2af89a535a..9b7395d851 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeleteCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/DeleteCapability.java
@@ -20,9 +20,9 @@ package org.alfresco.module.org_alfresco_module_rm.capability.group;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
+import org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
-import org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability;
import org.alfresco.service.cmr.repository.NodeRef;
/**
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdateCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdateCapability.java
index 39160cd70b..671dad38a9 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdateCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdateCapability.java
@@ -23,8 +23,8 @@ import java.util.Map;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
+import org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
-import org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdatePropertiesCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdatePropertiesCapability.java
index cf36f4909a..b1423fcd29 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdatePropertiesCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/group/UpdatePropertiesCapability.java
@@ -23,8 +23,8 @@ import java.util.Map;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
+import org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
-import org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/ChangeOrDeleteReferencesCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/ChangeOrDeleteReferencesCapability.java
index 121cf3b263..1d7143be12 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/ChangeOrDeleteReferencesCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/ChangeOrDeleteReferencesCapability.java
@@ -41,7 +41,7 @@ public class ChangeOrDeleteReferencesCapability extends DeclarativeCapability
}
/**
- * @see org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
+ * @see org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
*/
public int evaluate(NodeRef source, NodeRef target)
{
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/DeleteLinksCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/DeleteLinksCapability.java
index 20273a3e43..75d7347ae2 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/DeleteLinksCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/DeleteLinksCapability.java
@@ -41,7 +41,7 @@ public class DeleteLinksCapability extends DeclarativeCapability
}
/**
- * @see org.alfresco.module.org_alfresco_module_rm.capability.impl.AbstractCapability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
+ * @see org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
*/
public int evaluate(NodeRef source, NodeRef target)
{
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/EditRecordMetadataCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/EditRecordMetadataCapability.java
index aaa806b263..e93f534173 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/EditRecordMetadataCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/EditRecordMetadataCapability.java
@@ -31,17 +31,17 @@ import org.alfresco.service.cmr.security.OwnableService;
*
* @author Roy Wetherall
*/
-public class EditRecordMetadataCapability extends DeclarativeCapability
+public class EditRecordMetadataCapability extends DeclarativeCapability
{
- /** Ownable service */
private OwnableService ownableService;
-
- /**
- * @param ownableService ownable service
- */
- public void setOwnableService(OwnableService ownableService)
+
+ private OwnableService getOwnableService()
{
- this.ownableService = ownableService;
+ if (ownableService == null)
+ {
+ ownableService = (OwnableService)applicationContext.getBean("OwnableService");
+ }
+ return ownableService;
}
/**
@@ -76,11 +76,11 @@ public class EditRecordMetadataCapability extends DeclarativeCapability
// Since we know this is undeclared if you are the owner then you should be able to
// edit the records meta-data (otherwise how can it be declared by the user?)
- if (ownableService.hasOwner(nodeRef) == true)
+ if (getOwnableService().hasOwner(nodeRef) == true)
{
String user = AuthenticationUtil.getFullyAuthenticatedUser();
if (user != null &&
- ownableService.getOwner(nodeRef).equals(user) == true)
+ getOwnableService().getOwner(nodeRef).equals(user) == true)
{
result = Integer.valueOf(AccessDecisionVoter.ACCESS_GRANTED);
}
diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/capabilities/AddModifyEventDatesCapabilityTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/capabilities/AddModifyEventDatesCapabilityTest.java
deleted file mode 100644
index 4d2dba2b8d..0000000000
--- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/capabilities/AddModifyEventDatesCapabilityTest.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.module.org_alfresco_module_rm.test.capabilities;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.module.org_alfresco_module_rm.action.impl.CompleteEventAction;
-import org.alfresco.module.org_alfresco_module_rm.action.impl.FreezeAction;
-import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
-import org.alfresco.service.cmr.security.AccessStatus;
-
-/**
- * @author Roy Wetherall
- */
-public class AddModifyEventDatesCapabilityTest extends BaseTestCapabilities
-{
- /**
- *
- * @throws Exception
- */
- public void testAddModifyEventDatesCapability() throws Exception
- {
- // Check file plan permissions
- checkPermissions(
- filePlan,
- ADD_MODIFY_EVENT_DATES,
- stdUsers,
- new AccessStatus[]
- {
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.DENIED
- });
-
- checkCapabilities(
- recordFolder_1,
- ADD_MODIFY_EVENT_DATES,
- stdUsers,
- new AccessStatus[]
- {
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.DENIED
- });
-
- checkCapabilities(
- record_1,
- ADD_MODIFY_EVENT_DATES,
- stdUsers,
- new AccessStatus[]
- {
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED
- });
-
- checkCapabilities(
- recordFolder_2,
- ADD_MODIFY_EVENT_DATES,
- stdUsers,
- new AccessStatus[]
- {
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED,
- AccessStatus.DENIED
- });
-
- checkCapabilities(
- record_2,
- ADD_MODIFY_EVENT_DATES,
- stdUsers,
- new AccessStatus[]
- {
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.ALLOWED,
- AccessStatus.DENIED
- });
-
- /** Test user has no capabilities */
- checkTestUserCapabilities(ADD_MODIFY_EVENT_DATES,
- AccessStatus.DENIED, // recordFolder_1
- AccessStatus.DENIED, // record_1
- AccessStatus.DENIED, // recordFolder_2
- AccessStatus.DENIED); // record_2
-
- /** Add filing to both record folders */
- retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback