Package com.dotmarketing.util.json

Examples of com.dotmarketing.util.json.JSONObject


    if(map != null) {
      for (String key : map.keySet()) {
        Role r = roleAPI.loadRoleById(key);
       
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", r.getId().replace('-', '_'));
        jsonObject.put("name", UtilMethods.javaScriptify(r.getName()));
        jsonObject.put("locked", r.isLocked());
       
        LinkedHashMap<String, Object> children = (LinkedHashMap<String, Object>) map.get(key);
       
        jsonObject.put("children", (Object)buildFilteredJsonTree(children));
        jsonChildren.add(jsonObject);
      }
    }
    return jsonChildren;
  }
View Full Code Here


                    //Build the version string
                    String version = bundle.getVersion().getMajor() + "." + bundle.getVersion().getMinor() + "." + bundle.getVersion().getMicro();

                    //Reading and setting bundle information
                    JSONObject jsonResponse = new JSONObject();
                    jsonResponse.put( "bundleId", bundle.getBundleId() );
                    jsonResponse.put( "symbolicName", bundle.getSymbolicName() );
                    jsonResponse.put( "location", bundle.getLocation() );
                    jsonResponse.put( "jarFile", jarFile );
                    jsonResponse.put( "state", bundle.getState() );
                    jsonResponse.put( "version", version );
                    jsonResponse.put( "separator", separator );

                    bundlesArray.add( jsonResponse );
                }

                responseMessage.append( bundlesArray.toString() );
