Package org.apache.sling.commons.json

Examples of org.apache.sling.commons.json.JSONObject.optString()


            map.put(BulkWorkflowEngine.KEY_QUERY,
                    params.getString(BulkWorkflowEngine.KEY_QUERY));

            map.put(BulkWorkflowEngine.KEY_RELATIVE_PATH,
                    StringUtils.removeStart(params.optString(BulkWorkflowEngine.KEY_RELATIVE_PATH, ""), "/"));

            map.put(BulkWorkflowEngine.KEY_WORKFLOW_MODEL,
                    params.getString(BulkWorkflowEngine.KEY_WORKFLOW_MODEL));

            map.put(BulkWorkflowEngine.KEY_BATCH_SIZE,
View Full Code Here


                String path = "/libs/granite/packaging/rcp.tasks/" + task.getId();
                response.setHeader("Location", path);

            // ---------------------------------------------------------------------------------------------< start >---
            } else if ("start".equals(cmd)) {
                String id = data.optString(PARAM_ID, null);
                if (id == null || id.length() == 0) {
                    throw new IllegalArgumentException("Need task id.");
                }
                task = taskMgr.getTasks().get(id);
                if (task == null) {
View Full Code Here

                }
                task.start(request.getResourceResolver().adaptTo(Session.class));

            // ----------------------------------------------------------------------------------------------< stop >---
            } else if ("stop".equals(cmd)) {
                String id = data.optString(PARAM_ID, null);
                if (id == null || id.length() == 0) {
                    throw new IllegalArgumentException("Need task id.");
                }
                task = taskMgr.getTasks().get(id);
                if (task == null) {
View Full Code Here

                }
                task.stop();

            // --------------------------------------------------------------------------------------------< remove >---
            } else if ("remove".equals(cmd)) {
                String id = data.optString(PARAM_ID, null);
                if (id == null || id.length() == 0) {
                    throw new IllegalArgumentException("Need task id.");
                }
                task = taskMgr.getTasks().get(id);
                if (task == null) {
View Full Code Here

        } catch (JSONException e) {
            log.error("Error while reading json: {}", e.toString());
            response.setStatus(500);
            return;
        }
        String cmd = data.optString(PARAM_CMD, "");
        RcpTask task = null;
        try {
            // --------------------------------------------------------------------------------------------< create >---
            if ("create".equals(cmd)) {
                String src = data.optString(PARAM_SRC, "");
View Full Code Here

        String cmd = data.optString(PARAM_CMD, "");
        RcpTask task = null;
        try {
            // --------------------------------------------------------------------------------------------< create >---
            if ("create".equals(cmd)) {
                String src = data.optString(PARAM_SRC, "");
                String dst = data.optString(PARAM_DST, "");
                String id = data.optString(PARAM_ID, null);
                RepositoryAddress address = new RepositoryAddress(src);
                task = taskMgr.addTask(address, dst, id);
View Full Code Here

        RcpTask task = null;
        try {
            // --------------------------------------------------------------------------------------------< create >---
            if ("create".equals(cmd)) {
                String src = data.optString(PARAM_SRC, "");
                String dst = data.optString(PARAM_DST, "");
                String id = data.optString(PARAM_ID, null);
                RepositoryAddress address = new RepositoryAddress(src);
                task = taskMgr.addTask(address, dst, id);

                // add additional data
View Full Code Here

        try {
            // --------------------------------------------------------------------------------------------< create >---
            if ("create".equals(cmd)) {
                String src = data.optString(PARAM_SRC, "");
                String dst = data.optString(PARAM_DST, "");
                String id = data.optString(PARAM_ID, null);
                RepositoryAddress address = new RepositoryAddress(src);
                task = taskMgr.addTask(address, dst, id);

                // add additional data
                if (data.has(PARAM_BATCHSIZE)) {
View Full Code Here

        final String data = request.getParameter("json");

        JSONObject json = new JSONObject(data);

        rootPath = json.optString("rootPath", "");
        template = json.optString("template", "");
        total = json.optInt("total", 0);
        bucketSize = json.optInt("bucketSize", DEFAULT_BUCKET_SIZE);
        saveThreshold = json.optInt("saveThreshold", DEFAULT_SAVE_THRESHOLD);
View Full Code Here

        final String data = request.getParameter("json");

        JSONObject json = new JSONObject(data);

        rootPath = json.optString("rootPath", "");
        template = json.optString("template", "");
        total = json.optInt("total", 0);
        bucketSize = json.optInt("bucketSize", DEFAULT_BUCKET_SIZE);
        saveThreshold = json.optInt("saveThreshold", DEFAULT_SAVE_THRESHOLD);

        properties = new HashMap<String, Object>();
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.