Package org.infoglue.cms.entities.content

Examples of org.infoglue.cms.entities.content.Content


    }
   
    QueryResults results = oql.execute(Database.READONLY);
    while (results.hasMore())
    {
      Content content = (Content)results.next();
      childrenVOList.add(content.getValueObject());
    }
   
    if(childrenVOList != null)
      CacheController.cacheObjectInAdvancedCache("childContentCache", key, childrenVOList, new String[]{CacheController.getPooledString(1, parentContentId)}, true);
View Full Code Here


       
        beginTransaction(db);

        try
        {
          Content content = getContentWithId(contentId, db);
        if(content != null)
        {
          Repository repository = content.getRepository();
          if(repository != null)
          {
             languages = LanguageController.getController().getLanguageVOList(repository.getId(), db);
           
             //If any of the validations or setMethods reported an error, we throw them up now before create.
View Full Code Here

        {
          ContentVO contentVO = new ContentVO();
          contentVO.setIsBranch(Boolean.TRUE);
          contentVO.setCreatorName(creator.getName());
          contentVO.setName(name);
          Content newContent = create(db, content.getId(), null, repositoryId, contentVO);
          if(newContent != null)
            content = newContent.getValueObject();
        }
      }
    }
    return content;
  }
View Full Code Here

  }
 

  public Content getContentWithPath(Integer repositoryId, String path, boolean forceFolders, InfoGluePrincipal creator, Database db) throws SystemException, Exception
  {
    Content content = getRootContent(repositoryId, db);
    final String paths[] = path.split("/");
    if(path.equals(""))
      return content;
   
    for(int i=0; i<paths.length; ++i)
    {
      final String name = paths[i];
      final Content childContent = getChildWithName(content.getId(), name, db);
      if(childContent != null)
        content = childContent;
      else if(childContent == null && !forceFolders)
        throw new SystemException("There exists no content with the path [" + path + "].");
      else
      {
          logger.info("   CREATE " + name);
        ContentVO contentVO = new ContentVO();
        contentVO.setIsBranch(Boolean.TRUE);
        contentVO.setCreatorName(creator.getName());
        contentVO.setName(name);
        Content newContent = create(db, content.getId(), null, repositoryId, contentVO);
        if(newContent != null)
          content = newContent;
      }
    }
    return content;
View Full Code Here

  /**
   *
   */
  private Content getChildWithName(Integer parentContentId, String name, Database db) throws Exception
  {
    Content content = null;
   
    OQLQuery oql = db.getOQLQuery("SELECT c FROM org.infoglue.cms.entities.content.impl.simple.ContentImpl c WHERE c.parentContent.contentId = $1 AND c.name = $2");
      oql.bind(parentContentId);
      oql.bind(name);
     
View Full Code Here

   * This method deletes a content and also erases all the children and all versions.
   */
     
  public void markForDeletion(ContentVO contentVO, Database db, boolean skipRelationCheck, boolean skipServiceBindings, boolean forceDelete, InfoGluePrincipal infogluePrincipal, Map<ContentVO, List<ReferenceBean>> contactPersons) throws ConstraintException, SystemException, Exception
  {
    Content content = null;
    try
    {
      content = getContentWithId(contentVO.getContentId(), db);
    }
    catch(SystemException e)
    {
      return;
    }
   
    boolean notifyResponsibleOnReferenceChange = CmsPropertyHandler.getNotifyResponsibleOnReferenceChange();
   
    Content parent = content.getParentContent();
    if(parent != null)
    {
      Iterator childContentIterator = parent.getChildren().iterator();
      while(childContentIterator.hasNext())
      {
        Content candidate = (Content)childContentIterator.next();
          if(candidate.getId().equals(contentVO.getContentId()))
          {
          markForDeletionRecursive(content, childContentIterator, db, skipRelationCheck, skipServiceBindings, forceDelete, infogluePrincipal, contactPersons, notifyResponsibleOnReferenceChange);
          }
      }
    }
View Full Code Here

       
        Collection children = content.getChildren();
    Iterator childrenIterator = children.iterator();
    while(childrenIterator.hasNext())
    {
      Content childContent = (Content)childrenIterator.next();
      markForDeletionRecursive(childContent, childrenIterator, db, skipRelationCheck, skipServiceBindings, forceDelete, infogluePrincipal, contactPersons, notifyResponsibleOnReferenceChange);        
       }
   
    boolean isDeletable = getIsDeletable(content, infogluePrincipal, db);
       if(forceDelete || isDeletable)
View Full Code Here

   * This method restored a content.
   */
     
    public void restoreContent(Integer contentId, InfoGluePrincipal infogluePrincipal, Database db) throws ConstraintException, SystemException
    {
    Content content = getContentWithId(contentId, db);
    content.setIsDeleted(false);
   
View Full Code Here

       
      beginTransaction(db);
   
        try
        {
      Content content = getContentWithId(contentId, db);
      content.setIsDeleted(false);
     
      while(content.getParentContent() != null && content.getParentContent().getIsDeleted())
      {
        content = content.getParentContent();
        content.setIsDeleted(false);
      }
       
        commitTransaction(db);
        }
        catch(Exception e)
View Full Code Here

        oql.bind(repositoryId);
     
      QueryResults results = oql.execute(Database.READONLY);
      while(results.hasMore())
            {
        Content content = (Content)results.next();
        Integer contentRepositoryId = content.getRepositoryId();
        Integer contentId = content.getContentId();

        if((AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Repository.Read", contentRepositoryId.toString()) && AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Repository.Write", contentRepositoryId.toString()))
          && (AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Content.Read", contentId.toString()) && AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Content.Write", contentId.toString())))
        {
          content.getValueObject().getExtraProperties().put("repositoryMarkedForDeletion", content.getRepository().getIsDeleted());
          contentVOListMarkedForDeletion.add(content.getValueObject());
        }
      }
           
      results.close();
      oql.close();
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.content.Content

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.