Package com.dotcms.publisher.environment.bean

Examples of com.dotcms.publisher.environment.bean.Environment


    dc.setSQL(SELECT_ENVIRONMENTS_BY_BUNDLE_ID);
    dc.addParam(bundleId);
    List<Map<String, Object>> res = dc.loadObjectResults();

    for(Map<String, Object> row : res){
      Environment environment = PublisherUtil.getEnvironmentByMap(row);
      environments.add(environment);
    }

    return environments;
  }
View Full Code Here


    return properties;
  }


  public static Environment getEnvironmentByMap(Map<String, Object> row){
    Environment e = new Environment();
    e.setId(row.get("id").toString());
    e.setName(row.get("name").toString());
    e.setPushToAll(DbConnectionFactory.isDBTrue(row.get("push_to_all").toString()));
    return e;
  }
View Full Code Here

    PublishingEndPointAPI publisherEndPointAPI = APILocator.getPublisherEndPointAPI();
    PublisherAPI publisherAPI = PublisherAPI.getInstance();

    HttpServletRequest req = ServletTestRunner.localRequest.get();

    Environment environment = new Environment();
    environment.setName( "TestEnvironment_" + String.valueOf( new Date().getTime() ) );
    environment.setPushToAll( false );

    /*
     * Find the roles of the admin user
     */
    Role role = APILocator.getRoleAPI().loadRoleByKey( adminUser.getUserId() );

    //Create the permissions for the environment
    List<Permission> permissions = new ArrayList<Permission>();
    Permission p = new Permission( environment.getId(), role.getId(), PermissionAPI.PERMISSION_USE );
    permissions.add( p );

    /*
     * Create a environment
     */
    environmentAPI.saveEnvironment( environment, permissions );

    /*
     * Now we need to create the end point
     */
    PublishingEndPoint endpoint = new PublishingEndPoint();
    endpoint.setServerName( new StringBuilder( "TestEndPoint" + String.valueOf( new Date().getTime() ) ) );
    endpoint.setAddress( "127.0.0.1" );
    endpoint.setPort( "999" );
    endpoint.setProtocol( "http" );
    endpoint.setAuthKey( new StringBuilder( PublicEncryptionFactory.encryptString( "1111" ) ) );
    endpoint.setEnabled( true );
    endpoint.setSending( false );//TODO: Shouldn't this be true as we are creating this end point to send bundles to another server..?
    endpoint.setGroupId( environment.getId() );
    /*
     * Save the endpoint.
     */
    publisherEndPointAPI.saveEndPoint( endpoint );
    SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
    SimpleDateFormat timeFormat = new SimpleDateFormat( "H-m" );
    String publishDate = dateFormat.format( new Date() );
    String publishTime = timeFormat.format( new Date() );

    String baseURL = "http://" + req.getServerName() + ":" + req.getServerPort() + "/DotAjaxDirector/com.dotcms.publisher.ajax.RemotePublishAjaxAction/cmd/publish/u/admin@dotcms.com/p/admin";
    String completeURL = baseURL +
        "?remotePublishDate=" + UtilMethods.encodeURIComponent( publishDate ) +
        "&remotePublishTime=" + UtilMethods.encodeURIComponent( publishTime ) +
        "&remotePublishExpireDate=" +
        "&remotePublishExpireTime=" +
        "&iWantTo=" + RemotePublishAjaxAction.DIALOG_ACTION_PUBLISH +
        "&whoToSend=" + UtilMethods.encodeURIComponent( environment.getId() ) +
        "&forcePush=false" +
        "&assetIdentifier=" + UtilMethods.encodeURIComponent( folder.getInode() );

    /*
     * Execute the call
     */
    URL publishUrl = new URL( completeURL );
    String response = IOUtils.toString( publishUrl.openStream(), "UTF-8" );
    /*
     * Validations
     */
    JSONObject jsonResponse = new JSONObject( response );
    assertEquals( jsonResponse.getInt( "errors" ), 0 );
    assertEquals( jsonResponse.getInt( "total" ), 1 );
    assertNotNull( jsonResponse.get( "bundleId" ) );

    /*
     * Now that we have a bundle id
     */
    String bundleId = jsonResponse.getString( "bundleId" );
    /*
     * First we need to verify if this bundle is in the queue job
     */
    List<PublishQueueElement> foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
    assertNotNull( foundBundles );
    assertTrue( !foundBundles.isEmpty() );

    /*
     *        Now lets wait until it finished, by the way, we are expecting it to fail to publish as the end point does not exist.
     *        Keep in mind the queue will try 3 times before to marked as failed to publish, so we have to wait a bit here....
     */
    int x = 0;
    do {
      Thread.sleep( 3000 );
      /*
       * Verify if it continues in the queue job
       */
      foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
      x++;
    } while ( (foundBundles != null && !foundBundles.isEmpty()) && x < 200 );
    /*
     * At this points should not be here anymore
     */
    //foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
    //assertTrue( foundBundles == null || foundBundles.isEmpty() );

    /*
     * Get the audit records related to this bundle
     */
    PublishAuditStatus status = PublishAuditAPI.getInstance().getPublishAuditStatus( bundleId );
    /*
     * We will be able to retry failed and successfully bundles
     */
    assertEquals( status.getStatus(), PublishAuditStatus.Status.FAILED_TO_PUBLISH ); //Remember, we are expecting this to fail

    /*
     * deleting folder, pages and content, to create the receiving endpoint environment
     */
    APILocator.getContentletAPI().delete(contentlet, systemUser, false, true);
    WebAssetFactory.unPublishAsset(workinghtmlPageAsset, systemUser.getUserId(), folder);
    WebAssetFactory.archiveAsset(workinghtmlPageAsset);
    APILocator.getHTMLPageAPI().delete(workinghtmlPageAsset, systemUser, true);
    APILocator.getHTMLPageAPI().delete(workinghtmlPageAsset2, systemUser, true);
    APILocator.getFolderAPI().delete(folder, systemUser, false);
   
    Assert.assertEquals(0,MultiTreeFactory.getMultiTree(workinghtmlPageAsset).size());
    Assert.assertEquals(0,MultiTreeFactory.getMultiTree(workinghtmlPageAsset2).size());
    Assert.assertEquals(0,MultiTreeFactory.getMultiTreeByChild(contentlet.getIdentifier()).size());

    folder = APILocator.getFolderAPI().findFolderByPath(folderPath, host, systemUser, false);
    assertTrue(!UtilMethods.isSet(folder.getInode()));

    /*
     * Find the bundle
     * SIMULATE AN END POINT
     *
     * And finally lets try to simulate a end point sending directly an already created bundle file to
     * the api/bundlePublisher/publish service
     */

    /*
     * Create a receiving end point
     */
    PublishingEndPoint receivingFromEndpoint = new PublishingEndPoint();
    receivingFromEndpoint.setServerName( new StringBuilder( "TestReceivingEndPoint" + String.valueOf( new Date().getTime() ) ) );
    receivingFromEndpoint.setAddress( req.getServerName() );
    receivingFromEndpoint.setPort( String.valueOf( req.getServerPort() ) );
    receivingFromEndpoint.setProtocol( "http" );
    receivingFromEndpoint.setAuthKey( new StringBuilder( PublicEncryptionFactory.encryptString( "1111" ) ) );
    receivingFromEndpoint.setEnabled( true );
    receivingFromEndpoint.setSending( true );//TODO: Shouldn't this be false as we are creating this end point to receive bundles from another server..?
    receivingFromEndpoint.setGroupId( environment.getId() );
    /*
     * Save the endpoint.
     */
    publisherEndPointAPI.saveEndPoint( receivingFromEndpoint );

