Showing posts with label random credit card generator. Show all posts
Showing posts with label random credit card generator. Show all posts

Steps to confgure RAD SQL profiler in WCS 7

Download ‘SQL Profiler’ from the below link and follow the same to install SQL profiler in WCS6 and also learn about how to troubleshoot application with the help of SQL profiler.


Follow the below steps to configure SQL Profiler in WCS7 :

  1. Unzip the JdbcProfiler and copy the jdbcProfiler.jar and paste it at 'SDP\runtimes\base_v7\lib\ext'.
  2. Go to 'WC/META-INF/ibmconfig/cells/defaultCell/applications/defaultApp/deployments/defaultApp/resource.xml ' and change the implementationclassName of Cloudscape, JDBC and Oracle JDBC driver as below,        
    Apache Derby
    com.ibm.issw.jdbc.wrappers.WrappedDerbyDataSource
    IBM DB2 Type 4 JCC
    com.ibm.issw.jdbc.wrappers.WrappedDB2JCCDataSource
    Oracle
    com.ibm.issw.jdbc.wrappers.WrappedOracleDataSource
  3. Unzip 'updatesite' and now go to RAD workspace, go to Help à Software Updates…àAvailable Software and click on 'Add Site' and select Local, now point to the updatesite folder which we unzipped.  Now install it by selecting all default values. After this RAD will be restarted.
  4. Now clean and publish the workspace, and restart the server, verify SQL profiler is working, Open SQL profiler repositories and click on the green play button to connect it, Now we can see all the SQL for the events ( like productDisplay page ) done on the server.

Endeca: A Simple developer OverView



Endeca overview
UrlENEQuery : This class is to parse MDEX Engine pecific parameter from the browser request query string into engine query parameters.
MDEX Engine : This returns ENEQueryResults Object which contains the following information : Navigation, Record Search,Dimension Search and so on.It includes all the information required to build entire page.

The three core classes of Endeca API ;
HttpENEConnection - enable connection with MDEX Engine.
ENEQuery -  class build the query to be sent to the MDEX Engine.
ENEQueryResult -  class contain the result of MDEX Engine Query.

UrlEneQuery is the subclass of ENEQuery

XML over HTTP : Inbound XML/HTTP call to websphere commerce server.

WebSphere commerce server receives inbound XML over HTTP by using the program adapter .
This is the overall flow: taken from info center : 
  1. An external system sends an XML message to WebSphere Commerce over HTTP via a POST request. For example, http://host_name/webapp/wcs/stores/servlet/.
  2. The request is mapped to the Program Adapter.
  3. The Program Adapter passes the XML request to the appropriate message mapper.
  4. The message mapper converts the XML request into a CommandProperty object and passes it back to the Program Adapter.
  5. The Program Adapter prepares the command for execution and passes it to the WebController for execution.
  6. The Program Adapter generates the proper XML response and returns the XML response to the external system that made the request.
lets look into the configuration part for inbound message to work.
So,
Step1)   Configure Program Adapter : Enable program adapter for inbound message , go to wc-server.xml and find this tag ' HttpAdapter deviceFormatTypeId="-10000" and make enable="true", check 'deviceFormatType =XmlHttp' The configuration should similar to the below :

Step2)  configure message mapper :  go to the wc-server.xml and check for MessageMapper tag, this should look similar to the below :
if we are doing customization except then wcs default values, then we need to mention that in the configuration tag in the above mapping.actually we can configure the
ECInboundMessageDtdFiles - the dtd file which we need to validate the inbound xml
   by default this is empty, whatever we define in the xml (XML DOCTYPE 'abc_xyzs ' SYSTEM 'abc_xyzs.dtd ' )
   the inbound message mapper will look for the dtd in the default location of wcs i.e; inside messaging folder.(in wcs 7 - path is [toolkit location]\wc\xml\messaging\)
