Codota Logo
CmsCategoryService.repairRelations
Code IndexAdd Codota to your IDE (free)

How to use
repairRelations
method
in
org.opencms.relations.CmsCategoryService

Best Java code snippets using org.opencms.relations.CmsCategoryService.repairRelations (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.opencms/opencms-solr

/**
 * Repairs broken category relations.<p>
 * 
 * This could be caused by renaming/moving a category folder,
 * or changing the category repositories base folder name.<p>
 * 
 * Also repairs problems when creating/deleting conflicting
 * category folders across several repositories.<p>
 * 
 * The resource has to be previously locked.<p>
 * 
 * @param cms the cms context
 * @param resourceName the site relative path to the resource to repair
 * 
 * @throws CmsException if something goes wrong 
 */
public void repairRelations(CmsObject cms, String resourceName) throws CmsException {
  repairRelations(cms, cms.readResource(resourceName));
}
origin: org.opencms/opencms-core

/**
 * Repairs broken category relations.<p>
 *
 * This could be caused by renaming/moving a category folder,
 * or changing the category repositories base folder name.<p>
 *
 * Also repairs problems when creating/deleting conflicting
 * category folders across several repositories.<p>
 *
 * The resource has to be previously locked.<p>
 *
 * @param cms the cms context
 * @param resourceName the site relative path to the resource to repair
 *
 * @throws CmsException if something goes wrong
 */
public void repairRelations(CmsObject cms, String resourceName) throws CmsException {
  repairRelations(cms, cms.readResource(resourceName));
}
origin: org.opencms/opencms-core

/**
 * Repairs broken categories.<p>
 *
 * @param dbc the database context
 * @param projectId the project id
 * @param resource the resource to repair the categories for
 *
 * @throws CmsException if something goes wrong
 */
public void repairCategories(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsException {
  CmsObject cms = OpenCms.initCmsObject(new CmsObject(getSecurityManager(), dbc.getRequestContext()));
  cms.getRequestContext().setSiteRoot("");
  cms.getRequestContext().setCurrentProject(readProject(dbc, projectId));
  CmsCategoryService.getInstance().repairRelations(cms, resource);
}
origin: org.opencms/opencms-solr

/**
 * Repairs broken categories.<p>
 * 
 * @param dbc the database context
 * @param projectId the project id
 * @param resource the resource to repair the categories for
 * 
 * @throws CmsException if something goes wrong
 */
public void repairCategories(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsException {
  CmsObject cms = OpenCms.initCmsObject(new CmsObject(getSecurityManager(), dbc.getRequestContext()));
  cms.getRequestContext().setSiteRoot("");
  cms.getRequestContext().setCurrentProject(readProject(dbc, projectId));
  CmsCategoryService.getInstance().repairRelations(cms, resource);
}
origin: org.opencms/opencms-solr

/**
 * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
 */
@Override
public void executeListSingleActions() throws CmsRuntimeException {
  if (getParamListAction().equals(LIST_ACTION_REMOVE1) || getParamListAction().equals(LIST_ACTION_REMOVE2)) {
    try {
      // lock resource if autolock is enabled
      checkLock(getParamResource());
      CmsListItem listItem = getSelectedItem();
      String categoryPath = listItem.getId();
      getCategoryService().removeResourceFromCategory(getCms(), getParamResource(), categoryPath);
      getCategoryService().repairRelations(getCms(), getParamResource());
    } catch (CmsException e) {
      throw new CmsRuntimeException(e.getMessageContainer(), e);
    }
  } else {
    throwListUnsupportedActionException();
  }
  listSave();
}
origin: org.opencms/org.opencms.workplace

/**
 * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
 */
@Override
public void executeListSingleActions() throws CmsRuntimeException {
  if (getParamListAction().equals(LIST_ACTION_REMOVE1) || getParamListAction().equals(LIST_ACTION_REMOVE2)) {
    try {
      // lock resource if autolock is enabled
      checkLock(getParamResource());
      CmsListItem listItem = getSelectedItem();
      String categoryPath = listItem.getId();
      getCategoryService().removeResourceFromCategory(getCms(), getParamResource(), categoryPath);
      getCategoryService().repairRelations(getCms(), getParamResource());
    } catch (CmsException e) {
      throw new CmsRuntimeException(e.getMessageContainer(), e);
    }
  } else {
    throwListUnsupportedActionException();
  }
  listSave();
}
origin: org.opencms/org.opencms.workplace

/**
 * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
 */
@Override
public void executeListSingleActions() throws CmsRuntimeException {
  if (getParamListAction().equals(LIST_ACTION_ADD)) {
    try {
      // lock resource if autolock is enabled
      checkLock(getParamResource());
      CmsListItem listItem = getSelectedItem();
      getCategoryService().addResourceToCategory(getCms(), getParamResource(), listItem.getId());
      getCategoryService().repairRelations(getCms(), getParamResource());
    } catch (CmsException e) {
      throw new CmsRuntimeException(e.getMessageContainer(), e);
    }
  } else {
    throwListUnsupportedActionException();
  }
  listSave();
}
origin: org.opencms/opencms-solr

/**
 * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
 */
@Override
public void executeListSingleActions() throws CmsRuntimeException {
  if (getParamListAction().equals(LIST_ACTION_ADD)) {
    try {
      // lock resource if autolock is enabled
      checkLock(getParamResource());
      CmsListItem listItem = getSelectedItem();
      getCategoryService().addResourceToCategory(getCms(), getParamResource(), listItem.getId());
      getCategoryService().repairRelations(getCms(), getParamResource());
    } catch (CmsException e) {
      throw new CmsRuntimeException(e.getMessageContainer(), e);
    }
  } else {
    throwListUnsupportedActionException();
  }
  listSave();
}
org.opencms.relationsCmsCategoryServicerepairRelations

Javadoc

Repairs broken category relations.

This could be caused by renaming/moving a category folder, or changing the category repositories base folder name.

Also repairs problems when creating/deleting conflicting category folders across several repositories.

The resource has to be previously locked.

Popular methods of CmsCategoryService

  • addResourceToCategory
    Adds a resource identified by the given resource name to the given category. The resource has to be
  • getInstance
    Returns the singleton instance.
  • readCategories
    Returns all categories given some search parameters.
  • readCategory
    Reads all categories identified by the given category path for the given reference path.
  • readResourceCategories
    Reads the categories for a resource.
  • removeResourceFromCategory
    Removes a resource identified by the given resource name from the given category. The resource has t
  • <init>
  • clearCategoriesForResource
    Removes the given resource from all categories.
  • createCategory
    Creates a new category. Will use the same category repository as the parent if specified, or the clo
  • getCategory
    Creates a category from the given resource.
  • getCategoryRepositories
    Returns all category repositories for the given reference path.
  • getRepositoryBaseFolderName
    Returns the category repositories base folder name.
  • getCategoryRepositories,
  • getRepositoryBaseFolderName,
  • internalCategoryRootPath,
  • internalReadResourceCategories,
  • internalReadSubCategories,
  • readCategoryResources,
  • deleteCategory,
  • moveCategory,
  • readCategoriesForRepositories

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now