View Full Code Here

        Map<String, String> paramsMap = initData.getParamsMap();

        final HttpSession session = request.getSession();
        final User loggedUser = initData.getUser();

        JSONObject jsonResponse = new JSONObject();

        //Validate the parameters
        final String endpointId = paramsMap.get( "endpoint" );
        if ( !UtilMethods.isSet( endpointId ) ) {
            return Response.status( HttpStatus.SC_BAD_REQUEST ).entity( "Error: endpoint is a required Field.").build();
        }


        // return if we already have the data
        try {
            IntegrityUtil integrityUtil = new IntegrityUtil();

            if(integrityUtil.doesIntegrityConflictsDataExist(endpointId)) {

                jsonResponse.put( "success", true );
                jsonResponse.put( "message", "Integrity Checking Initialized..." );

                //Setting the process status
                setStatus( request, endpointId, ProcessStatus.FINISHED );

                return response( jsonResponse.toString(), false );
            }
        } catch(JSONException e) {
            Logger.error(IntegrityResource.class, "Error setting return message in JSON response", e);
            return response( "Error setting return message in JSON response" , true );
        } catch(Exception e) {
            Logger.error(IntegrityResource.class, "Error checking existence of integrity data", e);
            return response( "Error checking existence of integrity data" , true );
        }

        try {

            //Setting the process status
            setStatus( request, endpointId, ProcessStatus.PROCESSING );

            final Client client = getRESTClient();

            final PublishingEndPoint endpoint = APILocator.getPublisherEndPointAPI().findEndPointById(endpointId);
            final String authToken = PushPublisher.retriveKeyString(PublicEncryptionFactory.decryptString(endpoint.getAuthKey().toString()));

            FormDataMultiPart form = new FormDataMultiPart();
            form.field("AUTH_TOKEN",authToken);

            //Sending bundle to endpoint
            String url = endpoint.toURL()+"/api/integrity/generateintegritydata/";
            com.dotcms.repackage.com.sun.jersey.api.client.WebResource resource = client.resource(url);

            ClientResponse response =
                    resource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class, form);

            if(response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_OK) {
                final String integrityDataRequestID = response.getEntity(String.class);

                Thread integrityDataRequestChecker = new Thread() {
                    public void run(){

                        FormDataMultiPart form = new FormDataMultiPart();
                        form.field("AUTH_TOKEN",authToken);
                        form.field("REQUEST_ID",integrityDataRequestID);

                        String url = endpoint.toURL()+"/api/integrity/getintegritydata/";
                        com.dotcms.repackage.com.sun.jersey.api.client.WebResource resource = client.resource(url);

                        boolean processing = true;

                        while(processing) {

                            ClientResponse response = resource.type( MediaType.MULTIPART_FORM_DATA ).post( ClientResponse.class, form );
                            if ( response.getClientResponseStatus() != null && response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_OK ) {

                                processing = false;

                                InputStream zipFile = response.getEntityInputStream();
                                String outputDir = ConfigUtils.getIntegrityPath() + File.separator + endpoint.getId();

                                try {

                                    IntegrityUtil.unzipFile(zipFile, outputDir);

                                } catch(Exception e) {

                                    //Special handling if the thread was interrupted
                                    if ( e instanceof InterruptedException ) {
                                        //Setting the process status
                                        setStatus( session, endpointId, ProcessStatus.CANCELED, null );
                                        Logger.debug( IntegrityResource.class, "Requested interruption of the integrity checking process [unzipping Integrity Data] by the user.", e );
                                        throw new RuntimeException( "Requested interruption of the integrity checking process [unzipping Integrity Data] by the user.", e );
                                    }

                                    //Setting the process status
                                    setStatus( session, endpointId, ProcessStatus.ERROR, null );
                                    Logger.error(IntegrityResource.class, "Error while unzipping Integrity Data", e);
                                    throw new RuntimeException("Error while unzipping Integrity Data", e);
                                }

                                // set session variable
                                // call IntegrityChecker

                                Boolean foldersConflicts = false;
                                Boolean structuresConflicts = false;
                                Boolean schemesConflicts = false;

                                IntegrityUtil integrityUtil = new IntegrityUtil();
                                try {
                                    HibernateUtil.startTransaction();

                                    foldersConflicts = integrityUtil.checkFoldersIntegrity(endpointId);
                                    structuresConflicts = integrityUtil.checkStructuresIntegrity(endpointId);
                                    schemesConflicts = integrityUtil.checkWorkflowSchemesIntegrity(endpointId);

                                    HibernateUtil.commitTransaction();


                                } catch(Exception e) {

                                    try {
                                        HibernateUtil.rollbackTransaction();
                                    } catch (DotHibernateException e1) {
                                        Logger.error(IntegrityResource.class, "Error while rolling back transaction", e);
                                    }

                                    //Special handling if the thread was interrupted
                                    if ( e instanceof InterruptedException ) {
                                        //Setting the process status
                                        setStatus( session, endpointId, ProcessStatus.CANCELED, null );
                                        Logger.debug( IntegrityResource.class, "Requested interruption of the integrity checking process by the user.", e );
                                        throw new RuntimeException( "Requested interruption of the integrity checking process by the user.", e );
                                    }

                                    Logger.error(IntegrityResource.class, "Error checking integrity", e);

                                    //Setting the process status
                                    setStatus( session, endpointId, ProcessStatus.ERROR, null );
                                    throw new RuntimeException("Error checking integrity", e);
                                } finally {
                                    try {
                                        integrityUtil.dropTempTables(endpointId);
                                    } catch (DotDataException e) {
                                        Logger.error(IntegrityResource.class, "Error while deleting temp tables", e);
                                    }
                                }

                                if ( !foldersConflicts && !structuresConflicts && !schemesConflicts ) {
                                    String noConflictMessage;
                                    try {
                                        noConflictMessage = LanguageUtil.get( loggedUser.getLocale(), "push_publish_integrity_conflicts_not_found" );
                                    } catch ( LanguageException e ) {
                                        noConflictMessage = "No Integrity Conflicts found";
                                    }
                                    //Setting the process status
                                    setStatus( session, endpointId, ProcessStatus.NO_CONFLICTS, noConflictMessage );
                                } else {
                                    //Setting the process status
                                    setStatus( session, endpointId, ProcessStatus.FINISHED, null );
                                }

                            } else if ( response.getClientResponseStatus() == null && response.getStatus() == HttpStatus.SC_PROCESSING ) {
                                continue;
                            } else if ( response.getClientResponseStatus() == null && response.getStatus() == HttpStatus.SC_RESET_CONTENT ) {
                                processing = false;
                                //Setting the process status
                                setStatus( session, endpointId, ProcessStatus.CANCELED, null );
                            } else {
                                setStatus( session, endpointId, ProcessStatus.ERROR, null );
                                Logger.error( this.getClass(), "Response indicating a " + response.getClientResponseStatus().getReasonPhrase() + " (" + response.getClientResponseStatus().getStatusCode() + ") Error trying to retrieve the Integrity data from the Endpoint [" + endpointId + "]." );
                                processing = false;
                            }
                        }
                    }
                };

                //Start the integrity check
                integrityDataRequestChecker.start();
                addThreadToSession( session, integrityDataRequestChecker, endpointId, integrityDataRequestID );

            } else if ( response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_UNAUTHORIZED ) {
                setStatus( session, endpointId, ProcessStatus.ERROR, null );
                Logger.error( this.getClass(), "Response indicating Not Authorized received from Endpoint. Please check Auth Token. Endpoint Id: " + endpointId );
                return response( "Response indicating Not Authorized received from Endpoint. Please check Auth Token. Endpoint Id:" + endpointId, true );
            } else {
                setStatus( session, endpointId, ProcessStatus.ERROR, null );
                Logger.error( this.getClass(), "Response indicating a " + response.getClientResponseStatus().getReasonPhrase() + " (" + response.getClientResponseStatus().getStatusCode() + ") Error trying to connect with the Integrity API on the Endpoint. Endpoint Id: " + endpointId );
                return response( "Response indicating a " + response.getClientResponseStatus().getReasonPhrase() + " (" + response.getClientResponseStatus().getStatusCode() + ") Error trying to connect with the Integrity API on the Endpoint. Endpoint Id: " + endpointId, true );
            }

            jsonResponse.put( "success", true );
            jsonResponse.put( "message", "Integrity Checking Initialized..." );

        } catch(Exception e) {

            //Special handling if the thread was interrupted
            if ( e instanceof InterruptedException || e.getCause() instanceof InterruptedException ) {
                //Setting the process status
                setStatus( session, endpointId, ProcessStatus.CANCELED, null );
                Logger.debug( IntegrityResource.class, "Requested interruption of the integrity checking process by the user.", e );
                return response( "Requested interruption of the integrity checking process by the user for End Point server: [" + endpointId + "]" , true );
            }

            //Setting the process status
            setStatus( session, endpointId, ProcessStatus.ERROR, null );
            Logger.error( this.getClass(), "Error initializing the integrity checking process for End Point server: [" + endpointId + "]", e );
            return response( "Error initializing the integrity checking process for End Point server: [" + endpointId + "]" , true );
        }


        return response( jsonResponse.toString(), false );

    }
