Re: [atg_tech:6176] remove project from BCC ? steps -- Gordon Script

1,870 views
Skip to first unread message

Kadinamkulam

unread,
Aug 30, 2012, 3:09:16 PM8/30/12
to atg_...@googlegroups.com
Thanks Gordon, Really Useful !!!!

I committed after executing the procedure.

Invalidated the repository cache..
/dyn/admin/nucleus/atg/epub/PublishingRepository/

All worked and the project got removed from BCC .. :)

Warm Regards
KdM



On Thu, Aug 30, 2012 at 1:49 PM, Gordon Cooke <gor...@sparkred.com> wrote:
Did you commit the transaction after running the proc?

This should remove all the relevant data from the system.

Gordon Cooke
Spark::red - Managed ATG Hosting

Follow Spark::red for the latest news on eCommerce and ATG:





On Aug 30, 2012, at 11:07 AM, Kadinamkulam <kadina...@gmail.com> wrote:

Hi Gordon,

I executed this procedure and the data is removed from the db and restarted the CA instance.

But still I can see those projects in BCC.  is there any thing else we need to check.. like is there any lock or so ?


Warm Regards
KdM


On Thu, Aug 30, 2012 at 10:09 AM, Gordon Cooke <gor...@sparkred.com> wrote:
Not sure how others have done this but it is not as easy as that.  I use a stored procedure (for Oracle DB) that I set up in the PUB schema that looks something like the following.  I am sure there are more elegant ways of going about this but this works.


create or replace procedure clean_bcc_project( projid varchar2, procid varchar2)
is
begin
 for histid in(select history from epub_proc_history where process_id = procid) loop
   dbms_output.put_line(histid.history);
   delete from epub_proc_history where history = histid.history and process_id = procid;
   delete from epub_history where history_id = histid.history;
  end loop;
  
  for histidx in(select history from epub_pr_history where project_id = projid) loop
   dbms_output.put_line('History id is ' || histidx.history);
   delete from epub_pr_history where history = histidx.history and project_id = projid;
   delete from epub_history where history_id = histidx.history;
  end loop;
  
  for taskinfo in (select taskinfo_id from epub_proc_taskinfo where id = procid) loop
    dbms_output.put_line('Task info id is ' || taskinfo.taskinfo_id);
    delete from epub_proc_taskinfo where taskinfo_id = taskinfo.taskinfo_id and id = procid;
    delete from epub_taskinfo where taskinfo_id = taskinfo.taskinfo_id;
  end loop;
  delete from epub_project where project_id = projid;
  delete from epub_ind_workflow where process_id=procid;
  delete from epub_process where process_id = procid;
end;

--execute clean_bcc_project('prj381005','prc381005');

Gordon Cooke
Spark::red - Managed ATG Hosting

Follow Spark::red for the latest news on eCommerce and ATG:





On Aug 30, 2012, at 6:58 AM, Kadinamkulam <kadina...@gmail.com> wrote:

HI  Experts,

What are the steps to remove a project from the BCC.

I tried to Delete it from bcc. but since the topology was not configured it got hanged in the deployment phase.
I tried the below remove-item  RQL but still I can see the project in bcc like orphan.

Is there any order in doing this ?

Please help,


Warm Regards
Kdm


SELECT COUNT(*), WORKSPACE_ID FROM CCAVERSION.AVM_ASSET_LOCK GROUP BY WORKSPACE_ID

 

Gives now of projects in editable

 

 

COUNT(*)

WORKSPACE_ID

 
 
 

0

6

45785

1

4

47682

2

2

50564

3

7

52051

 

/atg/epub/PublishingRepository/

<print-item item-descriptor="project" id="prj19095"/>

<print-item item-descriptor="process" id="prc19095"/>

 

<delete-item item-descriptor="project" id="prj19095"/>

 

<remove-item item-descriptor="project" id="prj19095"/>

<remove-item item-descriptor="process" id="prc19095"/>

 
 

<print-item item-descriptor="process" id=" prc20002"/>



--
--
You received this message because you are subscribed to the Google Groups "ATG_Tech" group.
To post to this group, send email to atg_...@googlegroups.com
To unsubscribe from this group, send email to atg_tech-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/atg_tech?hl=en
 
 


--
--
You received this message because you are subscribed to the Google Groups "ATG_Tech" group.
To post to this group, send email to atg_...@googlegroups.com
To unsubscribe from this group, send email to atg_tech-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/atg_tech?hl=en
 
 


--
--
You received this message because you are subscribed to the Google Groups "ATG_Tech" group.
To post to this group, send email to atg_...@googlegroups.com
To unsubscribe from this group, send email to atg_tech-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/atg_tech?hl=en
 
 

--
--
You received this message because you are subscribed to the Google Groups "ATG_Tech" group.
To post to this group, send email to atg_...@googlegroups.com
To unsubscribe from this group, send email to atg_tech-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/atg_tech?hl=en
 
 

Joe Conaty

unread,
Aug 31, 2012, 10:06:24 PM8/31/12
to atg_...@googlegroups.com
I had to do this recently as well. In my case, I wanted to delete all projects/processes and re-populate the versioned data, but leave the deployment topology, BCC users, and base merchandising data in place. I first delete all the data in the versioned repositories, and then wipe out all the projects/processes. At that point, we are ready to repopulate all the versioned data from a production export. To delete all projects/processes:

ProjectHome projectHome = ProjectConstants.getPersistentHomes().getProjectHome();
ProcessHome processHome = ProjectConstants.getPersistentHomes().getProcessHome();

try {

    Collection<Project> allProjects = projectHome.findAllProjects(0, -1);
    if (allProjects == null || allProjects.size() == 0) {
        if (isLoggingInfo()) {
          logInfo("No projects to delete.");
        }
    } else {

       for (Project project : allProjects) {

           if (isLoggingInfo()) {
               logInfo("Deleting project: " + project.getDisplayName());
           }
           project.delete("publishing");

       }
   }

   Collection<Process> allProcesses = processHome.findAllProcesses(0, -1);

   if (allProcesses == null || allProcesses.size() == 0) {

       if (isLoggingInfo()) {
           logInfo("No processes to delete.");
       }

   } else {

       for (Process process : allProcesses) {
           if (isLoggingInfo()) {
               logInfo("Deleting project: " + process.getDisplayName());
           }
           process.delete();
       }

   }

   } catch (lots of exceptions .... Eclipse will tell you which ones) {
      logErrors
   }
}

You can delete only certain projects/processes by finding them by id, and just deleting those.

Joe Conaty
Commerce Architects - ATG Consulting

Thiyagarajan Muthusamy

unread,
Jul 26, 2013, 2:32:14 PM7/26/13
to atg_...@googlegroups.com
I read somewhere the below which related this.

"There is still a simple way to completely delete a project from BCC which is in unknown state:"
select process_id from epub_process where display_name='name of project';
Once you get the process_id, hit the below URL in any browser
[BCC URL]/atg/delete-process.jsp?process_id=process_id
It will not only delete the project and the process but also the assets associated with this project from all tables(primary and auxiliary)."
Reply all
Reply to author
Forward
0 new messages