Codota Logo
CmsRelationType
Code IndexAdd Codota to your IDE (free)

How to use
CmsRelationType
in
org.opencms.relations

Best Java code snippets using org.opencms.relations.CmsRelationType (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: org.opencms/opencms-solr

/**
 * Returns all relation types for relations defined in the content.<p>
 * 
 * @return a list of {@link CmsRelationType} objects
 */
public static List getAllDefinedInContent() {
  return filterDefinedInContent(getAll());
}
origin: org.opencms/opencms-solr

/**
 * Returns an extended filter with internal type restriction.<p>
 * 
 * @return an extended filter with internal type restriction
 */
public CmsRelationFilter filterInternal() {
  CmsRelationFilter filter = (CmsRelationFilter)this.clone();
  if (filter.m_types.isEmpty()) {
    filter.m_types.addAll(CmsRelationType.getAllInternal());
  } else {
    filter.m_types = new HashSet(CmsRelationType.filterInternal(filter.m_types));
  }
  return filter;
}
origin: org.opencms/opencms-solr

/**
 * Returns all relation types for relations that are not defined in the content.<p>
 * 
 * @return a list of {@link CmsRelationType} objects
 */
public static List getAllNotDefinedInContent() {
  return filterNotDefinedInContent(getAll());
}
origin: org.opencms/opencms-core

/**
 * Returns all weak relation types.<p>
 *
 * @return a list of {@link CmsRelationType} objects
 */
public static List<CmsRelationType> getAllWeak() {
  return filterWeak(getAll());
}
origin: org.opencms/opencms-solr

/**
 * Returns all strong relation types.<p>
 * 
 * @return a list of {@link CmsRelationType} objects
 */
public static List getAllStrong() {
  return filterStrong(getAll());
}
origin: org.opencms/opencms-core

/**
 * Returns a localized name for the given relation type.<p>
 *
 * @param locale the locale
 *
 * @return a localized name
 */
public String getLocalizedName(Locale locale) {
  return getLocalizedName(Messages.get().getBundle(locale));
}
origin: org.opencms/opencms-solr

/**
 * Adds a new relation to the given resource.<p>
 * 
 * @param dbc the database context
 * @param resource the resource to add the relation to
 * @param target the target of the relation
 * @param type the type of the relation
 * @param importCase if importing relations
 * 
 * @throws CmsException if something goes wrong
 */
public void addRelationToResource(
  CmsDbContext dbc,
  CmsResource resource,
  CmsResource target,
  CmsRelationType type,
  boolean importCase) throws CmsException {
  if (type.isDefinedInContent()) {
    throw new CmsIllegalArgumentException(Messages.get().container(
      Messages.ERR_ADD_RELATION_IN_CONTENT_3,
      dbc.removeSiteRoot(resource.getRootPath()),
      dbc.removeSiteRoot(target.getRootPath()),
      type.getLocalizedName(dbc.getRequestContext().getLocale())));
  }
  CmsRelation relation = new CmsRelation(resource, target, type);
  m_vfsDriver.createRelation(dbc, dbc.currentProject().getUuid(), relation);
  if (!importCase) {
    setDateLastModified(dbc, resource, System.currentTimeMillis());
  }
}
origin: org.opencms/opencms-solr

/**
 * Returns an extended filter with not defined in content type restriction.<p>
 * 
 * @return an extended filter with not defined in content type restriction
 */
public CmsRelationFilter filterNotDefinedInContent() {
  CmsRelationFilter filter = (CmsRelationFilter)this.clone();
  if (filter.m_types.isEmpty()) {
    filter.m_types.addAll(CmsRelationType.getAllNotDefinedInContent());
  } else {
    filter.m_types = new HashSet(CmsRelationType.filterNotDefinedInContent(filter.m_types));
  }
  return filter;
}
origin: org.opencms/opencms-solr

/**
 * Returns an extended filter with weak type restriction.<p>
 * 
 * @return an extended filter with weak type restriction
 */
public CmsRelationFilter filterWeak() {
  CmsRelationFilter filter = (CmsRelationFilter)this.clone();
  if (filter.m_types.isEmpty()) {
    filter.m_types.addAll(CmsRelationType.getAllWeak());
  } else {
    filter.m_types = new HashSet(CmsRelationType.filterWeak(filter.m_types));
  }
  return filter;
}
origin: org.opencms/opencms-core

/**
 * Returns an extended filter with user defined type restriction.<p>
 *
 * @return an extended filter with user defined type restriction
 */
public CmsRelationFilter filterUserDefined() {
  CmsRelationFilter filter = (CmsRelationFilter)clone();
  if (filter.m_types.isEmpty()) {
    filter.m_types.addAll(CmsRelationType.getAllUserDefined());
  } else {
    filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterUserDefined(filter.m_types));
  }
  return filter;
}
origin: org.opencms/opencms-core

/**
 * Returns an extended filter with defined in content type restriction.<p>
 *
 * @return an extended filter with defined in content type restriction
 */
public CmsRelationFilter filterDefinedInContent() {
  CmsRelationFilter filter = (CmsRelationFilter)clone();
  if (filter.m_types.isEmpty()) {
    filter.m_types.addAll(CmsRelationType.getAllDefinedInContent());
  } else {
    filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterDefinedInContent(filter.m_types));
  }
  return filter;
}
origin: org.opencms/opencms-core