View Full Code Here

            return responseBuilder.build();
        }

        try {
            JSONObject jsonResponse = new JSONObject();

            HttpSession session = request.getSession();
            //Verify if we have something set on the session
            if ( session.getAttribute( "integrityCheck_" + endpointId ) == null ) {
                //And prepare the response
                jsonResponse.put( "success", false );
                jsonResponse.put( "message", "No checking process found for End point server [" + endpointId + "]" );
            } else if ( session.getAttribute( "integrityThread_" + endpointId ) == null ) {
                //And prepare the response
                jsonResponse.put( "success", false );
                jsonResponse.put( "message", "No checking process found for End point server [" + endpointId + "]" );
            } else {

                //Search for the status on session
                ProcessStatus status = (ProcessStatus) session.getAttribute( "integrityCheck_" + endpointId );

                //And prepare the response
                jsonResponse.put( "endPoint", endpointId );
                if ( status == ProcessStatus.PROCESSING ) {

                    //Get the thread associated to this endpoint and the integrity request id
                    Thread runningThread = (Thread) session.getAttribute( "integrityThread_" + endpointId );
                    String integrityDataRequestId = (String) session.getAttribute( "integrityDataRequest_" + endpointId );

                    //Find the registered auth token in order to connect to the end point server
                    PublishingEndPoint endpoint = APILocator.getPublisherEndPointAPI().findEndPointById( endpointId );
                    String authToken = PushPublisher.retriveKeyString( PublicEncryptionFactory.decryptString( endpoint.getAuthKey().toString() ) );

                    FormDataMultiPart form = new FormDataMultiPart();
                    form.field( "AUTH_TOKEN", authToken );
                    form.field( "REQUEST_ID", integrityDataRequestId );

                    //Prepare the connection
                    Client client = getRESTClient();
                    String url = endpoint.toURL() + "/api/integrity/cancelIntegrityProcessOnEndpoint/";
                    com.dotcms.repackage.com.sun.jersey.api.client.WebResource resource = client.resource( url );

                    //Execute the call
                    ClientResponse response = resource.type( MediaType.MULTIPART_FORM_DATA ).post( ClientResponse.class, form );

                    if ( response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_OK ) {
                        //Nothing to do here, we found no process to cancel
                    } else if ( response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_RESET_CONTENT ) {
                        //Expected return status if a cancel was made on the end point server
                    } else {
                        Logger.error( this.getClass(), "Response indicating a " + response.getClientResponseStatus().getReasonPhrase() + " (" + response.getClientResponseStatus().getStatusCode() + ") Error trying to interrupt the running process on the Endpoint [ " + endpointId + "]." );
                    }

                    //Interrupt the Thread process
                    runningThread.interrupt();

                    //Remove the thread from the session
                    clearThreadInSession( request, endpointId );

                    jsonResponse.put( "success", true );
                    jsonResponse.put( "message", LanguageUtil.get( initData.getUser().getLocale(), "IntegrityCheckingCanceled" ) );
                } else {
                    jsonResponse.put( "success", false );
                    jsonResponse.put( "message", "The integrity process for End Point server: [" + endpointId + "] was already stopped." );
                }
            }

            responseMessage.append( jsonResponse.toString() );

        } catch ( Exception e ) {
            Logger.error( this.getClass(), "Error checking the integrity process status for End Point server: [" + endpointId + "]", e );
            return response( "Error checking the integrity process status for End Point server: [" + endpointId + "]", true );
        }
