Accelerating the deployments in BCC

Clean up the Publishing DB using following scripts to accelerate deployments in BCC.




DELETE FROM das_deployment;
DELETE FROM das_depl_depldat;
DELETE FROM das_depl_options;
DELETE FROM das_depl_repmaps;
DELETE FROM das_depl_item_ref;
DELETE FROM das_depl_progress;
DELETE FROM das_thread_batch;
DELETE FROM das_deploy_data;
DELETE FROM das_dd_markers;
DELETE FROM das_deploy_mark;
DELETE FROM das_rep_mark;
DELETE FROM das_file_mark;
DELETE FROM das_dep_fail_info;
COMMIT;

Retaining Project to previous stage in BCC

Retaining Project to previous stage in BCC




a.       If BCC instance is killed while deployment to staging is in progress, use the following queries to get project back to "Author" State.

-- remove asset locks on the project. if any
delete from avm_asset_lock where workspace_id =
(select id from avm_devline where name =
(select workspace from epub_project where project_id = '<Your Project ID>'));

-- change states. Locked to false a
nd editable to true
--   locked to 0 and editable to 1

update epub_project
set locked=0
where project_id = '<Your Project ID>';

update epub_project
set editable=1
where project_id = '<Your Project ID>';

-- change states. Locked to false and editable to true
--   locked to 0 and editable to 1
update avm_workspace
set locked=0
where ws_id =
(select id from avm_devline where name =
(select workspace from epub_project where project_id = '<Your Project ID>'));

update avm_workspace
set editable=1
where ws_id =
(select id from avm_devline where name =
(select workspace from epub_project where project_id = '<Your Project ID>'));

-- finally change state to author which is 3 for all workflows
update epub_ind_workflow
set state=3
where process_id =
(select process_id from epub_process where project='<Your Project ID>');
commit;

 
Clear the following Cache
/atg/epub/PublishingRepository/
/atg/epub/version/VersionManagerRepository/

If BCC instance is killed while deployment to Production is in progress, use the following queries to get project back to previous state, so that you can redeploy.

--If project with workflow editCommerceAssets.wdl
--stuck while deploying to production

update epub_ind_workflow
set state=11
where process_id =
(select process_id from epub_process where project = '<Your Project ID>');
commit;

-- For projects which are created by auto import workflow

-- If project with /Commerce/autoImportAssets.wdl workflow
-- stuck while production

update epub_ind_workflow
set state=10
where process_id =
(select process_id from epub_process where project = '<Your Project ID>');
commit;


Clear Cache of following
/atg/epub/PublishingRepository/

 


Completely delete project from versioned DB

Completely delete project from versioned DB


Find out the Project Id using the following query.

select project_id from epub_project where display_name='<Your Project Name>';

Execute the following queries using the project id.

-- Removing locks of the project if any
delete from avm_asset_lock where workspace_id in
(select id from avm_devline where name in
(select workspace from epub_project where project_id = '<Your Project ID>'));

-- delete history of the project
delete from EPUB_PR_HISTORY where project_id in
(select project_id from epub_project where project_id = '<Your Project ID>');

-- delete the project
delete from epub_project where project_id = '<Your Project ID>';

-- delete history of the process
delete from EPUB_PROC_HISTORY where process_id in
(select process_id from epub_process where project = '<Your Project ID>');

-- delete task information of process
delete from EPUB_PROC_TASKINFO where id in
(select process_id from epub_process where project = '<Your Project ID>');

-- delete states of project (if any)
delete from EPUB_WORKFLOW_STRS where id in
(select ID from EPUB_IND_WORKFLOW where process_id in
(select process_id from epub_process where project = '<Your Project ID>'));

delete  from EPUB_IND_WORKFLOW where process_id in
(select process_id from epub_process where project = '<Your Project ID>');

-- finally delete the process
delete from epub_process where project = '<Your Project ID>';

commit;

Delete all Server Ids and Workflows in BCC

Delete all Server Ids and Workflows in BCC

To be done, when you are unable to create projects connecting to new publishing database OR when workflows not loading up.

--delete server ids


