use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class TestGroupAction method checkGroup.
private void checkGroup(String groupName, String descr) {
Group group = this._groupManager.getGroup(groupName);
assertEquals(group.getName(), groupName);
assertEquals(group.getDescr(), descr);
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class TestGroupAction method testEdit.
public void testEdit() throws Throwable {
String groupName = "customers";
String result = this.executeEdit("admin", groupName);
assertEquals(Action.SUCCESS, result);
GroupAction groupAction = (GroupAction) this.getAction();
Group group = this._groupManager.getGroup(groupName);
assertEquals(ApsAdminSystemConstants.EDIT, groupAction.getStrutsAction());
assertEquals(group.getName(), groupAction.getName());
assertEquals(group.getDescr(), groupAction.getDescription());
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class TestExtendedResourceAction method testNewImageResource_2.
public void testNewImageResource_2() throws Throwable {
// Contenuto customers
this.executeEdit("ART102", "admin");
String contentOnSessionMarker = super.extractSessionMarker("ART102", ApsAdminSystemConstants.EDIT);
// iniziazione parametri sessione
HttpSession session = this.getRequest().getSession();
session.setAttribute(ResourceAttributeActionHelper.ATTRIBUTE_NAME_SESSION_PARAM, "Foto");
session.setAttribute(ResourceAttributeActionHelper.RESOURCE_TYPE_CODE_SESSION_PARAM, "Image");
session.setAttribute(ResourceAttributeActionHelper.RESOURCE_LANG_CODE_SESSION_PARAM, "it");
this.initContentAction("/do/jacms/Content/Resource", "new", contentOnSessionMarker);
// per replicare il chain in occasione dei chooseResource da edit Contenuto.
this.addParameter("resourceTypeCode", "Image");
String result = this.executeAction();
assertEquals(Action.SUCCESS, result);
ExtendedResourceAction action = (ExtendedResourceAction) this.getAction();
List<Group> allowedGroup = action.getAllowedGroups();
assertEquals(2, allowedGroup.size());
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class ActivityStreamAction method update.
public String update() {
List<Integer> actionRecordIds = new ArrayList<Integer>();
try {
Date timestamp = this.getTimestamp();
if (timestamp != null) {
timestamp.setTime(timestamp.getTime() + 100);
}
ActivityStreamSeachBean searchBean = new ActivityStreamSeachBean();
List<Group> userGroups = this.getAuthorizationManager().getUserGroups(this.getCurrentUser());
searchBean.setUserGroupCodes(groupsToStringCode(userGroups));
searchBean.setStartUpdate(timestamp);
searchBean.setEndUpdate(new Date());
actionRecordIds = this.getActionLogManager().getActionRecords(searchBean);
} catch (Throwable t) {
_logger.error("Error on loading updated activities", t);
}
this.setActionRecordIds(actionRecordIds);
return SUCCESS;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class AbstractContentAction method getGroups.
/**
* Restituisce la lista ordinata dei gruppi presenti nel sistema.
* @return La lista dei gruppi presenti nel sistema.
*/
public List<Group> getGroups() {
List<Group> groups = this.getGroupManager().getGroups();
BeanComparator c = new BeanComparator("description");
Collections.sort(groups, c);
return groups;
}
Aggregations