Package org.drools.guvnor.server.jaxrs.jaxb

Examples of org.drools.guvnor.server.jaxrs.jaxb.Package


        return ret.toString();
    }   

    protected Package createTestPackage(String title) {
        Package p = new Package();
        PackageMetadata metadata = new PackageMetadata();
        metadata.setCreated(new Date(System.currentTimeMillis()));
        metadata.setUuid(UUID.randomUUID().toString());
        metadata.setLastContributor("awaterma");
        metadata.setLastModified(new Date(System.currentTimeMillis()));

        p.setMetadata(metadata);
        p.setCheckInComment("Check in comment for test package.");
        p.setTitle(title);
        p.setDescription("A simple test package with 0 assets.");
        return p;
    }
View Full Code Here


        metadata.setLastModified(p.getLastModified().getTime());
        metadata.setLastContributor(p.getLastContributor());
        metadata.setState((p.getState() != null) ? p.getState().getName() : "");
        metadata.setArchived(p.isArchived());
       
        Package ret = new Package();
        ret.setMetadata(metadata);
        ret.setVersion(p.getVersionNumber());
        ret.setTitle(p.getTitle());
        ret.setCheckInComment(p.getCheckinComment());
        ret.setDescription(p.getDescription());

        ret.setBinaryLink(uriInfo.getBaseUriBuilder()
                .path("/packages/{packageName}/binary")
                .build(p.getName()));
        ret.setSourceLink(uriInfo.getBaseUriBuilder()
                .path("/packages/{packageName}/source")
                .build(p.getName()));
        //ret.setSnapshot(p.getSnapshotName());
        ret.setVersion(p.getVersionNumber());
        Iterator<AssetItem> iter = p.getAssets();
        Set<URI> assets = new HashSet<URI>();
        while (iter.hasNext()) {
            AssetItem a = iter.next();
            Asset asset = toAsset(a, uriInfo);
            assets.add(asset.getRefLink());
        }

        ret.setAssets(assets);
        return ret;
    }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.jaxrs.jaxb.Package

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.