View Full Code Here

    PublishingEndPointAPI publisherEndPointAPI = APILocator.getPublisherEndPointAPI();
    PublisherAPI publisherAPI = PublisherAPI.getInstance();

    HttpServletRequest req = ServletTestRunner.localRequest.get();

    Environment environment = new Environment();
    environment.setName( "TestEnvironment_" + String.valueOf( new Date().getTime() ) );
    environment.setPushToAll( false );

    /*
     * Find the roles of the admin user
     */
    Role role = APILocator.getRoleAPI().loadRoleByKey( adminUser.getUserId() );

    //Create the permissions for the environment
    List<Permission> permissions = new ArrayList<Permission>();
    Permission p = new Permission( environment.getId(), role.getId(), PermissionAPI.PERMISSION_USE );
    permissions.add( p );

    /*
     * Create a environment
     */
    environmentAPI.saveEnvironment( environment, permissions );

    /*
     * Now we need to create the end point
     */
    PublishingEndPoint endpoint = new PublishingEndPoint();
    endpoint.setServerName( new StringBuilder( "TestEndPoint" + String.valueOf( new Date().getTime() ) ) );
    endpoint.setAddress( "127.0.0.1" );
    endpoint.setPort( "9999" );
    endpoint.setProtocol( "http" );
    endpoint.setAuthKey( new StringBuilder( PublicEncryptionFactory.encryptString( "1111" ) ) );
    endpoint.setEnabled( true );
    endpoint.setSending( false );//TODO: Shouldn't this be true as we are creating this end point to send bundles to another server..?
    endpoint.setGroupId( environment.getId() );
    /*
     * Save the endpoint.
     */
    publisherEndPointAPI.saveEndPoint( endpoint );
    SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
    SimpleDateFormat timeFormat = new SimpleDateFormat( "H-m" );
    String publishDate = dateFormat.format( new Date() );
    String publishTime = timeFormat.format( new Date() );

    String baseURL = "http://" + req.getServerName() + ":" + req.getServerPort() + "/DotAjaxDirector/com.dotcms.publisher.ajax.RemotePublishAjaxAction/cmd/publish/u/admin@dotcms.com/p/admin";
    String completeURL = baseURL +
        "?remotePublishDate=" + UtilMethods.encodeURIComponent( publishDate ) +
        "&remotePublishTime=" + UtilMethods.encodeURIComponent( publishTime ) +
        "&remotePublishExpireDate=" +
        "&remotePublishExpireTime=" +
        "&iWantTo=" + RemotePublishAjaxAction.DIALOG_ACTION_PUBLISH +
        "&whoToSend=" + UtilMethods.encodeURIComponent( environment.getId() ) +
        "&forcePush=false" +
        "&assetIdentifier=" + UtilMethods.encodeURIComponent( folder.getInode() );

    /*
     * Execute the call
     */
    URL publishUrl = new URL( completeURL );
    String response = IOUtils.toString( publishUrl.openStream(), "UTF-8" );
    /*
     * Validations
     */
    JSONObject jsonResponse = new JSONObject( response );
    assertEquals( jsonResponse.getInt( "errors" ), 0 );
    assertEquals( jsonResponse.getInt( "total" ), 1 );
    assertNotNull( jsonResponse.get( "bundleId" ) );

    /*
     * Now that we have a bundle id
     */
    String bundleId = jsonResponse.getString( "bundleId" );
    /*
     * First we need to verify if this bundle is in the queue job
     */
    List<PublishQueueElement> foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
    assertNotNull( foundBundles );
    assertTrue( !foundBundles.isEmpty() );

    /*
     *        Now lets wait until it finished, by the way, we are expecting it to fail to publish as the end point does not exist.
     *        Keep in mind the queue will try 3 times before to marked as failed to publish, so we have to wait a bit here....
     */
    int x = 0;
    do {
      Thread.sleep( 3000 );
      /*
       * Verify if it continues in the queue job
       */
      foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
      x++;
    } while ( (foundBundles != null && !foundBundles.isEmpty()) && x < 200 );
    /*
     * At this points should not be here anymore
     */


    /*
     * Get the audit records related to this bundle
     */
    PublishAuditStatus status = PublishAuditAPI.getInstance().getPublishAuditStatus( bundleId );
    /*
     * We will be able to retry failed and successfully bundles
     */
    assertEquals( status.getStatus(), PublishAuditStatus.Status.FAILED_TO_PUBLISH ); //Remember, we are expecting this to fail

    /*
     * deleting folder, pages and contents, to create the receiving endpoint environment
     */
    APILocator.getContentletAPI().delete(contentlet1, systemUser, false, true);
    APILocator.getContentletAPI().delete(contentlet2, systemUser, false, true);
    APILocator.getContentletAPI().delete(contentlet3, systemUser, false, true);
    WebAssetFactory.unPublishAsset(workinghtmlPageAsset, systemUser.getUserId(), folder);
    WebAssetFactory.archiveAsset(workinghtmlPageAsset);
    APILocator.getHTMLPageAPI().delete(workinghtmlPageAsset, systemUser, true);
    APILocator.getFolderAPI().delete(folder, systemUser, false);

    folder = APILocator.getFolderAPI().findFolderByPath(folderPath, host, systemUser, false);
    assertTrue(!UtilMethods.isSet(folder.getInode()));

    /*
     * Find the bundle
     * SIMULATE AN END POINT
     *
     * And finally lets try to simulate a end point sending directly an already created bundle file to
     * the api/bundlePublisher/publish service
     */

    /*
     * Create a receiving end point
     */
    PublishingEndPoint receivingFromEndpoint = new PublishingEndPoint();
    receivingFromEndpoint.setServerName( new StringBuilder( "TestReceivingEndPoint" + String.valueOf( new Date().getTime() ) ) );
    receivingFromEndpoint.setAddress( req.getServerName() );
    receivingFromEndpoint.setPort( String.valueOf( req.getServerPort() ) );
    receivingFromEndpoint.setProtocol( "http" );
    receivingFromEndpoint.setAuthKey( new StringBuilder( PublicEncryptionFactory.encryptString( "1111" ) ) );
    receivingFromEndpoint.setEnabled( true );
    receivingFromEndpoint.setSending( true );//TODO: Shouldn't this be false as we are creating this end point to receive bundles from another server..?
    receivingFromEndpoint.setGroupId( environment.getId() );
    /*
     * Save the endpoint.
     */
    publisherEndPointAPI.saveEndPoint( receivingFromEndpoint );