View Full Code Here

            return responseBuilder.build();
        }

        try {
            JSONObject jsonResponse = new JSONObject();

            HttpSession session = request.getSession();
            //Verify if we have something set on the session
            if ( session.getAttribute( "integrityCheck_" + endpointId ) == null ) {
                //And prepare the response
                jsonResponse.put( "success", true );
                jsonResponse.put( "message", "No checking process found for End point server [" + endpointId + "]" );
                jsonResponse.put( "status", "nopresent" );
            } else {

                //Search for the status on session
                ProcessStatus status = (ProcessStatus) session.getAttribute( "integrityCheck_" + endpointId );

                //And prepare the response
                jsonResponse.put( "success", true );
                jsonResponse.put( "endPoint", endpointId );
                if ( status == ProcessStatus.PROCESSING ) {
                    jsonResponse.put( "status", "processing" );
                    jsonResponse.put( "message", "Success" );
                } else if ( status == ProcessStatus.FINISHED ) {
                    jsonResponse.put( "status", "finished" );
                    jsonResponse.put( "message", "Success" );
                } else if ( status == ProcessStatus.NO_CONFLICTS ) {
                    jsonResponse.put( "status", "noConflicts" );
                    jsonResponse.put( "message", session.getAttribute( "integrityCheck_message_" + endpointId ) );
                    clearStatus( request, endpointId );
                } else if ( status == ProcessStatus.CANCELED) {
                    jsonResponse.put( "status", "canceled" );
                    jsonResponse.put( "message", LanguageUtil.get( initData.getUser().getLocale(), "IntegrityCheckingCanceled" ) );
                    clearStatus( request, endpointId );
                } else {
                    jsonResponse.put( "status", "error" );
                    jsonResponse.put( "message", "Error checking the integrity process status for End Point server: [" + endpointId + "]" );
                    clearStatus( request, endpointId );
                }
            }

            responseMessage.append( jsonResponse.toString() );

        } catch ( Exception e ) {
            Logger.error( this.getClass(), "Error checking the integrity process status for End Point server: [" + endpointId + "]", e );
            return response( "Error checking the integrity process status for End Point server: [" + endpointId + "]" , true );
        }
