Package com.dotmarketing.portlets.contentlet.business

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


            //We are just making time in order to let it apply the index
            wasContentRemoved( query );

            //Verify if it was removed to the index
            result = contentletAPI.search( query, 0, -1, "modDate desc", user, true );

            //Validations
            assertTrue( result == null || result.isEmpty() );
        } finally {
            APILocator.getContentletAPI().delete( testContentlet, user, false );
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

            int x=0;
            do {
                Thread.sleep(200);
                //Verify if it was removed to the index
                result = contentletAPI.search( query, 0, -1, "modDate desc", user, true );
                x++;
            } while((result == null || result.isEmpty()) && x<100);

        } finally {
            APILocator.getContentletAPI().delete( testContentlet, user, false );
View Full Code Here

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

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

      assertTrue(UtilMethods.isSet(result) && !result.isEmpty());

      } catch(Exception e) {
        Logger.error("Error executing testSearchIndexByDate", e.getMessage(), e);
View Full Code Here

        boolean removed = false;
        int counter = 0;
        while ( counter < 300 ) {
            try {
                //Verify if it was removed to the index
                List<Contentlet> result = contentletAPI.search( query, 0, -1, "modDate desc", user, true );

                //Validations
                if ( result == null || result.isEmpty() ) {
                    return true;
                }
View Full Code Here

      String id = idMap.get("id");

      //Search contentlets by identifier (all languages) and set permissions
      String luceneQuery = "+identifier:"+id+" +working:true";
      try {
        for(Permissionable childPermissionable: contentAPI.search(luceneQuery,1,0,null,systemUser, false)) {
          savePermission(new Permission(id, role.getId(), permission, true), childPermissionable);
          break;
        }
      } catch (DotSecurityException e) {
        Logger.error(PermissionBitFactoryImpl.class, e.getMessage(), e);
View Full Code Here

    int offset=0;
    List<Contentlet> contentlets;
    do {
      String query="structurename:"+structure.getVelocityVarName();
      try {
          contentlets=contAPI.search(query, limit, offset, "identifier", APILocator.getUserAPI().getSystemUser(), false);
            } catch (DotSecurityException e) {
                throw new RuntimeException(e);
            }

      BulkRequestBuilder bulk=new ESClient().getClient().prepareBulk();
View Full Code Here

          luceneQuery.append(" +live:false ");
          luceneQuery.append(" +working:true ");
          luceneQuery.append(" +deleted:false ");
   
          try {
            List<Contentlet> cons = capi.search(luceneQuery.toString(), 0, batchSize, null, expireUSer, false);
            while (cons.size() > 0) {
   
              capi.publish(cons, pubUser, false);
              Thread.sleep(500);
   
View Full Code Here

        if (st.getStructureType() == Structure.STRUCTURE_TYPE_FORM) {
            Structure sf = StructureCache.getStructureByVelocityVarName(
                    FormAPI.FORM_WIDGET_STRUCTURE_NAME_VELOCITY_VAR_NAME);
            if (UtilMethods.isSet(sf) && UtilMethods.isSet(sf.getInode())) {
                Field field = st.getFieldVar(FormAPI.FORM_WIDGET_FORM_ID_FIELD_VELOCITY_VAR_NAME);
                conAPI.delete( conAPI.search(
                        "+structureInode:" + sf.getInode() +
                        " +structureInode:" + st.getInode(), 0, 0,
                        "", user, false), user, false);
            }
        }
View Full Code Here

            while (cons.size() > 0) {
   
              capi.publish(cons, pubUser, false);
              Thread.sleep(500);
   
              cons = capi.search(luceneQuery.toString(), 0, batchSize, null, expireUSer, false);
            }
          } catch (Exception e) {
            Logger.error(this.getClass(), e.getMessage(), e);
            throw new JobExecutionException(e);
          }
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.