View Full Code Here

    PublishingEndPointAPI publisherEndPointAPI = APILocator.getPublisherEndPointAPI();
    PublisherAPI publisherAPI = PublisherAPI.getInstance();

    HttpServletRequest req = ServletTestRunner.localRequest.get();

    Environment environment = new Environment();
    environment.setName( "TestEnvironment_" + String.valueOf( new Date().getTime() ) );
    environment.setPushToAll( false );

    //Find the roles of the admin user
    Role role = APILocator.getRoleAPI().loadRoleByKey( adminUser.getUserId() );

    //Create the permissions for the environment
    List<Permission> permissions = new ArrayList<Permission>();
    Permission p = new Permission( environment.getId(), role.getId(), PermissionAPI.PERMISSION_USE );
    permissions.add( p );

    //Create a environment
    environmentAPI.saveEnvironment( environment, permissions );

    //Now we need to create the end point
    PublishingEndPoint endpoint = new PublishingEndPoint();
    endpoint.setServerName( new StringBuilder( "TestEndPoint" + String.valueOf( new Date().getTime() ) ) );
    endpoint.setAddress( "127.0.0.1" );
    endpoint.setPort( "999" );
    endpoint.setProtocol( "http" );
    endpoint.setAuthKey( new StringBuilder( PublicEncryptionFactory.encryptString( "1111" ) ) );
    endpoint.setEnabled( true );
    endpoint.setSending( false );//TODO: Shouldn't this be true as we are creating this end point to send bundles to another server..?
    endpoint.setGroupId( environment.getId() );
    //Save the endpoint.
    publisherEndPointAPI.saveEndPoint( endpoint );

    //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    //++++++++++++++++++++++++++++++PUBLISH++++++++++++++++++++++++++++

    //Getting test data
    List<Contentlet> contentlets = contentletAPI.findAllContent( 0, 1 );
    //Validations
    assertNotNull( contentlets );
    assertEquals( contentlets.size(), 1 );

    //Preparing the url in order to push content
    SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
    SimpleDateFormat timeFormat = new SimpleDateFormat( "H-m" );
    String publishDate = dateFormat.format( new Date() );
    String publishTime = timeFormat.format( new Date() );

    String baseURL = "http://" + req.getServerName() + ":" + req.getServerPort() + "/DotAjaxDirector/com.dotcms.publisher.ajax.RemotePublishAjaxAction/cmd/publish/u/admin@dotcms.com/p/admin";
    String completeURL = baseURL +
        "?remotePublishDate=" + UtilMethods.encodeURIComponent( publishDate ) +
        "&remotePublishTime=" + UtilMethods.encodeURIComponent( publishTime ) +
        "&remotePublishExpireDate=" +
        "&remotePublishExpireTime=" +
        "&iWantTo=" + RemotePublishAjaxAction.DIALOG_ACTION_PUBLISH +
        "&whoToSend=" + UtilMethods.encodeURIComponent( environment.getId() ) +
        "&forcePush=false" +
        "&assetIdentifier=" + UtilMethods.encodeURIComponent( contentlets.get( 0 ).getIdentifier() );

    //Execute the call
    URL publishUrl = new URL( completeURL );
    String response = IOUtils.toString( publishUrl.openStream(), "UTF-8" );
    //Validations
    JSONObject jsonResponse = new JSONObject( response );
    assertNotNull( contentlets );
    assertEquals( jsonResponse.getInt( "errors" ), 0 );
    assertEquals( jsonResponse.getInt( "total" ), 1 );
    assertNotNull( jsonResponse.get( "bundleId" ) );

    //Now that we have a bundle id
    String bundleId = jsonResponse.getString( "bundleId" );
    //First we need to verify if this bundle is in the queue job
    List<PublishQueueElement> foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
    assertNotNull( foundBundles );
    assertTrue( !foundBundles.isEmpty() );

    /*
         Now lets wait until it finished, by the way, we are expecting it to fail to publish as the end point does not exist.
         Keep in mind the queue will try 3 times before to marked as failed to publish, so we have to wait a bit here....
     */
    int x = 0;
    do {
      Thread.sleep( 3000 );
      //Verify if it continues in the queue job
      foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
      x++;
    } while ( (foundBundles != null && !foundBundles.isEmpty()) && x < 200 );
    //At this points should not be here anymore
    foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
    assertTrue( foundBundles == null || foundBundles.isEmpty() );

    //Get the audit records related to this bundle
    PublishAuditStatus status = PublishAuditAPI.getInstance().getPublishAuditStatus( bundleId );
    //We will be able to retry failed and successfully bundles
    assertEquals( status.getStatus(), PublishAuditStatus.Status.FAILED_TO_PUBLISH ); //Remember, we are expecting this to fail

    //Get current status dates
    Date initialCreationDate = status.getCreateDate();
    Date initialUpdateDate = status.getStatusUpdated();

    //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    //++++++++++++++++++++++++++++++RETRY++++++++++++++++++++++++++++++
    //Now we can try the retry
    req = ServletTestRunner.localRequest.get();
    baseURL = "http://" + req.getServerName() + ":" + req.getServerPort() + "/DotAjaxDirector/com.dotcms.publisher.ajax.RemotePublishAjaxAction/cmd/retry/u/admin@dotcms.com/p/admin";
    completeURL = baseURL + "?bundlesIds=" + UtilMethods.encodeURIComponent( bundleId );

    //Execute the call
    URL retryUrl = new URL( completeURL );
    response = IOUtils.toString( retryUrl.openStream(), "UTF-8" );//We can expect something like "Bundle id: <strong>1193e3eb-3ccd-496e-8995-29a9fcc48cbd</strong> added successfully to Publishing Queue."
    //Validations
    assertNotNull( response );
    assertTrue( response.contains( bundleId ) );
    assertTrue( response.contains( "added successfully to" ) );

    //And should be back to the queue job
    foundBundles = publisherAPI.getQueueElementsByBundleId( bundleId );
    assertNotNull( foundBundles );
    assertTrue( !foundBundles.isEmpty() );

    //Get current status dates
    status = PublishAuditAPI.getInstance().getPublishAuditStatus( bundleId );//Get the audit records related to this bundle
    Date latestCreationDate = status.getCreateDate();
    Date latestUpdateDate = status.getStatusUpdated();
    //Validations
    assertNotSame( initialCreationDate, latestCreationDate );
    assertNotSame( initialUpdateDate, latestUpdateDate );
    assertTrue( initialCreationDate.before( latestCreationDate ) );
    assertTrue( initialUpdateDate.before( latestUpdateDate ) );

    //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    //++++++++++++++++++++SIMULATE AN END POINT++++++++++++++++++++++++
    /*
         And finally lets try to simulate a end point sending directly an already created bundle file to
         the api/bundlePublisher/publish service
     */

    //Create a receiving end point
    PublishingEndPoint receivingFromEndpoint = new PublishingEndPoint();
    receivingFromEndpoint.setServerName( new StringBuilder( "TestReceivingEndPoint" + String.valueOf( new Date().getTime() ) ) );
    receivingFromEndpoint.setAddress( req.getServerName() );
    receivingFromEndpoint.setPort( String.valueOf( req.getServerPort() ) );
    receivingFromEndpoint.setProtocol( "http" );
    receivingFromEndpoint.setAuthKey( new StringBuilder( PublicEncryptionFactory.encryptString( "1111" ) ) );
    receivingFromEndpoint.setEnabled( true );
    receivingFromEndpoint.setSending( true );//TODO: Shouldn't this be false as we are creating this end point to receive bundles from another server..?
    receivingFromEndpoint.setGroupId( environment.getId() );
    //Save the endpoint.
    publisherEndPointAPI.saveEndPoint( receivingFromEndpoint );

    //Find the bundle
    Bundle bundle = APILocator.getBundleAPI().getBundleById( bundleId );