delete from DSI_SERVER_ID;
delete from DSS_SERVER_ID;
delete from EPUB_WF_SERVER_ID;
--delete workflows
delete from EPUB_PROC_TASKINFO;
delete from EPUB_WORKFLOW_STRS;
delete epub_workflow_info;
delete epub_coll_workflow;
delete from EPUB_IND_WORKFLOW;

Delete all Projects & Agents in BCC

Delete all Project & Agents in BCC


--Agents Clean UP
delete from EPUB_TR_AGENTS;
delete from EPUB_TARGET;
delete from EPUB_TL_TARGETS;
delete from EPUB_PRJ_TG_SNSHT;
delete from EPUB_PR_HISTORY;
delete from EPUB_AGENT_TRNPRT;
delete from EPUB_INCLUD_ASSET;
delete from EPUB_PRINC_ASSET;
delete from EPUB_AGENT;
delete from EPUB_PR_TG_STATUS;
--Project Clean UP
delete from EPUB_PROJECT;
delete from EPUB_PR_TG_AP_TS;
delete from EPUB_DEPLOYMENT;
delete from EPUB_PR_TG_DP_TS;
delete from EPUB_PROC_HISTORY;
delete from EPUB_PR_TG_DP_ID;
delete from EPUB_INT_PRJ_HIST;
delete from EPUB_PROC_TASKINFO;
delete from EPUB_WORKFLOW_STRS;
delete from EPUB_IND_WORKFLOW;
delete from EPUB_PROCESS;
delete from EPUB_PR_HISTORY;
delete from EPUB_PROC_HISTORY;
delete from avm_asset_lock;

Non-versioned Repositories in BCC

Non-versioned Repositories in BCC


This section explains about managing the non-versioned repositories (Orders, Inventory) in BCC. It includes series of steps, in which we will be updating the OOTB files as well as creating custom files too.
BCC HomePage

Inventory HomePage

Step 1: Create custom GenericActiviy in following path.
/config/my/activity/genericActivities.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE gsa-template
PUBLIC "-//Art Technology Group, Inc.//DTD General SQL Adapter//EN"
"http://www.atg.com/dtds/activitymanager/activitymanager_1.0.dtd">
<generic-activities>
<!-- Add a link named "Edit Inventory" -->
<activity>
<id>editInventory</id>
<resource-bundle>my.webui.WebAppResources</resource-bundle>
<display-name-resource>editInventory.displayName</display-name-resource>
<description-resource>editInventory.description</description-resource>
<destination-page>
<!-- This link takes the user to the AssetManager UI -->
<url>/AssetManager/assetManager.jsp</url>
<!-- The clear-context flag clears any active Content Administration project references out of the user's session. -->
<clear-context>true</clear-context>
<!-- The ACL is optional. This ACL limits the visibility of this link to people with any of the epub roles. -->
<acl>Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$role$epubUser:read</acl>
</destination-page>
</activity>
<!-- Add a link named "Edit Order" -->
<activity>
<id>editOrder</id>
<resource-bundle>my.webui.WebAppResources</resource-bundle>
<display-name-resource>editOrder.displayName</display-name-resource>
<description-resource>editOrder.description</description-resource>
<destination-page>
<!-- This link takes the user to the AssetManager UI -->
<url>/AssetManager/assetManager.jsp</url>
<!-- The clear-context flag clears any active Content Administration project references out of the user's session. -->
<clear-context>true</clear-context>
<!-- The ACL is optional. This ACL limits the visibility of this link to people with any of the epub roles. -->
<acl>Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$role$epubUser:read</acl>
</destination-page>
</activity>
</generic-activities>

Step 2: Define custom ActivitySource.
/config/my/activity/ActivitySource.properties

$class=atg.bizui.activity.PortalActivitySource

# The name and description for the entry that appears on the left side of the home page.
activitySourceResourceBundle=my.webui.WebAppResources
activitySourceNameResource=activitySourceName
activitySourceDescriptionResource=activitySourceDescription

# Generic activity definitions
genericActivityDefinitionFiles=/my/activity/genericActivities.xml
genericActivityFileModificationInterval=every 300 seconds

