Package org.candlepin.model

Examples of org.candlepin.model.Content


    @PUT
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{content_id}")
    public Content updateContent(@PathParam("content_id") String contentId,
            Content changes) {
        Content lookedUp  = contentCurator.find(contentId);
        if (lookedUp == null) {
            throw new NotFoundException(
                i18n.tr("Content with id {0} could not be found.", contentId));
        }

        // FIXME: needs arches handled as well?
        changes.setId(contentId);
        Content updated = contentCurator.createOrUpdate(changes);
        // require regeneration of entitlement certificates of affected consumers
        Set<String> affectedProducts =
            productAdapter.getProductsWithContent(setFrom(contentId));
        for (String productId : affectedProducts) {
            poolManager.regenerateCertificatesOf(productId, true);
View Full Code Here


    @DELETE
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{content_id}")
    public void remove(@PathParam("content_id") String cid) {
        Set<String> affectedProducts = productAdapter.getProductsWithContent(setFrom(cid));
        Content nuke = getContent(cid);
        contentCurator.delete(nuke);

        // Clean up any dangling environment content:
        for (EnvironmentContent ec : envContentCurator.lookupByContent(cid)) {
            envContentCurator.delete(ec);
View Full Code Here

            // The downside is if multiple products reference the same content, it
            // will be updated multiple times during the import.
            for (ProductContent content : importedProduct.getProductContent()) {
                // BZ 990113 error occurs because incoming content data has
                //  no value for Vendor. Will place one to avoid DB issues.
                Content c = content.getContent();
                if (StringUtils.isBlank(c.getVendor())) {
                    c.setVendor("unknown");
                }
                contentCurator.createOrUpdate(c);
            }

            curator.createOrUpdate(importedProduct);
View Full Code Here

    @Path("/{product_uuid}/batch_content")
    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

    @Path("/{product_uuid}/content/{content_id}")
    public Product addContent(@PathParam("product_uuid") String pid,
                              @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.Content

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.