Package org.candlepin.model

Examples of org.candlepin.model.ProductContent


    @Test
    public void testPrefixLogic() {
        Product p = new Product("JarJar", "Binks");
        Content c = new Content();
        c.setContentUrl("/some/path");
        ProductContent pc = new ProductContent(p, c, true);

        assertEquals("/this/is/some/path", util.createFullContentPath("/this/is", pc));
        assertEquals("/this/is/some/path", util.createFullContentPath("/this/is/", pc));
        assertEquals("/this/is/some/path", util.createFullContentPath("/this/is///", pc));
        c.setContentUrl("some/path");
View Full Code Here


    // Returns the Content object added
    private void addContentTo(Product p) {
        Content c = new Content("name", "100130", "label", "type",
            "vendor", "url", "gpgurl", "arch");
        c.setMetadataExpire(1000L);
        p.getProductContent().add(new ProductContent(p, c, true));
    }
View Full Code Here

    // Returns the Content object added without vendor
    private void addNoVendorContentTo(Product p) {
        Content c = new Content("name", "100130", "label", "type",
            "", "url", "gpgurl", "arch");
        c.setMetadataExpire(1000L);
        p.getProductContent().add(new ProductContent(p, c, true));
    }
View Full Code Here

    public Product addBatchContent(@PathParam("product_uuid") String pid,
                              Map<String, Boolean> contentMap) {
        Product product = prodAdapter.getProductById(pid);
        for (Entry<String, Boolean> entry : contentMap.entrySet()) {
            Content content = contentCurator.find(entry.getKey());
            ProductContent productContent = new ProductContent(product, content,
                entry.getValue());
            product.getProductContent().add(productContent);
        }
        return prodAdapter.getProductById((product.getId()));
    }
View Full Code Here

                              @PathParam("content_id") String contentId,
                              @QueryParam("enabled") Boolean enabled) {
        Product product = prodAdapter.getProductById(pid);
        Content content = contentCurator.find(contentId);

        ProductContent productContent = new ProductContent(product, content, enabled);
        product.getProductContent().add(productContent);
        return prodAdapter.getProductById((product.getId()));
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.ProductContent

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.