Package com.dotcms.publisher.environment.business

Examples of com.dotcms.publisher.environment.business.EnvironmentAPI


        if(!exists)
            permissions.add(p);
      }


          EnvironmentAPI eAPI = APILocator.getEnvironmentAPI();
      eAPI.saveEnvironment(environment, permissions);

    } catch (DotDataException e) {
      Logger.info(getClass(), e.getMessage());
      throw new DotRuntimeException(e.getMessage());
    }
View Full Code Here


        if(!exists)
            permissions.add(p);
      }

          EnvironmentAPI eAPI = APILocator.getEnvironmentAPI();
      eAPI.updateEnvironment(environment, permissions);

            //If it was updated successfully lets set the session
            if ( UtilMethods.isSet( request.getSession().getAttribute( WebKeys.SELECTED_ENVIRONMENTS + getUser().getUserId() ) ) ) {

                //Get the selected environments from the session
View Full Code Here

   * @throws InterruptedException
   */
  @Test
  public void retry_issue5097 () throws DotSecurityException, DotDataException, IOException, JSONException, DotPublisherException, InterruptedException {

    EnvironmentAPI environmentAPI = APILocator.getEnvironmentAPI();
    ContentletAPI contentletAPI = APILocator.getContentletAPI();
    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" );
View Full Code Here

    /*
     * Generate test environment
     */
    //Preparing the url in order to push content
    EnvironmentAPI environmentAPI = APILocator.getEnvironmentAPI();
    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();
View Full Code Here

    /*
     * Generate test environment
     */
    //Preparing the url in order to push content
    EnvironmentAPI environmentAPI = APILocator.getEnvironmentAPI();
    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();
View Full Code Here

        if ( !responseResource.validate( responseMessage, "environment" ) ) {
            return responseResource.responseError( responseMessage.toString(), HttpStatus.SC_BAD_REQUEST );
        }

        try {
            EnvironmentAPI environmentAPI = APILocator.getEnvironmentAPI();

            //Delete the environment
            environmentAPI.deleteEnvironment( environment );

            //If it was deleted successfully lets remove it from session
            if ( UtilMethods.isSet( request.getSession().getAttribute( WebKeys.SELECTED_ENVIRONMENTS + user ) ) ) {

                //Get the selected environments from the session
View Full Code Here

TOP

Related Classes of com.dotcms.publisher.environment.business.EnvironmentAPI

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.