ECInboundMessageDtdPath - path of the inbound xml message dtd location, if we are defining different    path then default wcs, default is messaging.
ECSystemTemplateFile -  system template file, i.e; sys_template.xml. this is the default template file of wcs, actually this is the file where we are defining the variable which we need from the xml and the command which we are going to call when the xml arrives to wcs. we should leave this blank to take the default values, if we have to do customization to call our command for some specific xml we should then define the same template as sys_template.xml in user_template.xml, which is the ECUserTempateFile.
ECUserTempateFile - by default wcs is giving user_template file to configure the customization. we should leave this blank to take wcs the default template file i.e; user_template file.
isValidating -  if true will validate the xml with the dtd, else will not do validation.

Step 3 )  configure user_template.xml file based on the result.xml


      
Step 4 ) Now you have defined the command, so create the command an get the xpath values as request properties in the command and do you work , and return the xml to the jsp or create the xml in the jsp. to check how the jsp should be configured, please have a look into Device Format Algorithm to put the correct deviceId to hte jsp.
 NOTE -- make sure the jsp has the first line as <?xml version="1.0" encoding="utf-8"?>, so that it  should be a valid xml.

Step 5) Obviously follow the steps to create the controller command and the view from wcs info center and don't forget struts change,CMDREG entry and ACPolicy.so after the command execution the control should go the jsp

Now final you need to do unit test the implementation in local, so for this we can use HttpURLConnection or do ajax xhr post the request and check request and response in developer tools in IE or Chrome or firebug in firefox.

below is simple template :

 public static String excutePost(String targetURL, String urlParameters)
  {
    URL url;
    HttpURLConnection connection = null;  
    try {
      //Create connection
      url = new URL(targetURL);
      connection = (HttpURLConnection)url.openConnection();
     //------//
      set connection properties here 
     //------//
      //Send request
      DataOutputStream wr = new DataOutputStream (connection.getOutputStream ());
      wr.writeBytes (urlParameters);
      wr.flush ();
      wr.close ();

      //Get Response	
      InputStream is = connection.getInputStream();
      BufferedReader rd = new BufferedReader(new InputStreamReader(is));
      String line;
      StringBuffer response = new StringBuffer(); 
      while((line = rd.readLine()) != null) {
        response.append(line);
        response.append('\r');
      }
      rd.close();
      return response.toString();
    } catch (Exception e) {
       e.printStackTrace();
      return null;
    } finally {
       if(connection != null) {
        connection.disconnect(); 
      }
    }
  }   

WCS Interview Question

Q1 ) what is the difference between the controller command and task command.
        ANS : Generally controller command is the main command which we used to call from the JSP to process the request, But task command is used to perform some specific task like for inventory check, price check, these are handled through task commands, so task command are command which perform specific task for controller command. DIFFERENCE - By the above statement we can visualize that Controller command is required to be configure in the struts file, but task command is not required to be configured in struts, rest everything is same in both.

Q2) What is ObjectNotFoundException and FinderException ?
        ANS : ObjectNotFoundException is the subclass of FinderExcepton, So when the AccessBean finder method  return empty row, we get ObjectNotFoundException, but as generally we throw FinderException in EJB, so ObjectNotFoundException is catched in FinderException and thrown.

Q3) Difference Between Products and Items?
          ANS :  click here

Q4) Difference between different types of DataBean?
Q5) What is EJB copyHelper?
Q6) General difference between B2B and B2C shopping flow?
Q7) General difference between B2B and B2C shopping flow in mobile?
Q8) important jsp tags in WCS.
Q9) How can we create a site for multilingual sites?
Q9) Difference between well formed and well managed xmls?
Q10) Access Control Policy Tables and their relation.
Q11) How commerce is picking up different struts file from the project?
Q12) Is it mandatory to mention the struts file in web.xml?
Q13) What is reload interval? where do we configure reload interval?
        ANS : WC_eardir\Stores.war\WEB-INF\ibm-web-ext.xml -- change reload-interval
                   reload interval is generally used at the time when we are doing caching. if we make the relaod-interval to 10 then  the jsp  compilation interval will be 10 sec.