View Full Code Here

            return responseBuilder.build();
        }

        try {

            JSONObject jsonResponse = new JSONObject();
            IntegrityUtil integrityUtil = new IntegrityUtil();

            //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            //Structures tab data
            JSONArray tabResponse = null;
            JSONObject errorContent = null;

            IntegrityType[] types = IntegrityType.values();
            boolean isThereAnyConflict = false;

            for (IntegrityType integrityType : types) {
                tabResponse = new JSONArray();
                errorContent = new JSONObject();

                errorContent.put( "title",   LanguageUtil.get( initData.getUser().getLocale(), integrityType.getLabel() )  );//Title of the check

                List<Map<String, Object>> results = integrityUtil.getIntegrityConflicts(endpointId, integrityType);

                JSONArray columns = new JSONArray();

                switch (integrityType) {
                    case STRUCTURES:
                        columns.add("velocity_name");
                        break;
                    case FOLDERS:
                        columns.add("folder");
                        break;
                    case SCHEMES:
                        columns.add("name");
                        break;
                }

                columns.add("local_inode");
                columns.add("remote_inode");

                errorContent.put( "columns", columns.toArray() );

                if(!results.isEmpty()) {
                    // the columns names are the keys in the results
                    isThereAnyConflict = isThereAnyConflict || true;

                    JSONArray values = new JSONArray();
                    for (Map<String, Object> result : results) {

                        JSONObject columnsContent = new JSONObject();

                        for (String keyName : result.keySet()) {
                            columnsContent.put(keyName, result.get(keyName));
                        }

                        values.put(columnsContent);
                    }
View Full Code Here

        if ( !UtilMethods.isSet( type ) ) {
            return Response.status( HttpStatus.SC_BAD_REQUEST ).entity( responseMessage.append( "Error: " ).append( "'type'" ).append( " is a required param." )).build();
        }

        try {
            JSONObject jsonResponse = new JSONObject();

            IntegrityUtil integrityUtil = new IntegrityUtil();
            integrityUtil.discardConflicts(endpointId, IntegrityType.valueOf(type.toUpperCase()));

            clearStatus( request, endpointId );

            responseMessage.append( jsonResponse.toString() );

        } catch ( Exception e ) {
            Logger.error( this.getClass(), "Error discarding "+type+" conflicts for End Point server: [" + endpointId + "]", e );
            return response( "Error discarding "+type+" conflicts for End Point server: [" + endpointId + "]" , true );
        }
View Full Code Here

    public Response fixConflictsFromRemote ( @Context final HttpServletRequest request,
                                             @FormDataParam("DATA_TO_FIX") InputStream dataToFix, @FormDataParam("AUTH_TOKEN") String auth_token_enc,
                                             @FormDataParam("TYPE") String type ) throws JSONException {

        String remoteIP = null;
        JSONObject jsonResponse = new JSONObject();

        try {
            String auth_token = PublicEncryptionFactory.decryptString(auth_token_enc);
            remoteIP = request.getRemoteHost();
            if(!UtilMethods.isSet(remoteIP))
                remoteIP = request.getRemoteAddr();

            PublishingEndPointAPI endpointAPI = APILocator.getPublisherEndPointAPI();
            final PublishingEndPoint requesterEndPoint = endpointAPI.findEnabledSendingEndPointByAddress(remoteIP);

            if(!BundlePublisherResource.isValidToken(auth_token, remoteIP, requesterEndPoint)) {
                return Response.status(HttpStatus.SC_UNAUTHORIZED).build();
            }

            IntegrityUtil integrityUtil = new IntegrityUtil();
            HibernateUtil.startTransaction();
            integrityUtil.fixConflicts(dataToFix, requesterEndPoint.getId(), IntegrityType.valueOf(type.toUpperCase()) );
            HibernateUtil.commitTransaction();


        } catch ( Exception e ) {
            try {
                HibernateUtil.rollbackTransaction();
            } catch (DotHibernateException e1) {
                Logger.error(IntegrityResource.class, "Error while rolling back transaction", e);
            }
            Logger.error( this.getClass(), "Error fixing "+type+" conflicts from remote", e );
            return response( "Error fixing "+type+" conflicts from remote" , true );
        }

        jsonResponse.put( "success", true );
        jsonResponse.put( "message", "Conflicts fixed in Remote Endpoint" );
        return response( jsonResponse.toString(), false );



    }
View Full Code Here

    @Produces (MediaType.APPLICATION_JSON)
    public Response fixConflicts ( @Context final HttpServletRequest request, @PathParam ("params") String params ) throws JSONException {

        InitDataObject initData = init( params, true, request, true );
        Map<String, String> paramsMap = initData.getParamsMap();
        JSONObject jsonResponse = new JSONObject();

        //Validate the parameters
        String endpointId = paramsMap.get( "endpoint" );
        String type = paramsMap.get( "type" );
        String whereToFix = paramsMap.get( "wheretofix" );

        if ( !UtilMethods.isSet( endpointId ) ) {
            return Response.status( HttpStatus.SC_BAD_REQUEST ).entity( "Error: 'endpoint' is a required param." ).build();
        }

        if ( !UtilMethods.isSet( type ) ) {
            return Response.status( HttpStatus.SC_BAD_REQUEST ).entity( "Error: 'type' is a required param." ).build();
        }

        if ( !UtilMethods.isSet( whereToFix ) ) {
            return Response.status( HttpStatus.SC_BAD_REQUEST ).entity( "Error: 'whereToFix' is a required param." ).build();
        }



        try {

            IntegrityUtil integrityUtil = new IntegrityUtil();

            if(whereToFix.equals("local")) {

              HibernateUtil.startTransaction();
                integrityUtil.fixConflicts(endpointId, IntegrityType.valueOf(type.toUpperCase()));
                HibernateUtil.commitTransaction();
                jsonResponse.put( "success", true );
                jsonResponse.put( "message", "Conflicts fixed in Local Endpoint" );

                clearStatus( request, endpointId );

            } else  if(whereToFix.equals("remote")) {
                integrityUtil.generateDataToFixZip(endpointId, IntegrityType.valueOf(type.toUpperCase()));

                final Client client = getRESTClient();

                PublishingEndPoint endpoint = APILocator.getPublisherEndPointAPI().findEndPointById(endpointId);
                String outputPath = ConfigUtils.getIntegrityPath() + File.separator + endpointId;
                File bundle = new File(outputPath + File.separator + INTEGRITY_DATA_TO_FIX_ZIP_FILE_NAME);

                FormDataMultiPart form = new FormDataMultiPart();
                form.field("AUTH_TOKEN",
                        PushPublisher.retriveKeyString(
                                PublicEncryptionFactory.decryptString(endpoint.getAuthKey().toString())));

                form.field("TYPE", type);
                form.bodyPart(new FileDataBodyPart("DATA_TO_FIX", bundle, MediaType.MULTIPART_FORM_DATA_TYPE));

                String url = endpoint.toURL()+"/api/integrity/fixconflictsfromremote/";
                com.dotcms.repackage.com.sun.jersey.api.client.WebResource resource = client.resource(url);

                ClientResponse response = resource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class, form);

                if(response.getClientResponseStatus().getStatusCode() == HttpStatus.SC_OK) {
                    jsonResponse.put( "success", true );
                    jsonResponse.put( "message", "Fix Conflicts Process successfully started at Remote." );

                    integrityUtil.discardConflicts(endpointId, IntegrityType.valueOf(type.toUpperCase()));

                    clearStatus( request, endpointId );


                } else {
                    return Response.status( HttpStatus.SC_BAD_REQUEST ).entity("Endpoint with id: " + endpointId + " returned server error." ).build();
                }
            } else {
                return Response.status( HttpStatus.SC_BAD_REQUEST ).entity( "Error: 'whereToFix' has an invalid value.").build();
            }

        } catch ( Exception e ) {
          try {
                HibernateUtil.rollbackTransaction();
            } catch (DotHibernateException e1) {
                Logger.error(IntegrityResource.class, "Error while rolling back transaction", e);
            }

            Logger.error( this.getClass(), "Error fixing "+type+" conflicts for End Point server: [" + endpointId + "]", e );
            return response( "Error fixing conflicts for endpoint: " + endpointId , true );
        }

        return response( jsonResponse.toString(), false );
    }
View Full Code Here

                responseMessage.append( xmlBuilder );
            } else {

                //TODO: Handle JSON and JSONP the same

                JSONObject jsonResponse = new JSONObject();
                jsonResponse.put( "success", true );
                jsonResponse.put( "message", "Success message" );
                jsonResponse.put( "param1", param1 );
                jsonResponse.put( "param2", param2 );

                responseMessage.append( jsonResponse.toString() );
            }


        } catch ( Exception e ) {
            Logger.error( this.getClass(), "Error on test method.", e );
View Full Code Here

TOP

Related Classes of com.dotmarketing.util.json.JSONObject

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.