Friday, 10 February 2017 0 comments

Compress js files for minifying them


For compressing js files we need yuicompressor-2.4.7.jar file . Add below metioned target in your build file and then call it as needed.



<target name="compressingjsfile">
<echo message="Compressing Javascript files at location: <<<<Your js folder location>>>>" />
<java jar="lib/yuicompressor-2.4.7.jar" fork="true">
<arg value="yourjsfilename11111.js" /> <!-- input path for JS files -->
<arg value="yourjsfilename111222.js" /> <!-- input path for JS files -->
<!--<arg value="-v" /> --><!-- Turn on verbose -->
<arg value="-o" />
<arg value="'.js$:.js'" />
<arg value="yourjsfilename11111_min_out.js" /> <!-- output path for JS files -->
<arg value="yourjsfilename111222_min_out.js" /> <!-- output path for JS files -->

<classpath>
   <pathelement location="lib/yuicompressor-2.4.7.jar"/>
</classpath>
</java>
</target>

0 comments

Remove whitespaces from war

Add below target in your build script and execute it for removing whitespaces from jsp. change location of war file to yours before proceeding.


<target name="removespace" >
<echo message="Compressing jsp files for new line and carriage return at location: <<<<Your War location>>>>" />
<replaceregexp match="[\r\n]" replace=" " flags="g" byline="false">
<fileset dir="<<<<Your War location>>>>" 
includes="**/*.html,**/*.htm,**/*.jsp,**/*.jspf,**/*.tag"/>
</replaceregexp>   
<echo message="Compressing jsp files for more than 2 spaces at location: <<<<Your War location>>>>" />
<replaceregexp match="\s{2,}" replace=" " flags="g" byline="false">
<fileset dir="<<<<Your War location>>>>" 
  includes="**/*.html,**/*.htm,**/*.jsp,**/*.jspf,**/*.tag"/>
</replaceregexp>
</target>

0 comments

Modifying or deleting project state for blocked projects in BCC


Here are the commands for Deleting project from BCC


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 from EPUB_PR_HISTORY where project_id in(select project_id from epub_project where project_id = '<<your project id>>');

delete from epub_project where project_id = '<<your project id>>';

delete from EPUB_PROC_HISTORY where process_id in(select process_id from epub_process where project = '<<your project id>>');

delete from EPUB_PROC_TASKINFO where 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>>');

delete from epub_process where project = '<<your project id>>';

commit;




Here comes commands for Changing State of a project from blocked state


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>>'));

update epub_project set editable=1 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>>'));

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 epub_project set locked=0 where project_id = '<<your project id>>';

update epub_ind_workflow set state=3 where process_id =(select process_id from epub_process where project='<<your project id>>');

update epub_ind_workflow set state=11 where process_id =(select process_id from epub_process where project = '<<your project id>>');

commit;



For any changes done above, invalidatecaches of

/atg/epub/PublishingRepository/

/atg/epub/version/VersionManagerRepository/

2 comments

Create Custom Workflow in ATG BCC

•    in ACC of BCC server, go to Workflow >> Publishing
•    Open common folderthat containd default workflow in it. Using UX of acc clock on new and create a new work flow as per your requirement and save it
•    You can find default workflow at below path
•    <<ATG_ROOT>>\Publishing\base\config\atg\registry\data\epubworkflows\Common.
•    After creating the work flow you have to register its ID with BCC UI. For this you have to overwrite “workflowActivitie.xml” and “merchandising.xml”. If you are using ATG 11.2 you have to use “contentmgmt.xml” instead of “merchandising.xml”
•    workflowActive.xml will have a default behavior explained in <<ATG_ROOT>>\DCS-UI\Versioned\config\config.jar
•    Also you can get default behavior of merchandising.xml in <<ATG_ROOT >>\DCS-UI\config\config.jar
•    contentmgmt.xml is defined under <<ATG_ROOT >>\ContentMgmt-UI\config\config.jar

•    To overwrite above mentioned two xml files create folder structure in config dir if folder structure is not there and create files with names specified.
        1.    /atg/commerce/web/workflowActivities.xml

        2.    /atg/remote/controlcenter/service/merchandising.xml

                            OR
            /atg/remote/controlcenter/service/contentmgmt.xml
          
•    Sample for the two xmls look like below.

workflowActivities.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE workflow-activities
        PUBLIC "-//Art Technology Group, Inc.//DTD General SQL Adapter//EN"
        "http://www.atg.com/dtds/activitymanager/activitymanager_workflows_1.0.dtd">

