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

How to use
isDefinedInContent
method
in
org.opencms.relations.CmsRelationType

Best Java code snippets using org.opencms.relations.CmsRelationType.isDefinedInContent (Showing top 12 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-core

/**
 * Returns all relation types in the given list that are not defined in the content.<p>
 *
 * @param relationTypes the collection of relation types to filter
 *
 * @return a list of {@link CmsRelationType} objects
 */
public static List<CmsRelationType> filterNotDefinedInContent(Collection<CmsRelationType> relationTypes) {
  List<CmsRelationType> result = new ArrayList<CmsRelationType>(relationTypes);
  Iterator<CmsRelationType> it = result.iterator();
  while (it.hasNext()) {
    CmsRelationType type = it.next();
    if (type.isDefinedInContent()) {
      it.remove();
    }
  }
  return result;
}
origin: org.opencms/opencms-core

/**
 * Returns all relation types in the given list that define relations in the content.<p>
 *
 * @param relationTypes the collection of relation types to filter
 *
 * @return a list of {@link CmsRelationType} objects
 */
public static List<CmsRelationType> filterDefinedInContent(Collection<CmsRelationType> relationTypes) {
  List<CmsRelationType> result = new ArrayList<CmsRelationType>(relationTypes);
  Iterator<CmsRelationType> it = result.iterator();
  while (it.hasNext()) {
    CmsRelationType type = it.next();
    if (!type.isDefinedInContent()) {
      it.remove();
    }
  }
  return result;
}
origin: org.opencms/opencms-core

/**
 * Checks if this filter includes relations defined in the content.<p>
 *
 * @return <code>true</code> if this filter includes relations defined in the content
 */
public boolean includesDefinedInContent() {
  if ((m_types == null) || m_types.isEmpty()) {
    return true;
  }
  Iterator<CmsRelationType> itTypes = m_types.iterator();
  while (itTypes.hasNext()) {
    CmsRelationType type = itTypes.next();
    if (type.isDefinedInContent()) {
      return true;
    }
  }
  return false;
}
origin: org.opencms/opencms-solr

/**
 * Checks if this filter includes relations defined in the content.<p> 
 * 
 * @return <code>true</code> if this filter includes relations defined in the content
 */
public boolean includesDefinedInContent() {
  if ((m_types == null) || m_types.isEmpty()) {
    return true;
  }
  Iterator itTypes = m_types.iterator();
  while (itTypes.hasNext()) {
    CmsRelationType type = (CmsRelationType)itTypes.next();
    if (type.isDefinedInContent()) {
      return true;
    }
  }
  return false;
}
origin: org.opencms/opencms-solr

/**
 * Returns all relation types in the given list that define relations in the content.<p>
 * 
 * @param relationTypes the collection of relation types to filter
 * 
 * @return a list of {@link CmsRelationType} objects
 */
public static List filterDefinedInContent(Collection relationTypes) {
  List list = new ArrayList(relationTypes);
  Iterator it = list.iterator();
  while (it.hasNext()) {
    CmsRelationType type = (CmsRelationType)it.next();
    if (!type.isDefinedInContent()) {
      it.remove();
    }
  }
  return list;
}
origin: org.opencms/opencms-solr

/**
 * Returns all relation types in the given list that are not defined in the content.<p>
 * 
 * @param relationTypes the collection of relation types to filter
 * 
 * @return a list of {@link CmsRelationType} objects
 */
public static List filterNotDefinedInContent(Collection relationTypes) {
  List list = new ArrayList(relationTypes);
  Iterator it = list.iterator();
  while (it.hasNext()) {
    CmsRelationType type = (CmsRelationType)it.next();
    if (type.isDefinedInContent()) {
      it.remove();
    }
  }
  return list;
}
origin: org.opencms/opencms-core

if (relation.getType().isDefinedInContent()) {
  hasContentLinks = true;
} else {
origin: org.opencms/opencms-core

  /**
   * Rewrites relations which are not derived from links in the content itself.<p>
   *
   * @param res the resource for which to rewrite the relations
   * @param relations the original relations
   *
   * @throws CmsException if something goes wrong
   */
  protected void rewriteOtherRelations(CmsResource res, Collection<CmsRelation> relations) throws CmsException {

    LOG.info("Rewriting non-content links for " + res.getRootPath());
    for (CmsRelation rel : relations) {
      CmsUUID targetId = rel.getTargetId();
      CmsResource newTargetResource = m_translationsById.get(targetId);
      CmsRelationType relType = rel.getType();
      if (!relType.isDefinedInContent()) {
        if (newTargetResource != null) {
          m_cms.deleteRelationsFromResource(
            rel.getSourcePath(),
            CmsRelationFilter.TARGETS.filterStructureId(rel.getTargetId()).filterType(relType));
          m_cms.addRelationToResource(
            rel.getSourcePath(),
            newTargetResource.getRootPath(),
            relType.getName());
        }
      }
    }
  }
}
origin: org.opencms/opencms-core

/**
 * Creates a CMIS relationship subtype for a given OpenCms relation type.<p>
 *
 * @param relType the OpenCms relation type
 */
private void createRelationshipType(CmsRelationType relType) {
  // relationship types
  RelationshipTypeDefinitionImpl relationshipType = new RelationshipTypeDefinitionImpl();
  relationshipType.setBaseTypeId(BaseTypeId.CMIS_RELATIONSHIP);
  relationshipType.setParentTypeId(RELATIONSHIP_TYPE_ID);
  relationshipType.setIsControllableAcl(Boolean.FALSE);
  relationshipType.setIsControllablePolicy(Boolean.FALSE);
  relationshipType.setIsCreatable(Boolean.valueOf(!relType.isDefinedInContent()));
  relationshipType.setDescription(relType.getName());
  relationshipType.setDisplayName(relType.getName());
  relationshipType.setIsFileable(Boolean.FALSE);
  relationshipType.setIsIncludedInSupertypeQuery(Boolean.TRUE);
  relationshipType.setLocalName(relType.getName());
  relationshipType.setLocalNamespace(NAMESPACE);
  relationshipType.setIsQueryable(Boolean.FALSE);
  String id = "opencms:" + relType.getName().toUpperCase();
  relationshipType.setQueryName(id);
  relationshipType.setId(id);
  List<String> typeList = new ArrayList<String>();
  typeList.add("cmis:document");
  typeList.add("cmis:folder");
  relationshipType.setAllowedSourceTypes(typeList);
  relationshipType.setAllowedTargetTypes(typeList);
  addType(relationshipType);
}
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-core

/**
 * Collects the allowable actions for a relation.<p>
 *
 * @param cms the current CMS context
 * @param file the source of the relation
 * @param relation the relation object
 *
 * @return the allowable actions for the given resource
 */
protected AllowableActions collectAllowableActions(CmsObject cms, CmsResource file, CmsRelation relation) {
  try {
    Set<Action> aas = new LinkedHashSet<Action>();
    AllowableActionsImpl result = new AllowableActionsImpl();
    CmsLock lock = cms.getLock(file);
    CmsUser user = cms.getRequestContext().getCurrentUser();
    boolean canWrite = !cms.getRequestContext().getCurrentProject().isOnlineProject()
      && (lock.isOwnedBy(user) || lock.isLockableBy(user))
      && cms.hasPermissions(file, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.DEFAULT);
    addAction(aas, Action.CAN_GET_PROPERTIES, true);
    addAction(aas, Action.CAN_DELETE_OBJECT, canWrite && !relation.getType().isDefinedInContent());
    result.setAllowableActions(aas);
    return result;
  } catch (CmsException e) {
    handleCmsException(e);
    return null;
  }
}
origin: org.opencms/opencms-core

throws CmsException {
  if (type.isDefinedInContent()) {
    throw new CmsIllegalArgumentException(
      Messages.get().container(
org.opencms.relationsCmsRelationTypeisDefinedInContent

Javadoc

Checks if this relation type is defined in the content of a resource or not.

Popular methods of CmsRelationType

  • 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

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • notifyDataSetChanged (ArrayAdapter)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JFileChooser (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
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