Examples of IDiagramStencilSet


Examples of org.jbpm.designer.web.stencilset.IDiagramStencilSet

        if(name.length() < 1) {
            name = defaultName;
        }

        IDiagramStencilSet stencilset = _pluginService.findStencilSet(req, name);
       
        if (stencilset == null) {
            throw new IllegalArgumentException("No stencilset by the name of " + name);
        }
        String applicationContext = ConfigurationProvider.getInstance().getDesignerContext().replaceAll("/", "");
        InputStream input = null;
        if (segments.length > 4) {
            //looking for a resource under the stencilset.
            String path = requestURI.substring(requestURI.indexOf(segments[2]) + segments[2].length() + 1);
            if(path.indexOf(applicationContext + "/stencilset/org.jbpm.designer.jBPMDesigner/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json") >= 0) {
                path = applicationContext + "/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json";
            }

            if(path.indexOf(applicationContext + "/stencilset/bpmn2.0jbpm/stencilset/org.jbpm.designer.jBPMDesigner/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json") >= 0) {
                path = applicationContext + "/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json";
            }

            if(path.indexOf(applicationContext + "/stencilset/" + applicationContext + "/stencilsets/bpmn2.0/") >= 0) {
                path = path.substring((applicationContext + "/stencilset/" + applicationContext + "/stencilsets/bpmn2.0/").length(), path.length());
            }
            if(path.indexOf("stencilset//" + applicationContext + "/stencilsets/bpmn2.0jbpm/") >= 0) {
                path = path.substring(("stencilset//" + applicationContext + "/stencilsets/bpmn2.0jbpm/").length(), path.length());
            }
            if(path.indexOf(applicationContext + "/stencilset/" + applicationContext + "/stencilsets/bpmn2.0jbpm/") >= 0) {
                path = path.substring((applicationContext + "/stencilset/" +applicationContext + "/stencilsets/bpmn2.0jbpm/").length(), path.length());
            }
            if(path.indexOf("bpmn2.0.json/") >= 0) {
                path = path.substring("bpmn2.0.json".length(), path.length());
            }
            if(path.indexOf("bpmn2.0jbpm.json/") >= 0) {
                path = path.substring("bpmn2.0jbpm.json".length(), path.length());
            }
            if(path.startsWith("/bpmn2.0jbpm/")) {
                path = path.substring("/bpmn2.0jbpm/".length(), path.length());
            }
            if(path.startsWith("stencilsets/bpmn2.0jbpm/")) {
                path = path.substring("stencilsets/bpmn2.0jbpm/".length(), path.length());
            }
            if(path.startsWith("2.0jbpm/bpmn2.0jbpm.json/")) {
                path = path.substring("2.0jbpm/bpmn2.0jbpm.json/".length(), path.length());
            }

            input = stencilset.getResourceContents(path);
            if(requestURI.endsWith(".svg")) {
                resp.setContentType("text/xml");
            } else if(requestURI.endsWith(".png")) {
                resp.setContentType("image/png");
            } else {
                //default to not setting
            }
        } else {
            input = stencilset.getContents();
            resp.setContentType("application/json");
        }
       
        try {
            byte[] buffer = new byte[4096];
View Full Code Here

Examples of org.wapama.web.stencilset.IDiagramStencilSet

        if (segments.length < 2) {
            throw new IllegalArgumentException("No name provided");
        }
        String name = segments[3];
       
        IDiagramStencilSet stencilset = _pluginService.findStencilSet(req, name);
        if (stencilset == null) {
            throw new IllegalArgumentException("No stencilset by the name of " + name);
        }
        InputStream input = null;
        if (segments.length > 4) { //looking for a resource under the stencilset.
            String path = requestURI.substring(requestURI.indexOf(segments[3]) + segments[3].length() + 1);
            input = stencilset.getResourceContents(path);
        } else {
            input = stencilset.getContents();
            resp.setContentType("application/json");
        }
       
        try {
            byte[] buffer = new byte[4096];
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.