Difference Between Product and Items

In Simple Words 

Products : Product is a group of items which exhibit same attributes. we can say Shirt is a products, but a shirt of red color of size 44 is a item. So it is clear in this example that there are two attributes size and color which belong to this item. And we can also say , that items belong to a particular product exhibit the same set of attributes.

Items : As Info center says - An item is a tangible unit of merchandise that has a specific name, part number,size and price. For example, a 44 size shirt with red color is an item for the above item.

Actually it is not required to associate Item with Products, In Commerce we do so to maintain a consistent view, by doing this we are able to easily manage the items through Product Management Tool in WebSphere commerce server.

So It is clear now that Product is not a physical entity which we can purchase, but it is Item which we potentially purchase and add to cart.

The relationship between Product and Item is modeled in CATENTREL table.
______________________________________________________________

Actually we are following a generic navigation technique in the site
[ROOT CATEGORY]  --->[PARENT CATGEORY] ---> [CHILD CATEGORY] ---> [PRODUCT] ---> [ITEMS]

Below are some of the important tables through which we can get the details of the item which we are going to purchase:

CATENTREL = has the relationship on the parent catentry[PRODUCTS] and child catentry[Items].

CATGPENREL = has the information on the target catalog entry with the catalog and category.i.e;
the item belong to which category and catalog.

CATGRPREL = has the information on the relationship between the CATEGORY or CATGROUP, like it says which is parent and which is child.

CATTOGRP = has the information on relationship of CATALOG_ID and ROOT CATGROUP [category]
NOTE: Categoy and catgroup are synonyms in commerce

STORECAT = has relationship on store with catalog and also says that whether the catalog which is referenced to the stores is master catalog or not.

look into these three data models in info center for a better understanding:
catalog data model
catalog group data model
catalog entry data model

What are the Promotion Tables used when we create a new Promotion.

  • Promotion can be created through commerce accelerator as well as CMC. 
  • But there are some more functionality given in CMC then commerce accelerator.
  • Accelerator doesn't show the promotion created by CMC.
Promotion is divided into three groups
     CatalogEntry level  - Promotion which affects the catalog entry.
     Order Level - Promotion which affects the Order.
     Shipping level - Promotion which affects the Shipping.

Generally, promotion can be applied automatically or we have to give some promotion code to get it applied to the order or orderitem. We are achieving the same by choosing the redemption method in CMC.If the redemption method is qualifying purchase then this will be applied automatic if the user met the purchase condition and if the redemption method is require promotion code, then to get the promotion user need to provide the promotion code.

Lets see promotion code,we can define whether the promotion is unique or it can applied multiple times.Unique Promotion code is targeted for specific shopper and public promotion is reusable and can be applied to all shopper, if they enter the promotion code.

After creating the Promotion in CMC Promotion loader will insert the data into the below tables:
PX_PROMOTION
CATENTCALCD
CALCODE
CLCDPROMO – it records the relationship of all existing promotion with the calcode_id CALCODE.DISPLAYLEVEL - Display level is 0 for promotion target to orderitems and 1 for promotion target for entire order.

In PX_PROMOTION, XMLPARAM column has xml value of the promotion which we defined through accelerator or CMC.

Promotion OOB command which  gives the promotion available for a product by passing the catentry_id is
CalculationCodeListDataBean  -- Promotion available for a catentry_id
PromotionalPriceDataBean -- To get the promotional price
JSP code snippet: Promotions display-- This snippet is to display the promotion on the jsp.

To enable the trace related to promotion logs use the below
WC_ORDER, WC_CALCULATION, WC_MARKETING and WC_MERCHANDISING 

Shipment tables in WCS,

In WCS when we want to integrate shipment with third party,this is the way the tables should be filled up.

JURST --> JURSTGROUP --> JURSGRPREL --> CALCODE --> CALRULE --> SHPJCRULE --> CALSCALE --> CRULESCALE --> CALRANGE --> CALRLOOKUP.

----------