Tutorials > Content management > Create a content-managed resource > Make the resource content managed

< Previous | Next >


Create a resource container

Content managed resources can be broken into two parts. This first part is the resource container, which categorizes the different resources.


Procedure

  1. In the Enterprise Explorer view, navigate to Other Projects > WebSphereCommerceServerExtensionsLogic.

  2. Right-click src and select New > Class.

  3. In the Name field, type ExtendedCatalogDescriptionResourceContainer.

  4. In the Package field, type com.mycompany.catalog.content.resources

  5. In the SuperClass field, click the browse button and enter AbstractResourceContainerImpl in the superclass selection window.

  6. Click the Add button next to the Interface box.

  7. In the Implemented Interfaces Selection window, type ResourceContainer in the Choose interfaces field.

  8. In the Matching types box, select ResourceContainer and click OK.

  9. Ensure that Inherited Abstract Methods is not selected.

  10. Click Finish.

  11. Right after the class signature, create a constant to store the table name:

    public static final String EXTCATALOGDSC = "EXTCATALOGDSC";
    

  12. Implement the Constructor for the ExtendedCatalogDescriptionResourceContainer class:

    public ExtendedCatalogDescriptionResourceContainer () { super(); }
    

  13. ExtendedCatalogDescriptionResourceContainer will implement the Singleton design pattern so that only one instance of the object will exist in memory.

    1. Create a private, static singleton attribute:

      private static ResourceContainer singleton = new ExtendedCatalogDescriptionResourceContainer();
      

    2. Implement the two methods singleton() and setResourceContainer(ResourceContainer resourceContainer):

      public static ResourceContainer singleton() {
       return singleton;
      }
      protected void setResourceContainer(ResourceContainer resourceContainer) {
       singleton = resourceContainer;
      }
      
      

< Previous | Next >


+

Search Tips   |   Advanced Search