View Full Code Here

            List<String> whereToSend = Arrays.asList(whoToSendTmp.split(","));
            List<Environment> envsToSendTo = new ArrayList<Environment>();

            // Lists of Environments to push to
            for (String envId : whereToSend) {
              Environment e = APILocator.getEnvironmentAPI().findEnvironmentById(envId);

              if(e!=null) {
                envsToSendTo.add(e);
              }
      }
      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-H-m");
      Date publishDate = dateFormat.parse(_contentPushPublishDate+"-"+_contentPushPublishTime);

      List<String> identifiers = new ArrayList<String>();
      identifiers.add(ref.getIdentifier());

      Bundle bundle = new Bundle(null, publishDate, null, processor.getUser().getUserId(), forcePush);
          APILocator.getBundleAPI().saveBundle(bundle, envsToSendTo);

      publisherAPI.addContentsToPublish(identifiers, bundle.getId(), publishDate, processor.getUser());
      if(!_contentPushNeverExpire && (!"".equals(_contentPushExpireDate.trim()) && !"".equals(_contentPushExpireTime.trim()))){
        Date expireDate = dateFormat.parse(_contentPushExpireDate+"-"+_contentPushExpireTime);
        bundle = new Bundle(null, publishDate, expireDate, processor.getUser().getUserId(), forcePush);
              APILocator.getBundleAPI().saveBundle(bundle, envsToSendTo);
        publisherAPI.addContentsToUnpublish(identifiers, bundle.getId(), expireDate, processor.getUser());
      }
    } catch (DotPublisherException e) {
      Logger.debug(PushPublishActionlet.class, e.getMessage());
      throw new  WorkflowActionFailureException(e.getMessage());
    } catch (ParseException e){
      Logger.debug(PushPublishActionlet.class, e.getMessage());
      throw new  WorkflowActionFailureException(e.getMessage());
    } catch (DotDataException e) {
      Logger.debug(PushPublishActionlet.class, e.getMessage());
      throw new  WorkflowActionFailureException(e.getMessage());
    }

  }
View Full Code Here

                List<Environment> lastSelectedEnvironments = (List<Environment>) request.getSession().getAttribute( WebKeys.SELECTED_ENVIRONMENTS + user );
                Iterator<Environment> environmentsIterator = lastSelectedEnvironments.iterator();

                while ( environmentsIterator.hasNext() ) {

                    Environment currentEnv = environmentsIterator.next();
                    //Verify if the current env is on the ones stored in session
                    if ( currentEnv.getId().equals( environment ) ) {
                        //If we found it lets remove it
                        environmentsIterator.remove();
                    }
                }
            }
View Full Code Here

                    List<Environment> lastSelectedEnvironments = (List<Environment>) request.getSession().getAttribute( WebKeys.SELECTED_ENVIRONMENTS );
                    Iterator<Environment> environmentsIterator = lastSelectedEnvironments.iterator();

                    while ( environmentsIterator.hasNext() ) {

                        Environment currentEnv = environmentsIterator.next();
                        //Verify if the current env is on the ones stored in session
                        if ( currentEnv.getId().equals( environmentId ) ) {
                            //If we found it lets remove it
                            environmentsIterator.remove();
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of com.dotcms.publisher.environment.bean.Environment

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.