Package com.dotmarketing.portlets.contentlet.business

Examples of com.dotmarketing.portlets.contentlet.business.DotContentletStateException


        if (!perAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_EDIT, user, respectFrontendRoles)) {
            throw new DotSecurityException("User: " + (user != null ? user.getUserId() : "Unknown") + " cannot edit Contentlet");
        }
        List<Relationship> rels = RelationshipFactory.getAllRelationshipsByStructure(contentlet.getStructure());
        if (!rels.contains(related.getRelationship())) {
            throw new DotContentletStateException("Contentlet: " + (contentlet != null ? contentlet.getInode() : "Unknown") + " does not have passed in relationship");
        }
        List<Contentlet> cons = getRelatedContent(contentlet, related.getRelationship(), hasParent, user, respectFrontendRoles);
        cons = perAPI.filterCollection(cons, PermissionAPI.PERMISSION_READ, respectFrontendRoles, user);

        boolean contentSelected;
View Full Code Here


            throw new DotSecurityException("User: " + (user != null ? user.getUserId() : "Unknown")
                + " cannot edit Contentlet: " + (contentlet != null ? contentlet.getInode() : "Unknown"));
        }
        List<Relationship> rels = RelationshipFactory.getAllRelationshipsByStructure(contentlet.getStructure());
        if(!rels.contains(related.getRelationship())){
            throw new DotContentletStateException("Contentlet: " + (contentlet != null ? contentlet.getInode() : "Unknown")
                + " does not have passed in relationship");
        }

        boolean child = !related.isHasParent();
View Full Code Here

            }catch (DotContentletStateException e) {
                stateError = true;
            }
        }
        if(stateError){
            throw new DotContentletStateException("Unable to publish one or more contentlets because it is locked");
        }
    }
View Full Code Here

            if(dc.loadResults().size()>0){
              if(contentlet.getMap().get(Contentlet.DONT_VALIDATE_ME) != null){
                Logger.debug(this, "forcing checking with no version as the _dont_validate_me is set and inode exists");
                createNewVersion = false;
              }else{
                throw new DotContentletStateException("Contentlet must not exist already");
              }
            } else {
                saveWithExistingID=true;
                existingInode=contentlet.getInode();
                contentlet.setInode(null);

                Identifier ident=APILocator.getIdentifierAPI().find(contentlet.getIdentifier());
                if(ident==null || !UtilMethods.isSet(ident.getId())) {
                    existingIdentifier=contentlet.getIdentifier();
                    contentlet.setIdentifier(null);
                }
            }
        }
        if (!createNewVersion && contentlet != null && !InodeUtils.isSet(contentlet.getInode()))
            throw new DotContentletStateException("Contentlet must exist already");
        if (contentlet != null && contentlet.isArchived() && contentlet.getMap().get(Contentlet.DONT_VALIDATE_ME) == null)
            throw new DotContentletStateException("Unable to checkin an archived piece of content, please un-archive first");
        if (!perAPI.doesUserHavePermission(InodeUtils.isSet(contentlet.getIdentifier()) ? contentlet : contentlet.getStructure(),
                PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {
            List<Role> rolesPublish = perAPI.getRoles(contentlet.getStructure().getPermissionId(), PermissionAPI.PERMISSION_PUBLISH, "CMS Owner", 0, -1);
            List<Role> rolesWrite = perAPI.getRoles(contentlet.getStructure().getPermissionId(), PermissionAPI.PERMISSION_WRITE, "CMS Owner", 0, -1);
            Role cmsOwner = APILocator.getRoleAPI().loadCMSOwnerRole();
View Full Code Here

  }

  public void save(Link menuLink, User user, boolean respectFrontendRoles) throws DotDataException,
    DotSecurityException {
    if(!InodeUtils.isSet(menuLink.getIdentifier()))
      throw new DotContentletStateException("This method is meant to be called with already save links");
    Folder parentFolder = (Folder) APILocator.getFolderAPI().findParentFolder(menuLink, user, false);
    save(menuLink, parentFolder, user, respectFrontendRoles);
  }
View Full Code Here

              }finally{
                HibernateUtil.closeSession();
              }
            }
            if(stateError){
              throw new DotContentletStateException("Unable to unpublish one or more contentlets because it is locked");
            }
          }catch (DotSecurityException e) {
            hasNoPermissionOnAllContent = true;
          }
          if(hasNoPermissionOnAllContent)
View Full Code Here

              }finally{
                HibernateUtil.closeSession();
              }
            }
            if(stateError){
              throw new DotContentletStateException("Unable to publish one or more contentlets because it is locked");
            }
          }catch (DotSecurityException e) {
            hasNoPermissionOnAllContent = true;
          }
          if(hasNoPermissionOnAllContent)
View Full Code Here

              }finally{
                HibernateUtil.closeSession();
              }
            }
            if(stateError){
              throw new DotContentletStateException("Unable to archive one or more contentlets because it is locked");
            }
          }catch (DotSecurityException e) {
            hasNoPermissionOnAllContent = true;
          }
          if(hasNoPermissionOnAllContent)
            throw new DotSecurityException("Unable to archive some content due to lack of permissions");
          if(someContentIsLive)
              throw new DotContentletStateException("Unable to archive some content because they are live");
        }
View Full Code Here

              }finally{
                HibernateUtil.closeSession();
              }
            }
            if(stateError){
              throw new DotContentletStateException("Unable to unarchive one or more contentlets because it is locked");
            }
          }catch (DotSecurityException e) {
            hasNoPermissionOnAllContent = true;
          }
          if(hasNoPermissionOnAllContent)
View Full Code Here

          }
          if(securityError)
            throw new DotSecurityException("Unable to unlock some content due to lack of permissions");

          if(notLocked)
            throw new DotContentletStateException("Unable to unlock some content because they were not locked");

        }
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.contentlet.business.DotContentletStateException

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.