securityConfiguration=/atg/dynamo/security/SecurityConfiguration
XMLToolsFactory=/atg/dynamo/service/xml/XMLToolsFactory
scheduler=/atg/dynamo/service/Scheduler

#defaultCreateWorkflowURL=/atg/bcc/process
defaultCreateWorkflowURL=/atg/bcc/process?successURL=/AssetManager/assetManager.jsp

# Default URL for the main project page.
defaultProcessURL^=/atg/bizui/activity/PublishingActivitySource.defaultProcessURL

# Default URL for the workflow task page. All tasks use the AssetManager UI.
defaultTaskURL=/AssetManager/assetManager.jsp
fallbackPriority=2

Step 3: Register your ActivitySource to OOTB ActivityManager.
/config/atg/bizui/activity/ActivityManager.properties

activitySources+=/my/activity/ActivitySource


Step 4: Create ViewConfiguration for Inventory and Order.
/config/my/web/assetmanager/InventoryViewConfiguration.properties

$class=atg.web.assetmanager.configuration.FilterableBrowseListViewConfiguration

# The path to the repository from which to draw the items
repositoryPath=/atg/commerce/inventory/InventoryRepository

# The type of items to display
assetTypeName=inventory

# Types the user is allowed to create in this view
createableTypesList=inventory

# Number of items to show per page
itemsPerPage=50


/config/my/web/assetmanager/OrderViewConfiguration.properties

$class=atg.web.assetmanager.configuration.FilterableBrowseListViewConfiguration

# The path to the repository from which to draw the items
repositoryPath=/atg/commerce/order/OrderRepository

# The type of items to display
assetTypeName=order

# Types the user is allowed to create in this view
createableTypesList=order

# Number of items to show per page
itemsPerPage=50

Step 5: Configure the Tabs and Buttons to TaskConfiguration.
/config/atg/web/assetmanager/configuration/taskConfiguration.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE task-configuration
PUBLIC "-//Art Technology Group, Inc.//DTD Asset Manager Task Configuration//EN"
'http://www.atg.com/dtds/web/assetmanager/taskConfiguration_1.0.dtd'>
<task-configuration>
<!-- Define an activity for editing the inventory repository -->
<activity id="editInventory" inherit-from="assetManager.defaultEdit">
<activity-name>editInventory</activity-name>
<!-- Configure the buttons on the toolbar -->
<operations>
<operation>create</operation>
<operation>delete</operation>
</operations>
<!-- Define tabs for the left pane -->
<tabs>
<tab-order>
<tab-id>browse</tab-id>
<tab-id>search</tab-id>
</tab-order>
<initial-tab>browse</initial-tab>
<!-- Configure the Browse tab with a list view of inventory items -->
<tab id="browse">
<display-name-resource>assetManager.tab.browse</display-name-resource>
<page>/browse/browseTab.jsp</page>
<views>
<view-order>
<view-id>editInventory.inventory</view-id>
</view-order>
<initial-view>editInventory.inventory</initial-view>
<view id="editInventory.inventory">
<resource-bundle>my.webui.WebAppResources</resource-bundle>
<display-name-resource>editInventory.browseTab.view.inventory</display-name-resource>
<configuration>/my/web/assetmanager/InventoryViewConfiguration</configuration>
<page>/browse/list.jsp</page>
</view>
</views>
</tab>
<!-- Configure the Search tab to allow searching for inventory items -->
<tab id="search">
<display-name-resource>assetManager.tab.search</display-name-resource>
<page>/search/searchTab.jsp</page>
<views>
<initial-view>form</initial-view>
<view id="form">
<page>/search/searchForm.jsp</page>
<item-types>
<item-type>/atg/commerce/inventory/InventoryRepository:inventory</item-type>
</item-types>
</view>
<view id="results">
<page>/search/searchResults.jsp</page>
</view>
</views>
</tab>
</tabs>
</activity>

