Package com.dotmarketing.portlets.contentlet.business

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


        HashMap<String, List<String>> results = ImportUtil.importFile( 0L, defaultHost.getInode(), structure1.getInode(), new String[]{}, true, false, user, defaultLanguage.getId(), csvHeaders, csvreader, -1, -1, reader );
        //Validations
        validate( results, true, false, true );

        //As it was a preview nothing should be saved
        List<Contentlet> savedData = contentletAPI.findByStructure( structure1.getInode(), user, false, 0, 0 );
        //Validations
        assertNotNull( savedData );
        assertEquals( savedData.size(), 0 );

        //----------------PREVIEW = FALSE-----------------------------------------
View Full Code Here


        results = ImportUtil.importFile( 0L, defaultHost.getInode(), structure1.getInode(), new String[]{}, false, false, user, defaultLanguage.getId(), csvHeaders, csvreader, -1, -1, reader );
        //Validations
        validate( results, false, false, true );

        //Now we should have saved data
        savedData = contentletAPI.findByStructure( structure1.getInode(), user, false, 0, 0 );
        //Validations
        assertNotNull( savedData );
        assertEquals( savedData.size(), 4 );

        //----------------USING WRONG HOST IDENTIFIERS----------------------------
View Full Code Here

        results = ImportUtil.importFile( 0L, defaultHost.getInode(), structure1.getInode(), new String[]{}, true, false, user, defaultLanguage.getId(), csvHeaders, csvreader, -1, -1, reader );
        //Validations
        validate( results, true, true, true );

        //We should have the same amount on data
        savedData = contentletAPI.findByStructure( structure1.getInode(), user, false, 0, 0 );
        //Validations
        assertNotNull( savedData );
        assertEquals( savedData.size(), 4 );

        //---------------USING KEY FIELDS-----------------------------------------
View Full Code Here

        results = ImportUtil.importFile( 0L, defaultHost.getInode(), structure1.getInode(), new String[]{textFileStructure1.getInode()}, false, false, user, defaultLanguage.getId(), csvHeaders, csvreader, -1, -1, reader );
        //Validations
        validate( results, false, false, true );//We should expect warnings: Line #X. The key fields chosen match 1 existing content(s) - more than one match suggests key(s) are not properly unique

        //We used the key fields, so the import process should update instead to add new records
        savedData = contentletAPI.findByStructure( structure1.getInode(), user, false, 0, 0 );
        //Validations
        assertNotNull( savedData );
        assertEquals( savedData.size(), 4 );

        //---------------USING IDENTIFIER COLUMN----------------------------------
View Full Code Here

        results = ImportUtil.importFile( 0L, defaultHost.getInode(), structure1.getInode(), new String[]{}, false, false, user, defaultLanguage.getId(), csvHeaders, csvreader, -1, -1, reader );
        //Validations
        validate( results, false, false, true );

        //We used a identifier column, so the import process should update instead to add new records
        savedData = contentletAPI.findByStructure( structure1.getInode(), user, false, 0, 0 );
        //Validations
        assertNotNull( savedData );
        assertEquals( savedData.size(), 4 );

        //-------------------------LANGUAGE AND KEY FIELDS------------------------
View Full Code Here

        results = ImportUtil.importFile( 0L, defaultHost.getInode(), structure1.getInode(), new String[]{textFileStructure1.getInode()}, false, true, user, -1, csvHeaders, csvreader, languageCodeHeaderColumn, countryCodeHeaderColumn, reader );
        //Validations
        validate( results, false, false, false );

        //We used the key fields, so the import process should update instead to add new records
        savedData = contentletAPI.findByStructure( structure1.getInode(), user, false, 0, 0 );
        //Validations
        assertNotNull( savedData );
        assertEquals( savedData.size(), 6 );

        //Validate we saved the contentlets on spanish
View Full Code Here

    for (int i = 0; i < 10000; i++) {

      int limit = 100;
      int offset = i * 100;

      List<Contentlet> cons = capi.findByStructure(struct.getInode(), APILocator.getUserAPI().getSystemUser(), false, limit, offset);
      if (cons.size() == 0) {
        break;
      }
      Client client = new ESClient().getClient();
      BulkRequestBuilder bulkRequest = client.prepareBulk();
View Full Code Here

   */
  public static void removeContentletMapFile(Structure structure) throws DotDataException, DotSecurityException{
    ContentletAPI conAPI=APILocator.getContentletAPI();
    int limit=500;
    int offset=0;
    List<Contentlet> contentlets=conAPI.findByStructure(structure, APILocator.getUserAPI().getSystemUser(), false, limit, offset);
    int size=contentlets.size();
    while(size > 0){
      for (Contentlet contentlet : contentlets) {
        removeContentletMapFile(contentlet);
      }
View Full Code Here

    while(size > 0){
      for (Contentlet contentlet : contentlets) {
        removeContentletMapFile(contentlet);
      }
      offset += limit;
      contentlets=conAPI.findByStructure(structure, APILocator.getUserAPI().getSystemUser(), false, limit, offset);
      size=contentlets.size();
    }
  }

  /**
 
View Full Code Here

   */
  public static void removeContentletFile(Structure structure) throws DotDataException, DotSecurityException{
    ContentletAPI conAPI= APILocator.getContentletAPI();
    int limit= 500;
    int offset= 0;
    List<Contentlet> contentlets= conAPI.findByStructure(structure, APILocator.getUserAPI().getSystemUser(), false, limit, offset);
    int size= contentlets.size();
    while(size > 0){
      for (Contentlet contentlet : contentlets) {
        removeContentletFile(contentlet);
      }
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.