CmsCategoryWidget
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.opencms.widgets.CmsCategoryWidget (Showing top 13 results out of 315)

origin: org.opencms/opencms-core

/**
 * @see org.opencms.widgets.I_CmsWidget#newInstance()
 */
public I_CmsWidget newInstance() {
  return new CmsCategoryWidget(getConfiguration());
}
origin: org.opencms/opencms-solr

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,
origin: org.opencms/opencms-solr

/**
 * @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, "");
  }
}
origin: org.opencms/opencms-core

String startingCategory = this.getStartingCategory(cms, cms.getSitePath(resource));
if (startingCategory.length() > 1) {
  result.append(CONFIGURATION_CATEGORY).append("=").append(startingCategory);
origin: org.opencms/opencms-solr

CmsResource resource = (CmsResource)listsib.get(i);
Locale locale = getDefaultLocale(cms, cms.getSitePath(resource));
if (locale.equals(value.getLocale())) {
origin: org.opencms/opencms-core

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(
origin: org.opencms/opencms-core

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,
origin: org.opencms/opencms-core

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 {
origin: org.opencms/opencms-core

String mainCategoryPath = ((CmsCategoryWidget)widget).getStartingCategory(
  getCmsObject(),
  getCmsObject().getSitePath(file));
origin: org.opencms/opencms-core

CmsResource resource = listsib.get(i);
Locale locale = getDefaultLocale(cms, cms.getSitePath(resource));
if (locale.equals(value.getLocale())) {
origin: org.opencms/opencms-solr

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(
origin: org.opencms/opencms-solr

/**
 * @see org.opencms.widgets.I_CmsWidget#newInstance()
 */
public I_CmsWidget newInstance() {
  return new CmsCategoryWidget(getConfiguration());
}
origin: org.opencms/opencms-core

String mainCategoryPath = ((CmsCategoryWidget)widget).getStartingCategory(
  cms,
  cms.getSitePath(file));
org.opencms.widgetsCmsCategoryWidget

Javadoc

Provides a widget for a category based dependent select boxes.

Most used methods

  • <init>
    Creates a category widget with the specified options.
  • buildSelectBox
    Generates html code for the category selection.
  • getConfiguration
  • getDefaultLocale
    Returns the default locale in the content of the given resource.
  • getResource
    Returns the right resource, depending on the locale.
  • getStartingCategory
    Returns the starting category depending on the configuration options.
  • isOnlyLeafs
    Check if only leaf selection is allowed.

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Table (org.hibernate.mapping)
    A relational table

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)