Package com.dotmarketing.portlets.structure.model

Examples of com.dotmarketing.portlets.structure.model.ContentletRelationships$ContentletRelationshipRecords


        return getAllRelationships(find(contentletInode, user, respectFrontendRoles));
    }

    public ContentletRelationships getAllRelationships(Contentlet contentlet)throws DotDataException {

        ContentletRelationships cRelationships = new ContentletRelationships(contentlet);
        Structure structure = contentlet.getStructure();
        List<ContentletRelationshipRecords> matches = cRelationships.getRelationshipsRecords();
        List<Relationship> relationships = RelationshipFactory.getAllRelationshipsByStructure(structure);

        for (Relationship relationship : relationships) {

            ContentletRelationshipRecords records = null;
View Full Code Here


    }

    public void relateContent(Contentlet contentlet, Relationship rel, List<Contentlet> records, User user, boolean respectFrontendRoles)throws DotDataException, DotSecurityException, DotContentletStateException {
        Structure st = StructureCache.getStructureByInode(contentlet.getStructureInode());
        boolean hasParent = RelationshipFactory.isParentOfTheRelationship(rel, st);
        ContentletRelationshipRecords related = new ContentletRelationships(contentlet).new ContentletRelationshipRecords(rel, hasParent);
        related.setRecords(records);
        relateContent(contentlet, related, user, respectFrontendRoles);
    }
View Full Code Here

        return checkin(contentlet, contentRelationships, cats, permissions, user, respectFrontendRoles);
    }

    public Contentlet checkin(Contentlet contentlet, Map<Relationship, List<Contentlet>> contentRelationships, List<Category> cats ,List<Permission> permissions, User user,boolean respectFrontendRoles) throws DotDataException,DotSecurityException, DotContentletStateException, DotContentletValidationException {
        Structure st = StructureCache.getStructureByInode(contentlet.getStructureInode());
        ContentletRelationships relationshipsData = new ContentletRelationships(contentlet);
        List<ContentletRelationshipRecords> relationshipsRecords = new ArrayList<ContentletRelationshipRecords> ();
        relationshipsData.setRelationshipsRecords(relationshipsRecords);
        for(Entry<Relationship, List<Contentlet>> relEntry : contentRelationships.entrySet()) {
            Relationship relationship = (Relationship) relEntry.getKey();
            boolean hasParent = RelationshipFactory.isParentOfTheRelationship(relationship, st);
            ContentletRelationshipRecords records = relationshipsData.new ContentletRelationshipRecords(relationship, hasParent);
            records.setRecords(relEntry.getValue());
View Full Code Here

        return checkin(contentlet, contentRelationships, cats, permissions, user, respectFrontendRoles, true);
    }

    public Contentlet checkinWithoutVersioning(Contentlet contentlet, Map<Relationship, List<Contentlet>> contentRelationships, List<Category> cats ,List<Permission> permissions, User user,boolean respectFrontendRoles) throws DotDataException,DotSecurityException, DotContentletStateException, DotContentletValidationException {
        Structure st = StructureCache.getStructureByInode(contentlet.getStructureInode());
        ContentletRelationships relationshipsData = new ContentletRelationships(contentlet);
        List<ContentletRelationshipRecords> relationshipsRecords = new ArrayList<ContentletRelationshipRecords> ();
        relationshipsData.setRelationshipsRecords(relationshipsRecords);
        for(Entry<Relationship, List<Contentlet>> relEntry : contentRelationships.entrySet()) {
            Relationship relationship = (Relationship) relEntry.getKey();
            boolean hasParent = RelationshipFactory.isParentOfTheRelationship(relationship, st);
            ContentletRelationshipRecords records = relationshipsData.new ContentletRelationshipRecords(relationship, hasParent);
            records.setRecords(relEntry.getValue());
View Full Code Here


        //Handle Relationships

        if(contentRelationships == null){
            contentRelationships = new ContentletRelationships(toContentlet);
        }
        List<Relationship> rels = RelationshipFactory.getAllRelationshipsByStructure(fromContentlet.getStructure());
        for (Relationship r : rels) {
            if(RelationshipFactory.isSameStructureRelationship(r, fromContentlet.getStructure())) {
                ContentletRelationshipRecords selectedRecords = null;
View Full Code Here

        }
    }

    public void validateContentlet(Contentlet contentlet,Map<Relationship, List<Contentlet>> contentRelationships,List<Category> cats)throws DotContentletValidationException {
        Structure st = StructureCache.getStructureByInode(contentlet.getStructureInode());
        ContentletRelationships relationshipsData = new ContentletRelationships(contentlet);
        List<ContentletRelationshipRecords> relationshipsRecords = new ArrayList<ContentletRelationshipRecords> ();
        relationshipsData.setRelationshipsRecords(relationshipsRecords);
        for(Entry<Relationship, List<Contentlet>> relEntry : contentRelationships.entrySet()) {
            Relationship relationship = (Relationship) relEntry.getKey();
            boolean hasParent = RelationshipFactory.isParentOfTheRelationship(relationship, st);
            ContentletRelationshipRecords records = relationshipsData.new ContentletRelationshipRecords(relationship, hasParent);
            records.setRecords(relEntry.getValue());
View Full Code Here

              destinationHostId = folder.getHostId();
            } else{
              destinationHostId = contentlet.getHost();
            }
            if(contentletToCopy.getHost().equals(destinationHostId)){
              ContentletRelationships cr = getAllRelationships(contentlet);
              List<ContentletRelationshipRecords> rr = cr.getRelationshipsRecords();
              for (ContentletRelationshipRecords crr : rr) {
                  rels.put(crr.getRelationship(), crr.getRecords());
              }
            }
View Full Code Here

      if(!preResult){
        Logger.error(this, "The following prehook failed " + pre.getClass().getName());
        throw new DotRuntimeException("The following prehook failed " + pre.getClass().getName());
      }
    }
    ContentletRelationships c = conAPI.getAllRelationships(contentletInode, user, respectFrontendRoles);
    for(ContentletAPIPostHook post : postHooks){
      post.getAllRelationships(contentletInode, user, respectFrontendRoles,c);
    }
    return c;
  }
View Full Code Here

      if(!preResult){
        Logger.error(this, "The following prehook failed " + pre.getClass().getName());
        throw new DotRuntimeException("The following prehook failed " + pre.getClass().getName());
      }
    }
    ContentletRelationships c = conAPI.getAllRelationships(contentlet);
    for(ContentletAPIPostHook post : postHooks){
      post.getAllRelationships(contentlet,c);
    }
    return c;
  }
View Full Code Here

  }

  private void _loadContentletRelationshipsInRequest(ActionRequest request, Contentlet contentlet, Structure structure,User user) throws DotDataException {
    ContentletAPI contentletService = APILocator.getContentletAPI();
    contentlet.setStructureInode(structure.getInode());
    ContentletRelationships cRelationships = contentletService.getAllRelationships(contentlet);

    //DOTCMS-6097, if we don't have the related piece of content in the language the user is looking at, we show the flag of the language user is on but in gray.
    List<ContentletRelationships.ContentletRelationshipRecords> relationshipRecords = cRelationships.getRelationshipsRecords();
    for(ContentletRelationshipRecords contentletRelationshipRecords: relationshipRecords){
      List<Contentlet> contentletsList = contentletRelationshipRecords.getRecords();
      List<Contentlet> newContentletsList = new ArrayList<Contentlet>();
      for(Contentlet con: contentletsList){
        if(contentlet.getLanguageId() == con.getLanguageId()){
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.structure.model.ContentletRelationships$ContentletRelationshipRecords

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.