IBM WCS extending java classes - wcs

I am new to IBM WCS. I installed WCS 7.
I need to add Loyalty Points functionality to existing Madisons Store.
I created new table and an AccessBean. I able to insert and retrieve data from this new table.
I need to update the TOTALADJUSTMENT column of ORDERS and ORDERITEMS tables by adding Loyalty Points redeemed by user so that the total order value should be updated each time an item is added to or removed from the Shopping Cart. It should not disturb the existing discounts functionality.
Please let me know what are all the java classes and methods need to extend and override.

you need to :
update CMDREG to make OrderCalculateCmd point a customized version of PromotionEngineOrderCalculateCmdImpl , then you have to customize the later command and override the needed methods to meet your specification (this class is tricky , so better to understand how it works before starting your customization)
this is used by other OOTB promotion in commerce - so you need to be careful not break any of OOTB functionality
you might have a customized promotion developed and deployed to IBM CMC , so you have the ability to turn on/off point redemption by attaching it to your customized promotion

Another way is to look into the promotion engine and create a new custom promotion type that you could apply for your points.
http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.customizetools.doc/refs/rprcspromtype.htm
Using this type you could enable and disable or configure this promotion type with more flexibility from the Management Center.

Related

Drupal Commerce, How to control custom form fields in the product form?

I'm developing a custom module that has to send some information to a Web Service after a Product is inserted, updated or deleted.
In order to ensure that all the fields required by the Web Service exist, I have decided that the module should be the one in charge to put them in the Product form. I achieved It by extending the commerce_product_product_form function.
But now, I have noticed that the values for the fields that I have added are not saved, so I supposed that I have to define a custom table in the module to store the additional information.
I have taken the example from AutoSKU regarding how to save and load data for Product Types form. But, what I've not found is how to do, or what are the hooks for saving and loading data for the Product form.
So, my questions are:
Is It correct what I'm thinking about creating a new table for storing the additional information that I require or can It be implemented as part of the existent routines that the commerce module handles?
If the module has to save and load the data by using a custom table, What are the hooks that I should use in order to append the form data and save It to the module tables?
If I can store the information using the commerce routines, What should be the way and/or the hooks to define the custom form fieds?
Can you tell me if there is any example about how to achieve this?, I have seen some modules but, basically all of them just modified a behavior of the existent fields, they don't add new fields, as far as I could see. The modules that I have reviewed are:
commerce_custom_product
commerce_dressing_room
commerce_fancy_attributes
commerce_tickets
I would like to achieve this by using the commerce and Drupal best practices but I need to finish this module as soon as possible. So, in the meanwhile I'll be saving the data to a custom table and loading the additional information in the commerce_product_product_form hook and saving the information in the commerce_product_save hook.
For loading the data I have tried with the hook_commerce_product_load and hook_entity_load, but for some reason the call seems never happening (I'm sending some information to Watch Dog but It's never displayed), I also have tried by clearing the cache without any change.
Any help would be appreciate.
Thanks in advanced
Are these fields going to be created during normal use of the application (hourly/daily)? Or are they only being added at the beginning (initialization process)?
If the latter, you could create an install script similar to the ones found with many, many modules out there (module-name.install).
Have you considered adding the fields to the content type?

Try to use variants and table personalisation on SAPUI5 SmartTable

I want to use the variants to customise different filter and table variants on a SAP Fiori application, that use SAP Hana Cloud and Java backend.
As a background info:
I'm using a smartTable that is connected to the smartFilter by filterId property. On the table/filter I am able to access directly the data from the metadata by filing the entitySet / entityType property. I am using a real server not a mock server. In the table the properties regarding the personalization and variants are enabled (useTablePersonalisation="true", useVariantManagement="true"). I see that I have to specify the persistencyKey so that variants can display on the UI, but i don't know what value should i complete it with.
I read that smartTable and smartFilter are using SmartVariantManagement(a custom control of VarinatManagement) to accessed directly (without user interaction) SAPUI5 Flexibility Services regarding personalization data and management of the variant. But on SAP Help it says that:
Flexibility services are currently not available in SAP Hana Cloud Platform.
The services run on the ABAP front-end server and NetWeaver 7.31 SP11 or higher
Here is the link: http://help.sap.com/saphelp_hanaplatform/helpdata/en/a8/e55aa2f8bc4127923b20685a6d1621/frameset.htm
It is possible to use the variants and personalization?
How can I do it regardind my application specification?
Does anyone have an example application?
Thank you !
You can use them both at the same time.
For me the useTablePersonalisation="true" is working without any other changes. Rearding the useVariantManagement="true", I use showVariantManagement="true" also, and as you said persistencyKey="SmartFilter_Explored" is also needed to see Variant Management icon.
This is an example: https://sapui5.hana.ondemand.com/explored.html#/sample/sap.ui.comp.sample.smarttable/preview
For me I can not test the variant management functionality when running the app from webide as it is needed an existing user for you. So I can test it only, when running it on launchpad.
PersistencyKey identifies the storage area and saves/retrieves the variants currently used.
This page helps you with persistency key (under Page Variant section):
https://sapui5.hana.ondemand.com/#/topic/06a4c3ac1cf545a7b51864e7f3aa02da
I hope it helped.

How to create/insert product programmatically in Websphere Commerce 7 WCS7

I'm developing an ecommerce based on Websphere Commerce 7 WCS7. I need to import products from an external supplier, which is exposing a webservice. I've already implemented a Controller Command performing all the operation needed to extract the products from the remote service, and I've them avalaible as custom Java classes.
I'm a little bit confused about the approach I should follow in this case. I've defined the attributes needed in my scenario and used the dataload utility to import them in the DB. What should I do next? I expect to be able to "create" WCS product programmatically from my Controller Command but I don't know how to use the attribute I've defined in a programmatic insert.
Can someone point me on the right track on how to perform this kind of operation? I went through the documentation, but, given the fact I'm quite new of the WCS environment, I don't know how to proceed according to the current best practices.
It is possible to create a new catalog entry programmatically if you copy what is being done in the LOBTools. I have not done this myself though. I have always added new products via the data loads and when we did need to add from an external service I just output the information to a file and loaded along with our other products. The reason was due to keeping the catalog in sync with the product management system.
Have a look at the various DataBean classes in WCS, like: CatalogEntryDataBean.
See here for WCS data beans:Link
And here for "activation" of a DataBean:Link

In-Store pickup not fully available in ATG reference store?

I had a question on in-store pickup. I see that there is support for it in the CRS module (it has GeoLocatorService, GeoLocatorDroplet etc), but don't see any buttons or JSPs that display or let you use it out of the box. On the other hand, commerce service center has this functionality fully exposed, with in-store pickup buttons, popup widgets to search for stores and shopping carts showing store pickup line items etc. Looks like the web stores would need this functionality exclusively coded, which would involve creating JSPs and components as required.
Is there something I can copy over from CSC (commerce service center) that will enable store pickup in web module (store US or home US etc?) very quickly? Please let me know. Thanks for your response!
Not sure if you want to capture payment and collect from store , or reserve in store and pay when you pick up the item.
In both the cases your DOM (distributed Order Management) and WMS (warehouse management system) has important role to play. ATG can lookup the selected store inventory , both locally (location repository) or using realtime webservice interface to the system that manages your global inventory.
In all cases ATG will be able to capture the order, but this order has to be handled by DOM in such a way that its routed to local store for fulfillment. If by any chance this order is not available in local store, your DOM/ WMS system should be able to send order item to local store from warehouse or from another store.
Walmart has both the functionality available (click to collect and reserve and pay at store) , walmart has proprietary software DOM3 which eventually addresses these interfaces.
Please realize ATG is just your online order capture system, Click to Collect and any 'commerce anywhere' functionality must be offered by your DOM. if this is offered by your DOM , all you need to do is exchange messages with DOM to achieve this.
I am not sure if this answers your question, but its not recommended to over engineer ATG , and ATG should follow the heart beat of your DOM.
In Store Pickup - often called Click & Collect - has not been implemented as a feature in the CRS. It is also not in CSC either.
You will need to do quite a bit of customisation to support it.
The feature that is part of CRS is Store Locator. This allows you to find and view details of physical stores.
You can use this as a basis to build Click & Collect functionality.
Assuming that other back-end systems can handle it, and your business is set up to consider things like promotions, pricing etc. for a Click & Collect proposition...
Basically, you will need to implement a new Shipping Method, a New subtype of Hardgood Shipping Group that can use a Store Code instead of a Customer Address, as well as the UI to support choosing a store during checkout.
Depending on how sophisticated your multi channel requirements are, you may need to modify the Inventory Manager to accommodate knowing local stock in store as well as central stock.
Other shipping related entities may need to change to represent any new statuses such as Arrived in Store or Ready for Collection.
If you are using ATG Fulfilment, you may need to change messaging there to accommodate, say, conveying a store code instead of a delivery address to fulfillers and carriers.

Entity Framework, Dynamic Data and Versioning

I'm in the process of looking around at options for a back office tool. On the face of it the tool is simple CRUD so I was immediately attracted to Dynamic Data on top of Entity Framework (we're definitely a Microsoft shop!).
The problem is that future requirement is to support versioning. By this I mean :
User performs a series of updates to a series of entities
When they are happy they submit the changes
Changes persisted to the DB along with enough info to support a rollback
Elsewhere we've got handcrafted app that :
Includes a version id that is incremented as each new row inserted - i.e. we don't update we add a new row
A work item table ties together the changes using the version id along with the entity type (table)
So, the question is, how would I achieve a similar end result using entity framework and dynamic data?
If entity framework, etc isn't appropriate - what would you use (.Net)?
Thanks,
Alan
One solution would be to move the logic for the versioning to database triggers. This way you are able to use a standard Dynamic data on top of Entity Framework, and retrofit versioning by running a set of database scripts.
I would like to mention that in the new Dyanmic Data Preview 3 there is a new feature DomainService which supports Roles based security please see David Ebbo's Serssion from MIX09 here Microsoft ASP.NET 4.0 Data Access: Patterns for Success with Web Forms MIX09-T47F