mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-563 (Add group id and title to Capability API and definitions)
* Sorting capabilities git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@44305 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -54,9 +54,12 @@ public abstract class AbstractCapability extends RMSecurityCommon
|
||||
protected String title;
|
||||
protected String description;
|
||||
|
||||
/** Capability Group */
|
||||
/** Capability group */
|
||||
protected Group group;
|
||||
|
||||
/** Capability index */
|
||||
protected String index;
|
||||
|
||||
/** Indicates whether this is a private capability or not */
|
||||
protected boolean isPrivate = false;
|
||||
|
||||
@@ -322,6 +325,19 @@ public abstract class AbstractCapability extends RMSecurityCommon
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getIndex()
|
||||
*/
|
||||
public String getIndex()
|
||||
{
|
||||
return this.index;
|
||||
}
|
||||
|
||||
public void setIndex(String index)
|
||||
{
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
|
@@ -95,4 +95,11 @@ public interface Capability
|
||||
* @return Group capability group
|
||||
*/
|
||||
Group getGroup();
|
||||
|
||||
/**
|
||||
* Gets the index of a capability
|
||||
*
|
||||
* @return String capability index
|
||||
*/
|
||||
String getIndex();
|
||||
}
|
||||
|
@@ -188,6 +188,7 @@ public class CapabilityServiceImpl implements CapabilityService
|
||||
|
||||
Collections.sort(groups, new Comparator<Group>()
|
||||
{
|
||||
@Override
|
||||
public int compare(Group g1, Group g2)
|
||||
{
|
||||
return Integer.parseInt(g1.getIndex()) - Integer.parseInt(g2.getIndex());
|
||||
@@ -220,6 +221,15 @@ public class CapabilityServiceImpl implements CapabilityService
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(capabilities, new Comparator<Capability>()
|
||||
{
|
||||
@Override
|
||||
public int compare(Capability c1, Capability c2)
|
||||
{
|
||||
return Integer.parseInt(c1.getIndex()) - Integer.parseInt(c2.getIndex());
|
||||
}
|
||||
});
|
||||
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,7 @@ public class CapabilitiesGet extends DeclarativeWebScript
|
||||
grouped = Boolean.parseBoolean(groupedString);
|
||||
}
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>(1);
|
||||
Map<String, Object> model = new TreeMap<String, Object>();
|
||||
if (grouped == true)
|
||||
{
|
||||
// Construct the map which is needed to build the model
|
||||
@@ -174,7 +174,7 @@ public class CapabilitiesGet extends DeclarativeWebScript
|
||||
this.capabilityGroupTitle = capabilityGroupTitle;
|
||||
this.capabilityName = capabilityName;
|
||||
this.capabilityTitle = capabilityTitle;
|
||||
this.capabilities = new HashMap<String, String>(5);
|
||||
this.capabilities = new TreeMap<String, String>();
|
||||
}
|
||||
|
||||
public String getGroupId()
|
||||
|
Reference in New Issue
Block a user