How to delete project from Front end of BCC

Deleting project from Front End of BCC

Note: This shall delete project along with project's associated process, assets, history.

To delete projects from front end of BCC, perform following steps.

1. Include the following jsp in custom BCC module's war.

File Name: delete-process.jsp

<%@ taglib uri="/dspTaglib" prefix="dsp" %>
<dsp:page>
<%@page import = "atg.epub.project.*" %>
<%@page import = "atg.dtm.*" %>
<%@page import = "atg.nucleus.*" %>
<%@page import = "javax.transaction.*" %>
<link href="style.css" type="text/css" rel="stylesheet"/>

<div style = "padding: 5px;">

<% boolean rollback = true;

TransactionManager tm=(TransactionManager)Nucleus.getGlobalNucleus().resolveName("/atg/dynamo/transaction/TransactionManager");
TransactionDemarcation td= new TransactionDemarcation();
        try {
            td.begin(tm);
            atg.deployment.server.SecurityManager.becomeTheSuperDood();
            ProcessHome processHome = ((ProcessHome) ProjectConstants.getPersistentHomes().getProcessHome());
            String processId = request.getParameter("process_id");
            if (processId == null) {
            out.println("TRYING HYPNOSIS TO GUESS PROCESS ID..... FAILED. Try explicitly specifying a process_id request parameter. ");
            return;
            }
            atg.epub.project.Process process =processHome.findById(processId);
            if (process == null) {
            out.println("wrong process_id parameter; not such process");
            return;
            }
            Project project = process.getProject();
            if (project == null) {
            process.delete();
            rollback = false;
            out.println("Process was found but there was no project associated with it. Process was deleted successfully.");
            return;
            }
            project.delete("publishing");
            out.println("Process with id " + processId + " was found and deleted successfully.");
            %>
            <br/> <input type = "button"
            onclick = "window.close()"
            value = "Cancel/Close"
            style = "font-size: 10px; background-color: #C3593C; color: white;"/> <% rollback = false;
        } catch (Throwable t) {
            t.printStackTrace(System.out);
            out.println(t);
        } finally {
            atg.deployment.server.SecurityManager.becomeNOTTheSuperDood();
        try {
        if (td != null) td.end(rollback);
        } catch (TransactionDemarcationException e) {
        e.printStackTrace();
        }
        }
%>
</div>
</dsp:page>


2. Identify the process id from DB using the following query.


select process_id from epub_process where display_name='name_of_project';



3. Hit the delete process URL, and pass the process id through request header.

<BCC_URL_Including_HTTP_PORT>/<context-root>/delete-process.jsp?process_id=<process_id>

ex: http://localhost:7005/mybcc/delete-process.jsp?process_id=prc162001




4. Following message confirms that the entire project is deleted.



Understang ATG Commerce Product Catalog

Catalog Elements

Catalogs- Catalog is a collection of repository items (categories, products, media, etc.) that provides the organizational framework for commerce site.
Properties of Catalog:
displayName: Name of catalog. It's required field.
rootCategories: Root categories of catalog.


Categories- Categories organize products into a hierarchy that provides a navigational framework for Websites. Categories can be parents to products or other categories.
Properties of Category:
displayName: Name of Category. It's required field.

childCategories: List of all categories that are children of this category.

childProducts: List of all products that are children of this category.

Products – A product is a navigational end-point in the catalog.
Properties of Product:
displayName: Name of Product. It's required field.
childSKUs: List of child SKUs of this product.


SKUs - A product is a navigational end-point in the catalog. However, customers do not actually purchase the product; they purchase a SKU (stock keeping unit). A product can have several different SKUs associated with it, representing varieties, sizes, and colors.
Properties of SKU:
displayName: Name of SKU. It's required field.



Example of Nested Categories                                               


Sample Catalog:

Block View of Catalog: