Monday, 8 October 2012

Content Management in Websphere Commerce Server

Content Management
In order to enable content management functionality, you must run the WCDE_installdir\bin\enableContentManagement script. Running the script with no arguments displays the usage. Access the Workspace Administration tool once enabled.

·         Setting Up Preview Workspace


  
o    To enable workspace follow the steps mentioned below.
§  Log in to authoring server console with root user id and password.
§  Check the createInstance.properties file exist in /apps/IBM/WebSphere/CommerceServer70/instance/<instanceName>/properties
§  Check the configuration mentioned in createInstance.properties file appropriate for authoring server
§  Go to /apps/IBM/WebSphere/CommerceServer70/bin
§  Run ANT script

  
Install completed message will be displayed on the console window.

Verification steps for preview workspace
·         Connect to the database using DB user id/ password credentials provided during the setup.
·         Run the script “SELECT * FROM CMWSSCHEMA” on base schema
·         Verify number of workspace created is equal to number of columns in CMWSSCHEMA with read and write scheme column prefixed by the name mentioned in createInstance.properties file during the setup.

WebSphere Commerce database table: CMWSSCHEMA

The association of the underlying database schemas thatmakes up the workspace along with the assigning the workspace to a workspace identifier.



Working with Preview Workspace:

o    Create Workspace, task group and task

To create workspace, task group and task in the authoring server the WCS user id and password should have the Workspace manager role. Refer info center on workspace roles

Workspaces roles

The following workspaces roles are supported by WebSphere Commerce: Workspace Manager, Workspace Task Group Approver and Workspace Content Contributor.
The following table describes each role and the business model each role can work within.

Creating a workspace:

Workspaces provide data isolation. Each workspace has its own database schema to keep data
separate from other workspaces and the production-ready data.
Before creating a workspace, consider if you can use an existing workspace. Only create a new workspace if data isolation is important for the activities you are planning. If data isolation is not important for your planned activities, create a new task group in an existing workspace to contain the new activities.
Steps:
Ø  Open workspace administration tool on the authoring server using http://<authoringserverhost>:8000/workspaceadmin
Ø  Select Workspaces > Manage workspaces.
Ø  Click New workspace.
Ø  Specify whether this is a Single-use or Persistent workspace.
Ø  Use a single-use workspace when you only want to use the workspace for one group of activities. Once the workspace moves into the complete state, the resources used by the workspace, such as the database schema, are released.
Ø  Use a persistent workspace for activities with an ongoing or repeating nature. The workspace never moves into the complete state and the resources used by the workspace are never released.
Ø  For more information about single-use and persistent workspaces.
Ø  Optional: Select Emergency fix to have the workspace ignore the set workspace locking policy. Ignoring the workspaces locking policy allows you to changed managed assets that are locked.
Ø  Optional: Specify names and descriptions for the workspace:
§  Select the language for the name and description.
§  Type the new name or description for the selected language. If you do not specify a name for the task, the system generated workspace code will be displayed for users using the selected language.
§  Repeat above two steps for other languages, if required.
Ø  Click OK.
Creating task group:

A workspace contains one or more task groups. The Workspace Manager is responsible for creating and managing a workspace, and its properties, and the task groups and tasks within the workspace.
Before creating a task group, you must have a workspace created. Task groups are created in workspaces.
Steps:
Ø  Open workspace administration tool on the authoring server using http://<authoringserverhost>:8000/workspaceadmin
Ø  Select Workspaces > Manage workspaces.
Ø  On the Workspaces page, select the workspace to which the task group will belong.
Ø  Click New task group.
Ø  Select Recurring if you want a new identical task group to be created after this task group moves into complete state. Otherwise, select Single-use.
§  Do not select Recurring if you are creating a task group in a single-use workspace. Creating a recurring task group in a single-use workspace prevents the single-use workspace from completing.
Ø  Optional: Select Quick publish if you want the file and data changes in this task group to be published to production as soon as all tasks are marked complete and all approvals are satisfied.
§  Quick publish is not supported in WebSphere Commerce Developer.
Ø  Optional: In the Due date field, enter a day, month, and year for the task group to be completed. This field is only for your information. WebSphere Commerce does not perform any actions based on this date.
Ø  Optional: Add task group approvers. To add an approver, select an approver in the Available approvers list and click Add approvers.
Ø  Note: If a task group does not have any assigned approvers, it automatically commits when all tasks are completed.
Ø  Optional: Specify task group names and descriptions:
§  Select the language for the name and description.
§  Type the new name or description for the selected language. If you do not specify a name for the task group, the system generated task group code is displayed for users using the selected language.
§  Repeat above two steps for other languages, if required.
Ø  Click OK.


Creating task:

Tasks provide a separation of responsibility. Each task is an individual unit of work that contributes to the completion of an activity that the Workspace Manager assigns to Workspace Content Contributors.
Before creating a task, you must have a task group created. Tasks are created in task groups.
Steps:
Ø  Open workspace administration tool on the authoring server using http://<authoringserverhost>:8000/workspaceadmin
Ø  Select Workspaces > Manage workspaces.
Ø  On the Workspaces page, select the task group to which the task will belong.
Ø  Click New task.
Ø  Optional: In the Due date field, type a year, month, and day for the task to be completed. This field is only for your information. WebSphere Commerce does not perform any actions based on this date.
Ø  Select a Workspace Content Contributor in the Available Content Contributors list and click Add Content Contributor. You can add additional Workspace Content Contributors at a later time by changing the task.
Ø  Optional: Specify task names and descriptions:
§  Select the language for the name and description.
§  Type the new name or description for the selected language. If you do not specify a name for the task, the system generated task code will be displayed for users using the selected language.
§  Repeat above two steps for other languages, if required.
Ø  Click OK.

Activate task group:

Ø     Select task group and click on activate button
Work on assigned task:

§  Login to Management center with user id which has content contributor role using http://<authoringserverhost>:8000/lobtools
§  Click on TO DO folder in the management center explorer should show up the assigned task as shown in screenshot
§  Right click on the task and select “Work On” to change the status of task.
§  To work on content click on management center menu > marketing  in the management center
§  Select the project to work on.
§  Select the category to work by going to Management center menu.
§  To work on template management create new content by going to File > new > Content
§  Ensure proper name and type is provided for content.
§  Create new e-spot by going to File > new > e-Marketing spot
§  Assign content to the created e-spot with the help of “Find and Add” button
§   Click on “save and close” button
§  To preview the applied template go to File > Store preview
§  Enter the site url in the url text box
§  Verify the applied template is proper
§  If not proper change the content of e-spot to define another template.
§  Once applied template looks good, right click and select “Mark Complete” to change the status of task to complete.
Approve task in workspace:
Ø     Login to workspace admin tool with workspace manager credentials
Ø     Go to workspace>manage workspace and select current workspace
Ø     Check completed task with the task group and perform approve or reject on task group.
Ø     Workspace will turn to complete status once all task groups are approved.


Propagation from staging to production server:


Run the stagprop utility in the authoring server, to propagate data from staging server to production server
Ø     Login to authoring server console with admin user id and password
Ø     To propagate all changes from the staging server database to the production database.

§  Set Environment Variables:  WC_installdir\bin;Oracle_installdir\bin
§  Run the staging prop utility:
§  e.g. stagingprop.sh -scope _all_ -sourcedbstaging_database_name -destdbproduction_database_namedbtype oracle -sourcedb_user user -sourcedb_passwd password -destdb_user user -destdb_passwd password
Ø     Examine the log file to verify that the utility was successful.

Stagingprop utility:

The stagingprop utility propagates staged data and managed files from the production-ready data to the production server. It consolidates the changed data from the production-ready database, and then it propagates the necessary changed data into the production database if the connection is available.

               Verify Changes
Ø     Login to management center of production server.
Ø     Click on e-marketing spot folder in explorer view.
Ø     The e-spot created in authoring server should be reflected in production server management center.
Ø     Logout from management center
Ø     Launch your site in the new browser and it should reflect latest changes deployed from staging server.




Friday, 5 October 2012

Workspace Concept in Websphere Commerce Server


This specific post is a small step to understand the workspace concept in WCS.
Will give a clear picture how the content management works in WCS.
Will also give a understanding of data flow from authoring to production server.



What are workspaces?

A workspace allows content to be created in a workspace separated from production ready until the business approves such content changes
Only production-ready data on authoring server is published to production

Workspaces provide data isolation. Each workspace has its own database schema to keep data separate from other workspaces and the production-ready data.

Each workspace consists of three database schemas

– Base schema
• Contains the current content.
• The base schema contains data that is identical to the production environments.
  All workspaces draw from this common repository of data but none of their working
  changes are reflected here.

[Regular tables with regular information]

– Write schema
• Stores the content changes.
• It is in the individual write schemas that any uncommitted changes are stored,
thereby if there are two workspaces, workspace 1 changes are isolated from changes in workspace 2.

[Three extra field for each table to carry task group, task information]

– Read schema
Presents how the current and changed content looks like.
However, when users preview their changes, the write and base schemas are hidden behind the
read schema. The read schema first checks the write schema for the requested data and,
if it is not found there, then goes to the base schema.

[Actually there will be no table available in this schema all are views each view fetch data from both
 Baseschema and Write schema]

Within a workspace context, updates to a resource are directed to the write schema, whereas retrieving data for a resource is directed to the read schema.
                                           
Write Schema:











There will be additional three fields for each table to carry task related information.



Read Schema Example:

CREATE OR REPLACE FORCE VIEWread_schema.offerprice
                (offer_id, currency, price, compareprice, optcounter) AS

SELECT offer_id, currency, price, compareprice, optcounter
                FROM base_schema.offerprice
                   WHERE NOT EXISTS (SELECT 'match' FROM write_schema.offerprice
                                                                WHERE base_schema.offerprice.currency = write_schema.offerprice.currency
                                                                      ANDbase_schema.offerprice.offer_id = write_schema.offerprice.offer_id)

UNION ALL

  SELECT offer_id, currency, price, compareprice, optcounter
                FROM write_schema.offerprice
                     WHERE content_status<> 'D';

Content Management Data Model:


WebSphere Commerce database table: CMWSSCHEMA

The association of the underlying database schemas thatmakes up the workspace along with the assigning the workspace to a workspace identifier
.

Workspace Users:
A workspace is divided into task groups and tasks. Task groups serve as containers for tasks, where each task group can be committed independently of the other task groups. Tasks provide a separation of responsibility, where each task is an individual unit of work that contributes to the completion of an activity. A workspace content contributor chooses from a list of assigned tasks to work on. A workspace contains one or more task groups. The Workspace manager is responsible for creating and managing a workspace, and its properties, and the task groups and tasks within the workspace.


Different users:


select * from role;


User role and responsibility:


  


Data Management:

The data that is enabled for workspace approvals will have the model described before with base, read and write schemas. Unmanaged resources have only one table that is the same for base, read, and write schemas.

               Create a task group
               Optional: Enable quick publish
               Optional: Enable retry for quick publish
               Create tasks
               Activate your task group
               Optional: Schedule the commit of your task group
               Mark all of the tasks in the task group complete
               Approve your task group
               Publish production-ready data

Various tasks will be created under each task group and assigned to different contributors. The next step is for the content contributors to work on their tasks and mark them complete. A task group cannot be approved or committed until all tasks in the task group are complete. After the tasks are marked complete, approve your task group to commit data in the task group to production-ready data, either immediately or at a scheduled time set earlier. If the task group is marked as quick publish, changes are also published to the production server. If not, publish production-ready data from the authoring server to the production server to view changes on your site.


Note:There is one separate utility to transfer all updated data to production server.

Stagingprop utility:

The stagingprop utility propagates staged data and managed files from the production-ready data to the production server. It consolidates the changed data from the production-ready database, and then it propagates the necessary changed data into the production database if the connection is available.




Graphical Representation of Workspace Concept:

 
This information can be provided by individual contributor or can also come from various external systems. A business user can also play are role of contributor. Business user can provide or manipulate some information by using the dedicated tools.






 In this case we have introduced a security to allow only valid error free data.
Still something is lacking here, Business user cannot get the clear picture what is going to be delivered to the end user.
Cannot afford to perform undo, redo kind of activity on environment like production.

After doing the store preview if everything looks good the task group approver can approve the tasks and mark them completed. All the changes available in write schema will be committed to base schema and same changes will reflect on store front pages, so the end user can experience the changes.
If task approver is not satisfied with the store preview he can reject this task and nothing will be committed to base schema, so end user will continue to experience what he was experiencing.
A particular activity can be divided into various tasks.
For Example. Need to load a product data.

We can divide the same load activity into various tasks.
Say task group name is “Load Product Info”
There are few tasks under this task group like
                1.     Load Product Descriptions Task
                2.     Load Product Images Task
                3.     Load Product Price Task
                4.     Load Product Attribute Task
                5.     Product Publish Task

All these above tasks have been assigned to individual contributors.
Once all these above tasks are completed, the task group approver can validate it on store preview.
Depending on the outcome approver can approve or reject a specific task.