Package com.dotmarketing.portlets.contentlet.business

Examples of com.dotmarketing.portlets.contentlet.business.ContentletAPI.find()


  public List<Contentlet> getComments(String inode, boolean descendingOrder){
    try{
      ContentletAPI conAPI = APILocator.getContentletAPI();
      Contentlet contentlet = new Contentlet();
      try{
        contentlet = conAPI.find(inode, APILocator.getUserAPI().getSystemUser(), true);
      }catch(DotDataException e){
        Logger.debug(this, "Unable to look up contentlet with inode " + inode, e);
      }
      validateComments(contentlet);
      if(!InodeUtils.isSet(contentlet.getInode())){
View Full Code Here


  public void validateComments(String contentletInode) throws DotSecurityException, DotHibernateException {
    // Load the contentlet
    ContentletAPI conAPI = APILocator.getContentletAPI();
    Contentlet contentlet = new Contentlet();
    try{
      contentlet = conAPI.find(contentletInode, APILocator.getUserAPI().getSystemUser(), true);
    }catch(DotDataException e){
      Logger.debug(this, "validateComments for no inode : " + contentletInode);
    }
    validateComments(contentlet);
  }
View Full Code Here

  public int getCommentsCount(String inode) {
    int commentNumber = 0;
    try{
        ContentletAPI conAPI = APILocator.getContentletAPI();
        Contentlet contentlet = new Contentlet();
      contentlet = conAPI.find(inode, APILocator.getUserAPI().getSystemUser(), respectFrontendRoles);

      Structure contentletStructure = StructureCache.getStructureByInode(contentlet.getStructureInode());

        Field field =  contentletStructure.getField("CommentsCount");
        if (!InodeUtils.isSet(field.getInode())){
View Full Code Here

  public List<Contentlet> pullRelatedContent (String relationshipName, String contentletInode, int limit, String orderBy) {
    ContentletAPI conAPI = APILocator.getContentletAPI();

    Contentlet contentlet = null;
    try {
      contentlet = conAPI.find(contentletInode, APILocator.getUserAPI().getSystemUser(), true);
    } catch (DotSecurityException e) {
      Logger.info(this, "Unable to look up content because of a problem getting the system user");
    } catch (DotDataException de) {
      Logger.info(this, "Unable to retrieve content with inode = " + contentletInode);
    }
View Full Code Here

    for(HashMap content: contents) {
      String inode = (String) content.get("inode");

      Contentlet contentlet = new Contentlet();
      try{
        contentlet = conAPI.find(inode, user, true);
      }catch (DotDataException ex){
        Logger.error(this, "Unable to find contentlet with inode " + inode);
      }

      List<Category> categoryContentlet = categoryAPI.getChildren(contentlet, user, true);
View Full Code Here

      if (isContent){
        Contentlet content = null;
        if(byInode) {
          if(isTempBinaryImage)
            content = contentAPI.find(assetInode, APILocator.getUserAPI().getSystemUser(), respectFrontendRoles);
          else
            content = contentAPI.find(assetInode, user, respectFrontendRoles);
          assetIdentifier = content.getIdentifier();
        } else {
            boolean live=userWebAPI.isLoggedToFrontend(req);
View Full Code Here

        Contentlet content = null;
        if(byInode) {
          if(isTempBinaryImage)
            content = contentAPI.find(assetInode, APILocator.getUserAPI().getSystemUser(), respectFrontendRoles);
          else
            content = contentAPI.find(assetInode, user, respectFrontendRoles);
          assetIdentifier = content.getIdentifier();
        } else {
            boolean live=userWebAPI.isLoggedToFrontend(req);
            if (req.getSession(false) != null && req.getSession().getAttribute("tm_date")!=null) {
                live=true;
View Full Code Here

      Logger.warn(FieldServices.class,"Field not found.  Unable to load velocity code");
      return new ByteArrayInputStream("".toString().getBytes());
    }
    ContentletAPI conAPI = APILocator.getContentletAPI();
    FieldAPI fAPI = APILocator.getFieldAPI();
    Contentlet content = conAPI.find(contentInode, APILocator.getUserAPI().getSystemUser(), true);
    if(!UtilMethods.isSet(content)){
      Logger.warn(FieldServices.class,"Content not found.  Unable to load velocity code");
      return new ByteArrayInputStream("".toString().getBytes());
    }
    Object contFieldValueObject = conAPI.getFieldValue(content, field);
View Full Code Here

        Inode inode = InodeFactory.find(inodeOrIdentifier);
        p = inode;
        asset.setType(((Permissionable) inode).getClass().getName());
      } else {
        ContentletAPI contAPI = APILocator.getContentletAPI();
        Contentlet content = contAPI.find(inodeOrIdentifier, user, false);

        if (UtilMethods.isSet(content) && content.getStructureInode().equals(hostStrucuture.getInode())) {
          p = content;
          asset.setType(Host.class.getName());
        }
View Full Code Here

        records = new ArrayList<Contentlet>();

        for (int i = 1; i < inodes.length; i++) {
          try {
            inode = inodes[i];
            contentlet = contentletAPI.find(inode, user, false);
            if ((contentlet != null) && (InodeUtils.isSet(contentlet.getInode())))
              records.add(contentlet);
          } catch (Exception e) {
            Logger.warn(this, e.toString());
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.