I am trying to use authority.ftl to select a group that is going to be used in an action for editing group roles. How do i write the java action so that there are no erros? Tried this
protected void addParameterDefinitions(List<ParameterDefinition> list) {
list.add(new ParameterDefinitionImpl(X, DataTypeDefinition.TEXT, true,getParamDisplayLabel(X)));
}
But i got the error that the types were different, think it was field.endpointtype. What is this, and how do i get it in the addParameterDefinitions, what type does the authority.ftl return, a string? I assume that you can use AuthorityService afterwards to get the group name or something similar.
Thanks in advance for the help.
This is exactly the way I use it.
How do i extract the groupname from node_ref?
This is what i used when i used textfield instead of authority.
Just changed the Strings to NodeRef as stupid me didnt notice that could be done, but what class is used to get the name of the authority?
There are other ways, this is one of them:
NodeRef groupNodeRef = (NodeRef) action.getParameterValue(PARAM_GROUP_NAME);
String groupName = nodeService.getProperty(groupNodeRef, ContentModel.PROP_NAME).toString();
I tried that, but i still get the error, maybe there is something wrong with how i added the form?
Here is the whole class, probably makes it easier to notice where things go wrong...
The class takes the groupname, makes a folder of it, and gives permissions to the group
You can do something like:
final NodeRef group = (NodeRef) action.getParameterValue(PARAM_GROUP_NAME); // your parameter should be simply PARAM_GROUP, as there is no real name in it
Map<QName, Serializable> groupProperties = nodeService.getProperties(group);
And then you can read the property you want from the groupProperties object.
I have not tested the code, but I guess you will be able to fix it if required.
My bad... I left the tab open when I went to have lunch, and then sent the answer without checking if someone had answered
Probably you have to add "GROUP_" to the name of the group to set permissions.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.