Package com.dotmarketing.portlets.contentlet.business

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


      if(!InodeUtils.isSet(contentlet.getInode())){
        return new ArrayList<Contentlet>();
      }
      List<Contentlet> comments = null;
      if(contentlet.getStructure().getVelocityVarName().equals(commentsVelocityStructureName)){
        comments = conAPI.search("+Comments-Comments-parent:" + contentlet.getIdentifier() + " +live:true +languageid:" + contentlet.getLanguageId() + " +deleted:false", 0, -1, "Comments.datePublished " + (descendingOrder ? "desc":"asc"), APILocator.getUserAPI().getSystemUser(), true);
      }else{
        comments = conAPI.search("+" + getRelationshipName(contentlet) + ":" + contentlet.getIdentifier() + " +live:true +languageid:" + contentlet.getLanguageId() + " +deleted:false", 0, -1, "Comments.datePublished " + (descendingOrder ? "desc":"asc"), APILocator.getUserAPI().getSystemUser(), true);
      }
//      int count = 0;
//      StringBuilder bob = new StringBuilder();
View Full Code Here


      }
      List<Contentlet> comments = null;
      if(contentlet.getStructure().getVelocityVarName().equals(commentsVelocityStructureName)){
        comments = conAPI.search("+Comments-Comments-parent:" + contentlet.getIdentifier() + " +live:true +languageid:" + contentlet.getLanguageId() + " +deleted:false", 0, -1, "Comments.datePublished " + (descendingOrder ? "desc":"asc"), APILocator.getUserAPI().getSystemUser(), true);
      }else{
        comments = conAPI.search("+" + getRelationshipName(contentlet) + ":" + contentlet.getIdentifier() + " +live:true +languageid:" + contentlet.getLanguageId() + " +deleted:false", 0, -1, "Comments.datePublished " + (descendingOrder ? "desc":"asc"), APILocator.getUserAPI().getSystemUser(), true);
      }
//      int count = 0;
//      StringBuilder bob = new StringBuilder();
//      for (Contentlet c : comments) {
//        bob.append("Comments-Comments-child:" + c.getIdentifier() + " ");
View Full Code Here

    List<Contentlet> hits = new ArrayList <Contentlet>();
    String query = "+type:content +deleted:false +(+languageId:1* +identifier:" + identifier + "* +live:true)";
    try {
      ContentletAPI conAPI = APILocator.getContentletAPI();

        hits = conAPI.search(query,  -1, 0, null, APILocator.getUserAPI().getSystemUser(), false);

      if (0 < hits.size()) {
        Contentlet cont = hits.get(0);
        String structInode = (String) cont.getMap().get("stInode");
        List<Field> fields = FieldsCache.getFieldsByStructureInode(structInode);
View Full Code Here

    String query = "+type:content +deleted:false +(+languageId:1* +identifier:'" + identifier + "'* +live:true)";
    try {

      ContentletAPI conAPI = APILocator.getContentletAPI();

      hits = conAPI.search(query,  -1, 0, null, APILocator.getUserAPI().getSystemUser(), false);

      if (0 < hits.size()) {
        Contentlet cont  = hits.get(0);
        String structInode = (String) cont.getMap().get("stInode");

View Full Code Here

                    q = "+type:content +(" + rel.getRelationTypeValue() + "-parent:" + con.getIdentifier() + " " +
                        rel.getRelationTypeValue() + "-child:" + con.getIdentifier() + ") ";
                else
                    q = "+type:content +" + rel.getRelationTypeValue() + ":" + con.getIdentifier();

                oldDocs  = conAPI.search(q, -1, 0, null, APILocator.getUserAPI().getSystemUser(), false);

                List<String> oldRelatedIds = new ArrayList<String>();
                if(oldDocs.size() > 0) {
                    for(Contentlet oldDoc : oldDocs) {
                        oldRelatedIds.add(oldDoc.getIdentifier());
View Full Code Here

     
      List<Contentlet> contentlets = new ArrayList<Contentlet>();
      try
      {
        User user = APILocator.getUserAPI().getSystemUser();
        contentlets = contentletApi.search(luceneQuery,0,0,"",user,false);
      }
      catch(Exception ex)
      {
        Logger.info(PermalinkServlet.class,ex.getMessage());
      }
View Full Code Here

      String query = "+type:content +deleted:false +live:true "+languageId+" +structureName:" + st.getVelocityVarName();
      List<Contentlet> hits = new ArrayList <Contentlet>();
      ContentletAPI conAPI = APILocator.getContentletAPI();

      try {
        hits = conAPI.search(query,  -1, 0, null, userAPI.getSystemUser(), false);
      } catch (DotDataException e) {
        Logger.debug(DotCMSMacroWebAPI.class,"Error retriving data");
      } catch (DotSecurityException e) {
        Logger.debug(DotCMSMacroWebAPI.class,"Error retriving data, user does not have permissions");
      } catch (Exception e) {
View Full Code Here

          String query = "+structureInode:" + struct + " +" + field
              + ":\"" + title
              + "\" +languageId:1* +deleted:false +live:true";
          List<com.dotmarketing.portlets.contentlet.model.Contentlet> cons = null;
          try {
            cons = capi.search(query, 1, 0, "text1", user, true);
          } catch (DotDataException e) {
            Logger.debug(this, "DotDataException: "  + e.getMessage(), e);
          } catch (DotSecurityException e) {
            Logger.debug(this, "DotSecurityException: "  + e.getMessage(), e);
          } catch (Exception e) {
View Full Code Here

     
      ContentletAPI conAPI = APILocator.getContentletAPI();
      StringBuffer lqBuffy = new StringBuffer();
      lqBuffy.append("+structureInode:" + slideShowSt.getInode() + " +type:content +live:true +deleted:false +" + slideShowTitleF.getFieldContentlet().trim() + ":\"" + title.toLowerCase() + "\"");
      User user = (User)request.getSession().getAttribute(WebKeys.CMS_USER);
      List<Contentlet> results = conAPI.search(lqBuffy.toString(), 0, -1, "inode",user , true);
     
//      List<Contentlet> results = ContentletFactory.getContentletByCondition("live = " + DbConnectionFactory.getDBTrue() +
//          " and deleted = " + DbConnectionFactory.getDBFalse() + " and " +
//          slideShowTitleF.getFieldContentlet() + " = '" + UtilMethods.sqlify(title) + "'");
 
View Full Code Here

            //We are just making time in order to let it apply the index
            contentletAPI.isInodeIndexed( testContentlet.getInode(), true );

            //Verify if it was added to the index
            String query = "+structureName:" + testStructure.getVelocityVarName() + " +deleted:false +live:true";
            List<Contentlet> result = contentletAPI.search( query, 0, -1, "modDate desc", user, true );

            //Validations
            assertNotNull( result );
            assertTrue( !result.isEmpty() );
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.