use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class ContentAction method joinGroup.
/**
* Esegue l'azione di associazione di un gruppo al contenuto in fase di
* redazione.
*
* @return Il codice del risultato dell'azione.
*/
public String joinGroup() {
this.updateContentOnSession();
try {
String extraGroupName = this.getExtraGroupName();
Group group = this.getGroupManager().getGroup(extraGroupName);
if (null != group) {
this.getContent().addGroup(extraGroupName);
}
} catch (Throwable t) {
_logger.error("error in joinGroup", t);
return FAILURE;
}
return SUCCESS;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class PageAction method getGroups.
/**
* Return the list of system groups.
*
* @return The list of system groups.
*/
public List<Group> getGroups() {
List<Group> groups = this.getGroupManager().getGroups();
BeanComparator c = new BeanComparator("description");
Collections.sort(groups, c);
return groups;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class BaseAction method getActualAllowedGroups.
protected List<Group> getActualAllowedGroups() {
if (null != this._actualAllowedGroups) {
return _actualAllowedGroups;
}
this._actualAllowedGroups = new ArrayList<Group>();
UserDetails currentUser = this.getCurrentUser();
if (null == currentUser || null == this.getRequiredPermissions()) {
return this._actualAllowedGroups;
}
Iterator<String> iter = this.getRequiredPermissions().iterator();
while (iter.hasNext()) {
String permissionName = iter.next();
List<Group> groupsByPermission = this.getAuthorizationManager().getGroupsByPermission(currentUser, permissionName);
if (null != groupsByPermission) {
for (int i = 0; i < groupsByPermission.size(); i++) {
Group group = groupsByPermission.get(i);
if (null != group && !this._actualAllowedGroups.contains(group)) {
this._actualAllowedGroups.add(group);
}
}
}
}
Collections.sort(this._actualAllowedGroups, new BeanComparator("description"));
return this._actualAllowedGroups;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class GroupAction method extractGroupFormValues.
protected String extractGroupFormValues() {
try {
if (!this.existsGroup()) {
this.addActionError(this.getText("error.group.notExist"));
return "groupList";
}
Group group = this.getGroupManager().getGroup(this.getName());
this.setName(group.getName());
this.setDescription(group.getDescr());
} catch (Throwable t) {
_logger.error("error in extractGroupFormValues", t);
return FAILURE;
}
return SUCCESS;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class GroupAction method save.
public String save() {
try {
Group group = new Group();
group.setName(this.getName());
group.setDescr(this.getDescription());
if (this.getStrutsAction() == ApsAdminSystemConstants.ADD) {
this.getGroupManager().addGroup(group);
} else if (this.getStrutsAction() == ApsAdminSystemConstants.EDIT) {
this.getGroupManager().updateGroup(group);
}
} catch (Throwable t) {
_logger.error("error in save", t);
return FAILURE;
}
return SUCCESS;
}
Aggregations