Showing posts with label Beans. Show all posts
Showing posts with label Beans. Show all posts

Tuesday, 25 December 2012


Access Bean 
    
     WCS commands interact with access beans rather than directly with the entity beans. Access beans behave like Java beans, & hide all enterprise bean-specific programming interfaces from the client.

Types of Access beans are:
  1. Copy Helper  methods.
  2. Finder methods.
  3. EJB methods.

There are 2 types of  Copy Helper methods:
  1. refreshCopyHelper()
  2. commitCopyHelper()

  • refreshCopyHelper():  refresh copy helper is treated as "find for update” and it locks that particular row unless or until you are done with entire transaction. So you read something with refreshcopyHelper and you keep doing n no of things and when you are finally done then only these locks are released.

          refreshCopyHelper reads the database to update the access bean.

  • commitCopyHelper():   commitCopyHelper() takes the current state of the access bean and updates the database with it.

         Updates the database with the contents of the access bean.  


Thursday, 4 October 2012

Details about Data beans in WCS.


Data Bean :

A data bean is a Java bean that is used within a JSP page to provide dynamic content. A data bean normally provides a simple representation of a WebSphere Commerce entity bean. The data bean encapsulates properties that can be retrieved from or set within the entity bean. As such, the data bean simplifies the task of incorporating dynamic data into JSP pages.

A data bean is activated in one of the following ways:
  • by means of the wcbase:useBean tag (recommended)
  • by means of the following call:
com.ibm.commerce.beans.DataBeanManager.activate(data_bean, request, response)
where data_bean is the data bean to be activated, request is an HTTPServletRequest object, and response is an HTTPServletResponse object.

Types of data beans :

A data bean is a Java bean that is mainly used to provide dynamic data in JSP pages. There are two types of data beans:

  1.       Smart Data Bean.
  2.       Command Data Bean.
  • Smart data beans :
  • A smart data bean uses a lazy fetch method to retrieve its own data.
  • Smart data beans that require access to the database should extend from the access bean for the corresponding entity bean and implement the com.ibm.commerce.SmartDataBean interface.
  • For example, the OrderItemDataBean data bean extends the OrderItemAccessBean access bean, which corresponds to the OrderItem entity bean.
  • Some smart data beans do not require database access. At this case “When database access is not required, the smart data bean should extend the SmartDataBeanImpl class”. 
   Command data bean :
  • A command data bean relies on a command to retrieve its data and is a more lightweight data bean.
  • Command data beans can also extend from their corresponding access beans and implement the com.ibm.commerce.CommandDataBean interface.

Tuesday, 28 August 2012

Details about Beans Present in WCS..

A data bean is a java bean that is used within a jsp page to provide dynamic contect to the jsp page. A data bean normally provides a simple representaion of a WebSphere Commerce Entity bean.
There are 3 types of data beans:
1.Smart databean.
2.Command databean
3. Input data bean

  • Smart data bean: When a smart data bean is activated, the data bean manager invokes the data bean's populate method. Using the populate method, the data bean can retrieve all attributes, except attributes from associated objects.
  • Command data bean: A data bean implementing the CommandDataBean interface retrieves data from a data bean command. A data bean of this type is a lightweight object; it relies on a data bean command to populate its data. The data bean must implement the getCommandInterfaceName() method which returns the interface name of the data bean command.
  • Input data bean: A data bean implementing the InputDataBean interface retrieves data from the URL parameters or attributes set by the view.
Attributes defined in this interface can be used as primary key fields to fetch additional data. When a JSP page is invoked, the generated JSP servlet code populates all the attributes that match the URL parameters, and then activates the data bean by passing the data bean to the data bean manager. The data bean manager then invokes the data bean's setRequestProperties() method (as defined by the com.ibm.commerce.InputDataBean interface) to pass all the attributes set by the view.
Access Bean
WCS commands interact with access beans rather than directly with the entity beans. Access beans behave like Java beans, & hide all enterprize bean-specific programming interfaces from the client.
Types of Access beans are:
1. Copy Helper methods.
2. Finder methods.
3. EJB methods.
There are 2 types of Copy Helper methods:
1. refreshCopyHelper()
2. commitCopyHelper()
refreshCopyHelper(): refresh copy helper is treated as "find for update” and it locks that particular row unless or until you are done with entire transaction. So you read something with refreshcopyHelper and you keep doing n no of things and when you are finally done then only these locks are released.
refreshCopyHelper reads the database to update the access bean.
commitCopyHelper(): commitCopyHelper() takes the current state of the access bean and updates the database with it.
Updates the database with the contents of the access bean.

Entity Bean: The persistence layer within the WebSphere Commerce architecture is implemented according to the EJB component architecture.
A small number of stateless session beans are used to handle intensive database operations, such as performing a sum of all the rows in a particular column. One advantage of using entity beans is that developers can utilize the EJB tools provided in WebSphere Commerce Developer. These tools allow developers to define Java objects and their database table mappings. The tools automatically generate the required persisters for the entity beans. Persisters are Java objects that persist Java fields to the database and populate Java fields with data from the database.

Solr settings and full indexing (Attribute task update)

SOLR is mainly used for : Indexing Querying    SOLR is a product of apache and having the inbuilt server named jeety. Mainly the ...