use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class ContentDAO method addCategoryCode.
private void addCategoryCode(Category category, Set<String> codes) {
codes.add(category.getCode());
Category parentCategory = (Category) category.getParent();
if (null != parentCategory && !parentCategory.getCode().equals(parentCategory.getParentCode())) {
this.addCategoryCode(parentCategory, codes);
}
}
use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class ResourceAction method edit.
/**
* Executes the specific action to modify an existing resource.
*
* @return The result code.
*/
public String edit() {
try {
ResourceInterface resource = this.loadResource(this.getResourceId());
this.setResourceTypeCode(resource.getType());
this.setDescr(resource.getDescription());
List<Category> resCategories = resource.getCategories();
for (int i = 0; i < resCategories.size(); i++) {
Category resCat = resCategories.get(i);
this.getCategoryCodes().add(resCat.getCode());
}
this.setMainGroup(resource.getMainGroup());
this.setStrutsAction(ApsAdminSystemConstants.EDIT);
} catch (Throwable t) {
_logger.error("error in edit", t);
return FAILURE;
}
return SUCCESS;
}
use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class ContentCategoryAction method removeCategory.
/**
* Performs the action of removing a category from the content.
* @return The result code.
*/
public String removeCategory() {
this.updateContentOnSession();
try {
String categoryCode = this.getCategoryCode();
Category category = this.getCategoryManager().getCategory(categoryCode);
if (null != category) {
this.getContent().removeCategory(category);
}
} catch (Throwable t) {
_logger.error("error in removeCategory", t);
return FAILURE;
}
return SUCCESS;
}
use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class TestContentBulkCommand method testCategoryCommands.
public void testCategoryCommands() {
Collection<String> items = new ArrayList<String>();
Collection<Category> categories = new ArrayList<Category>();
UserDetails currentUser = null;
BaseContentPropertyBulkCommand<Category> categoryCommand = this.initCategoriesCommand(JoinCategoryBulkCommand.BEAN_NAME, items, categories, currentUser);
assertNotNull(categoryCommand);
categoryCommand = this.initCategoriesCommand(RemoveCategoryBulkCommand.BEAN_NAME, items, categories, currentUser);
assertNotNull(categoryCommand);
}
use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class EntityHandler method startCategory.
private void startCategory(Attributes attributes, String qName) throws SAXException {
if (this._categoryManager != null) {
String categoryCode = extractXmlAttribute(attributes, "id", qName, true);
Category category = this._categoryManager.getCategory(categoryCode);
if (null != category) {
this._currentEntity.addCategory(category);
}
}
}
Aggregations