/**
 * Returns an extended filter with strong type restriction.<p>
 *
 * @return an extended filter with strong type restriction
 */
public CmsRelationFilter filterStrong() {
  CmsRelationFilter filter = (CmsRelationFilter)clone();
  if (filter.m_types.isEmpty()) {
    filter.m_types.addAll(CmsRelationType.getAllStrong());
  } else {
    filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterStrong(filter.m_types));
  }
  return filter;
}
origin: org.opencms/opencms-core

/**
 * Gets a relation type by name.<p>
 *
 * @param typeName the relation type name
 *
 * @return the relation type with the matching name
 */
protected static CmsRelationType getRelationType(String typeName) {
  for (CmsRelationType relType : CmsRelationType.getAll()) {
    if (relType.getName().equalsIgnoreCase(typeName)) {
      return relType;
    }
  }
  return null;
}
origin: org.opencms/opencms-core

/**
 * Adds a new relation type from the XML configuration to the list of user defined relation types.<p>
 *
 * @param name the name of the relation type
 * @param type the type of the relation type, weak or strong
 *
 * @return the new created relation type instance
 *
 * @throws CmsConfigurationException in case the resource manager configuration is already initialized
 */
public CmsRelationType addRelationType(String name, String type) throws CmsConfigurationException {
  // check if new relation types can still be added
  if (m_frozen) {
    throw new CmsConfigurationException(Messages.get().container(Messages.ERR_NO_CONFIG_AFTER_STARTUP_0));
  }
  CmsRelationType relationType = new CmsRelationType(m_configuredRelationTypes.size(), name, type);
  m_configuredRelationTypes.add(relationType);
  return relationType;
}
origin: org.opencms/opencms-core

addTypeInternal(relationshipType);
for (CmsRelationType relType : CmsRelationType.getAll()) {
  createRelationshipType(relType);
origin: org.opencms/opencms-solr

/**
 * Returns a localized name for the given relation type.<p>
 * 
 * @param locale the locale
 * 
 * @return a localized name
 */
public String getLocalizedName(Locale locale) {
  return getLocalizedName(Messages.get().getBundle(locale));
}
origin: org.opencms/opencms-core

throws CmsException {
  if (type.isDefinedInContent()) {
    throw new CmsIllegalArgumentException(
      Messages.get().container(
        dbc.removeSiteRoot(resource.getRootPath()),
        dbc.removeSiteRoot(target.getRootPath()),
        type.getLocalizedName(dbc.getRequestContext().getLocale())));
origin: org.opencms/opencms-solr

/**
 * Returns all weak relation types.<p>
 * 
 * @return a list of {@link CmsRelationType} objects
 */
public static List getAllWeak() {
  return filterWeak(getAll());
}
origin: org.opencms/opencms-core

/**
 * Returns all strong relation types.<p>
 *
 * @return a list of {@link CmsRelationType} objects
 */
public static List<CmsRelationType> getAllStrong() {
  return filterStrong(getAll());
}
origin: org.opencms/opencms-core

/**
 * Returns an extended filter with not defined in content type restriction.<p>
 *
 * @return an extended filter with not defined in content type restriction
 */
public CmsRelationFilter filterNotDefinedInContent() {
  CmsRelationFilter filter = (CmsRelationFilter)clone();
  if (filter.m_types.isEmpty()) {
    filter.m_types.addAll(CmsRelationType.getAllNotDefinedInContent());
  } else {
    filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterNotDefinedInContent(filter.m_types));
  }
  return filter;
}
org.opencms.relationsCmsRelationType

Javadoc

Wrapper class for the different types of relations.

The possibles values are:

  • #HYPERLINK
  • #EMBEDDED_IMAGE
  • #EMBEDDED_OBJECT
  • #XML_STRONG
  • #XML_WEAK
  • #JSP_STRONG
  • #JSP_WEAK
  • #OU_RESOURCE
  • #CATEGORY

User defined relation types are also available.

Most used methods

  • getLocalizedName
    Returns a localized name for the given relation type.
  • <init>
    Private constructor for system relation types.
  • filterDefinedInContent
    Returns all relation types in the given list that define relations in the content.
  • filterInternal
    Returns all internal defined relation types in the given list.
  • filterNotDefinedInContent
    Returns all relation types in the given list that are not defined in the content.
  • filterStrong
    Returns all strong relation types in the given list.
  • filterUserDefined
    Returns all user defined relation types in the given list.
  • filterWeak
    Returns all weak relation types in the given list.
  • getAll
    Returns all relation types.
  • getAllDefinedInContent
    Returns all relation types for relations defined in the content.
  • getAllInternal
    Returns all internally defined relation types.
  • getAllNotDefinedInContent
    Returns all relation types for relations that are not defined in the content.
  • getAllInternal,
  • getAllNotDefinedInContent,
  • getAllStrong,
  • getAllUserDefined,
  • getAllWeak,
  • getId,
  • getName,
  • getNameForXml,
  • getType,
  • hashCode

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
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