Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Comment


            int conHeight = 0;
            dimensions = new org.wso2.carbon.bpel.ui.bpel2svg.SVGDimension(coreWidth, coreHeight);
            coreDimensions = new org.wso2.carbon.bpel.ui.bpel2svg.SVGDimension(coreWidth, coreHeight);
            conditionalDimensions = new org.wso2.carbon.bpel.ui.bpel2svg.SVGDimension(conWidth, conHeight);

            SVGDimension subActivityDim = null;
            org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (activity instanceof FaultHandlerImpl || activity instanceof TerminationHandlerImpl || activity instanceof CompensationHandlerImpl || activity instanceof EventHandlerImpl) {
                    if (subActivityDim.getHeight() > conHeight) {
                        conHeight = subActivityDim.getHeight();
                    }
                    conWidth += subActivityDim.getWidth();
                } else {
                    if (subActivityDim.getWidth() > coreWidth) {
                        coreWidth = subActivityDim.getWidth();
                    }
                    coreHeight += subActivityDim.getHeight();
                }
            }

            coreHeight += getYSpacing() + getStartIconHeight() + getEndIconHeight();
            if (!isSimpleLayout()) {
View Full Code Here


   
    if (is == null) {
      fail("BPEL process not found");
    }
   
    SVGInterface svg=null;
   
    try {
      svg = BPEL2SVGUtil.generate(is);
     
      if (svg == null) {
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

    System.out.println("A resource added to" + resourcePath);

    registry.rateResource(resourcePath, 3);

    System.out.println("Resource rated with 3 stars!");
    Comment comment = new Comment();
    comment.setText("Wow! A comment out there");
    registry.addComment(resourcePath, comment);
    System.out.println("Comment added to resource");

    Resource getResource = registry.get("/abc");
    System.out.println("Resource retrived");
View Full Code Here

    public void testVersioningComments() throws RegistryException {
        assertEquals(StaticConfiguration.isVersioningComments(), false);
        Resource r = registry.newResource();
        registry.put("/testComments", r);
        Comment c1 = new Comment("comment1");
        registry.addComment("/testComments", c1);
        registry.createVersion("/testComments");

        Comment c2 = new Comment("comment2");
        registry.addComment("/testComments", c2);
        // to create the version
        registry.createVersion("/testComments");

        // retrieve versions
        String []versionPaths = registry.getVersions("/testComments");

        assertEquals(versionPaths.length, 2);

        // still there should be the comments
        registry.restoreVersion(versionPaths[1]);
        Comment[] cs = registry.getComments("/testComments");
        assertEquals(cs.length, 2);
        assertEquals(cs[1].getText(), "comment2");


        Resource c = registry.newCollection();
        registry.put("/testCommentsC", c);
        c1 = new Comment("comment1");
        registry.addComment("/testCommentsC", c1);
        registry.createVersion("/testCommentsC");

        c2 = new Comment("comment2");
        registry.addComment("/testCommentsC", c2);
        // to create the version
        registry.createVersion("/testCommentsC");

        // retrieve versions
View Full Code Here

                registry.getResourcePathsWithTag("test");
                Thread.yield();

                // comment the resource
                registry.addComment(rPath,
                        new Comment("this is a test resource. so it is ok to mess with this."));
                registry.getComments(rPath);
                Thread.yield();

                // rate the resource
                registry.rateResource(rPath, 3);
View Full Code Here

        } else if (content instanceof Resource[]) {
            Resource[] resources = (Resource[]) content;
            for (Resource resource : resources) {
                ((ResourceImpl) resource).setPath(getOutPath(resource.getPath()));
                if (resource instanceof Comment) {
                    Comment comment = (Comment) resource;
                    comment.setResourcePath(getOutPath(comment.getResourcePath()));
                }
            }
        }
    }
View Full Code Here

    public void testVersioningComments() throws RegistryException {
        assertEquals(StaticConfiguration.isVersioningComments(), true);
        Resource r = registry.newResource();
        registry.put("/testComments", r);
        Comment c1 = new Comment("comment1");
        registry.addComment("/testComments", c1);
        registry.createVersion("/testComments");

        Comment c2 = new Comment("comment2");
        registry.addComment("/testComments", c2);
        // to create the version
        registry.createVersion("/testComments");

        // retrieve versions
        String []versionPaths = registry.getVersions("/testComments");

        assertEquals(versionPaths.length, 2);

        // still there should be the comments
        registry.restoreVersion(versionPaths[1]);
        Comment[] cs = registry.getComments("/testComments");
        assertEquals(cs.length, 1);
        assertEquals(cs[0].getText(), "comment1");


        Resource c = registry.newCollection();
        registry.put("/testCommentsC", c);
        c1 = new Comment("comment1");
        registry.addComment("/testCommentsC", c1);
        registry.createVersion("/testCommentsC");

        c2 = new Comment("comment2");
        registry.addComment("/testCommentsC", c2);
        // to create the version
        registry.createVersion("/testCommentsC");

        // retrieve versions
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.Comment

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.