<!-- Define an activity for editing the order repository -->
<activity id="editOrder" inherit-from="assetManager.defaultEdit">
<activity-name>editOrder</activity-name>
<!-- Configure the buttons on the toolbar -->
<operations>
<operation>create</operation>
<operation>delete</operation>
</operations>
<!-- Define tabs for the left pane -->
<tabs>
<tab-order>
<tab-id>browse</tab-id>
<tab-id>search</tab-id>
</tab-order>
<initial-tab>browse</initial-tab>
<!-- Configure the Browse tab with a list view of inventory items -->
<tab id="browse">
<display-name-resource>assetManager.tab.browse</display-name-resource>
<page>/browse/browseTab.jsp</page>
<views>
<view-order>
<view-id>editOrder.order</view-id>
</view-order>
<initial-view>editOrder.order</initial-view>
<view id="editOrder.order">
<resource-bundle>my.webui.WebAppResources</resource-bundle>
<display-name-resource>editOrder.browseTab.view.order</display-name-resource>
<configuration>/my/web/assetmanager/OrderViewConfiguration</configuration>
<page>/browse/list.jsp</page>
</view>
</views>
</tab>
<!-- Configure the Search tab to allow searching for inventory items -->
<tab id="search">
<display-name-resource>assetManager.tab.search</display-name-resource>
<page>/search/searchTab.jsp</page>
<views>
<initial-view>form</initial-view>
<view id="form">
<page>/search/searchForm.jsp</page>
<item-types>
<item-type>/atg/commerce/order/OrderRepository:order</item-type>
</item-types>
</view>
<view id="results">
<page>/search/searchResults.jsp</page>
</view>
</views>
</tab>
</tabs>
</activity>
</task-configuration>

Step 6: Create services for Inventory and Order.
/config/my/remote/controlcenter/service/inventory.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE application-configuration
PUBLIC "-//Art Technology Group, Inc.//DTD BCC Application Configuration //EN"
"http://www.atg.com/dtds/application-configuration/application-configuration_1.0.dtd">
<applications>
<application id="editInventory">
<resource-bundle>my.webui.WebAppResources</resource-bundle>
<display-name-resource>editInventory.displayName</display-name-resource>
<destination-page>
<url>/AssetManager/assetManager.jsp</url>
<query-parameter key="project" value="-1" />
<query-parameter key="activity" value="editInventory" />
</destination-page>
<acl>Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$role$epubUser:read</acl>
<initializer>
</initializer>
<sort-priority>30</sort-priority>
<category>yourProjectExtras</category>
</application>
</applications>

config/my/remote/controlcenter/service/order.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE application-configuration
PUBLIC "-//Art Technology Group, Inc.//DTD BCC Application Configuration //EN"
"http://www.atg.com/dtds/application-configuration/application-configuration_1.0.dtd">
<applications>
<application id="editOrder">
<resource-bundle>my.webui.WebAppResources</resource-bundle>
<display-name-resource>editOrder.displayName</display-name-resource>
<destination-page>
<url>/AssetManager/assetManager.jsp</url>
<query-parameter key="project" value="-1" />
<query-parameter key="activity" value="editOrder" />
</destination-page>
<acl>Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$role$epubUser:read</acl>
<initializer>
</initializer>
<sort-priority>30</sort-priority>
<category>yourProjectExtras</category>
</application>
</applications>

Step 7: Register your custom services to ApplicationConfigurationManager.
/config/atg/remote/controlcenter/service/ApplicationConfigurationManager.properties

applicationFiles+=/my/remote/controlcenter/service/inventory.xml,\
                /my/remote/controlcenter/service/order.xml

Step 8: Add resource bundle.
/src/my/webui/WebAppResources.properties 

editInventory.displayName=Manage Inventory
editInventory.description=Manage Inventory
editInventory.browseTab.view.inventory=inventory
assetManager.tab.browse=Browse
assetManager.tab.search=Search
activitySourceName=Non-Versioned
activitySourceDescription=Non-Versioned
editOrder.browseTab.view.order=Order
editOrder.displayName=Manage Order
editOrder.description=Manage Order


Step 9: Override the componets of Order and Inventory and point datasource to Non_versioned DB (Production Core)

dataSource=/atg/dynamo/service/jdbc/JTDataSource_production