/** * @see org.opencms.widgets.I_CmsWidget#newInstance() */ public I_CmsWidget newInstance() { return new CmsCategoryWidget(getConfiguration()); }
String referencePath = cms.getSitePath(getResource(cms, param)); String startingCat = getStartingCategory(cms, referencePath); List cats = CmsCategoryService.getInstance().readCategories(cms, startingCat, true, referencePath); int baseLevel; result.append(buildSelectBox( param.getId(), i,
/** * @see org.opencms.widgets.A_CmsWidget#setEditorValue(org.opencms.file.CmsObject, java.util.Map, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public void setEditorValue( CmsObject cms, Map formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { super.setEditorValue(cms, formParameters, widgetDialog, param); String id = param.getStringValue(cms); if (CmsStringUtil.isEmptyOrWhitespaceOnly(id)) { return; } try { CmsCategory cat = CmsCategoryService.getInstance().getCategory(cms, cms.readResource(new CmsUUID(id))); if (cat.getPath().startsWith(getStartingCategory(cms, cms.getSitePath(getResource(cms, param))))) { param.setStringValue(cms, cat.getRootPath()); } else { param.setStringValue(cms, ""); } } catch (CmsException e) { // invalid value param.setStringValue(cms, ""); } }
String startingCategory = this.getStartingCategory(cms, cms.getSitePath(resource)); if (startingCategory.length() > 1) { result.append(CONFIGURATION_CATEGORY).append("=").append(startingCategory);
CmsResource resource = (CmsResource)listsib.get(i); Locale locale = getDefaultLocale(cms, cms.getSitePath(resource)); if (locale.equals(value.getLocale())) {
String refPath = getReferencePath(cms, value); CmsCategoryService.getInstance().readCategory(cms, catPath, refPath); if (((CmsCategoryWidget)widget).isOnlyLeafs()) { if (!CmsCategoryService.getInstance().readCategories(cms, catPath, false, refPath).isEmpty()) { errorHandler.addError(
String referencePath = null; try { referencePath = cms.getSitePath(getResource(cms, param)); } catch (Exception e) { String startingCat = getStartingCategory(cms, referencePath); List<CmsCategory> cats = CmsCategoryService.getInstance().readCategories( cms, buildSelectBox( param.getId(), i,
String referencePath = null; try { referencePath = cms.getSitePath(getResource(cms, param)); } catch (Exception e) { if (cat.getPath().startsWith(getStartingCategory(cms, referencePath))) { param.setStringValue(cms, cat.getRootPath()); } else {
String mainCategoryPath = ((CmsCategoryWidget)widget).getStartingCategory( getCmsObject(), getCmsObject().getSitePath(file));
CmsResource resource = listsib.get(i); Locale locale = getDefaultLocale(cms, cms.getSitePath(resource)); if (locale.equals(value.getLocale())) {
String refPath = getReferencePath(cms, value); CmsCategoryService.getInstance().readCategory(cms, catPath, refPath); if (((CmsCategoryWidget)widget).isOnlyLeafs()) { if (!CmsCategoryService.getInstance().readCategories(cms, catPath, false, refPath).isEmpty()) { errorHandler.addError(value, Messages.get().getBundle(value.getLocale()).key(
/** * @see org.opencms.widgets.I_CmsWidget#newInstance() */ public I_CmsWidget newInstance() { return new CmsCategoryWidget(getConfiguration()); }
String mainCategoryPath = ((CmsCategoryWidget)widget).getStartingCategory( cms, cms.getSitePath(file));