<workflow-activities>
<activity>
    <id>merchandising.myWorkflowManageCommerceAssets</id>
    <workflow-name>/Common/myWorkflow.wdl</workflow-name>
    <acl>Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$accessRight$sitecatalogread:read;Profile$accessRight$sitecatalogfull:read;Profile$accessRight$mediaread:read;Profile$accessRight$mediafull:read;Profile$accessRight$storecontentread:read;Profile$accessRight$storecontentfull:read;Profile$accessRight$pricelistsread:read;Profile$accessRight$pricelistsfull:read;Profile$accessRight$storesread:read;Profile$accessRight$storesfull:read;Profile$accessRight$seotagsread:read;Profile$accessRight$seotagsfull:read;Profile$accessRight$promotionsread:read;Profile$accessRight$promotionsuser:read;Profile$accessRight$promotionsfull:read</acl>

    <resource-bundle>atg.remote.commerce.Resources</resource-bundle>
    <display-name-resource><<<<your key to displayname in resource bundle>>>>></display-name-resource>
    <description-resource><<<<your key to description in resource bundle>>>>></description-resource>
    
    <display-name-resource-2><<<<your key to displayname in resource bundle>>>>></display-name-resource-2>
    <description-resource-2><<<<your key to description in resource bundle>>>>></description-resource-2>
    <destination-page-2>
      <url>/ControlCenter/index.html</url>
      <activity-id>merchandising.browseCommerceAssets</activity-id>
      <clear-context>true</clear-context>
    </destination-page-2>
    
  </activity>


merchandising.xml


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE applications
        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="<<<<Same id as of activities.xml in my case it is merchandising.myWorkflowManageCommerceAssets>>>>">
    <resource-bundle>
      atg.remote.commerce.Resources
    </resource-bundle>
    <display-name-resource>
      <<your key to displayname>>
    </display-name-resource>
    <class-name>
      <<path of assetmanager of DividedApplicationInitializer depending on your req>>
    </class-name>
    <acl>
      Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$accessRight$sitecatalogread:read;Profile$accessRight$sitecatalogfull:read;Profile$accessRight$mediaread:read;Profile$accessRight$mediafull:read;Profile$accessRight$storecontentread:read;Profile$accessRight$storecontentfull:read;Profile$accessRight$storesread:read;Profile$accessRight$storesfull:read;Profile$accessRight$promotionsread:read;Profile$accessRight$promotionsuser:read;Profile$accessRight$promotionsfull:read
    </acl>
    <initializer>
      <</atg/remote/commerce/service/MerchandisingAssetManagerInitializer or /atg/remote/commerce/service/DividedApplicationInitializer >>
    </initializer>
    <configuration>
      /atg/remote/commerce/assetmanager/MerchandisingConfiguration
    </configuration>
    <property name="flexApplicationId" value="merchandising.flex.manageCommerceAssets"/>
    <sort-priority>
      10
    </sort-priority>
    <category>
      /Common/myWorkflow.wdl
    </category>
  </application>
</applications>


NOTE: contentmgmt.xml sample is identical to merchandising.xml.
Wednesday, 8 February 2017 2 comments

Could not initialize DescriptionBuilderService in BCC application



In BCC application when trying to access the promotion and coupon section, application throws error message in backend as “could not initialize class atg.ui.commerce.pricing.DescriptionBuilderService”. 

To resolve the issue please follow below step.

 Add server startup arguments
-Djava.awt.headless=true
1 comments

Cleaning BCC projects/agents and start BCC freshly




If want to delete all configured BCC project and agents configured in current environment and need to start the BCC from fresh, please follow the below mentioned steps.
  This mostly requires deleting data from the pub schema.
Shut down the BCC server and delete data from below mentioned tables in Pub schema. All of them are out of the box tables.
 Once data is deleted start the BCC server.
-    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;
-    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_PROJECT;
-    Delete from EPUB_PROC_TASKINFO;
-    Delete from EPUB_WORKFLOW_STRS;
-    Delete from EPUB_IND_WORKFLOW;
-    Delete from EPUB_PROCESS;
-    Delete from avm_asset_lock;
-    Delete from dsi_server_id;
-    Delete from dss_server_id;
-    Delete from epub_wf_server_id;
-    Delete from epub_coll_workflow;
-    Delete from epub_workflow_info;
-    Delete from epub_ind_workflow;

 
0 comments

Reset BCC configuration for removing the staging workflow



If environment is already configured with staging workflow and need to reconfigure BCC application without staging workflow then below steps need to follow.


Generating the Standalone EAR by removing staging layer from run assembler arguments. Please follow the steps given in previous page.

Updating the Database tables for removing the previous workflow references.

-  Delete data from below tables in publishing schemas.
-    Delete from epub_wf_server_id;
-    Delete from epub_coll_workflow;
-    Delete from epub_workflow_info;
-  Restart the BCC application and ensure the workflows are correctly created and are accessible.
-  Enable loggingDebug on /atg/epub/workflow/process/WorkflowProcessManager component if problem still persists.
 
;