Creating and enabling new page layouts for new static pages

Creating and enabling new page layouts for new static pages 1 of 22 https://infocenters.hursley.ibm.com/websphere/commerce/v7/help/advanc... Creati...
0 downloads 0 Views 188KB Size
Creating and enabling new page layouts for new static pages

1 of 22

https://infocenters.hursley.ibm.com/websphere/commerce/v7/help/advanc...

Creating and enabling new page layouts for new static pages Contents 1. Creating and registering new page layout JSP files 2. Define a new page layout type 3. Registering your page layout in the database 4. Define the default layout for your page layout type 5. Creating static page object definitions in the Page Layout tool 6. Defining views for a new static page in the Page Layout tool 7. Updating the page layout object definitions 8. Defining search definitions for a new page layout type 9. Extending the Page Layout tool filter 10. Updating the Page Layout tool main definition

7.1.2013 16:04

Creating and enabling new page layouts for new static pages

2 of 22

https://infocenters.hursley.ibm.com/websphere/commerce/v7/help/advanc...

Creating and enabling new page layouts for new static pages You can customize the Page Layout tool to manage page layouts for new static pages that you created. Before you begin Complete the following tasks: Install WebSphere Commerce Version 7 Feature Pack 5 Enable starter store enhancements. Run the enablement scripts for the Feature Pack 5 store enhancements feature so that the Page Layout store feature is activated and ready for use. Optional: Migrate the Page Layout tool. If you are not using the Aurora starter store, you must migrate the Page Layout tool for your store before you can use the tool. About this task To manage various page layouts in Management Center, the page layout type must exist in the PAGELAYOUTTYPE table. By default, you can manage page layouts for catalog browsing pages and some static pages such as Return Policy, Help, and Contact Us. You must also add the new page layout type object in Management Center by modifying the Management Center programming framework. If you want to manage page layouts for new static pages, for example search landing pages, you must complete the following tasks: Procedure

7.1.2013 16:04

Creating and enabling new page layouts for new static pages

3 of 22

https://infocenters.hursley.ibm.com/websphere/commerce/v7/help/advanc...

1. Creating and registering new page layout JSP files To display a new layout in the storefront, you must create the page layout JSP file and register the file in the struts configuration file. You can create new page layouts for all page types in your store. Procedure 1. Create a page layout JSP file: a. In the Enterprise Explorer view, expand Stores > WebContent > storedir. b. Choose a folder or create a folder to contain the new JSP file. For example, you might want to create a LandingPages folder to contain your new page layout JSP file for landing pages. Or you can choose the ShoppingArea > CatalogSection > CatalogEntrySubsection folder to contain your new page layout JSP file for a product page. c. Right-click the folder where you want to create the JSP file. Select New > File. d. In the File name field, enter a name for the new JSP file, including the .jsp extension, and click Finish. The newly created file automatically opens. For example, in the File name field, enter CoffeeMakerSearchLandingPage.jsp and click Finish. CoffeeMakerSearchLandingPage.jsp represents the page layout for the coffee maker search landing page. e. Develop the code for your JSP file. You might want to continue with the rest of this task and register the file with WebSphere Commerce before you proceed with coding. By registering the file, you can develop the page in iterations, and see the results in the store. 2. Register your new JSP file in the Struts configuration file: Any new JSP files must be registered in the Struts configuration file to be recognized by WebSphere Commerce. Modifying the Struts configuration associates a new view with the actual JSP file.

7.1.2013 16:04

Creating and enabling new page layouts for new static pages

4 of 22

https://infocenters.hursley.ibm.com/websphere/commerce/v7/help/advanc...

a. Determine your storeId. If you do not know your storeId, run the following SQL query: select * from store; Find the storeId that corresponds to your store. b. In the Enterprise Explorer view, expand Stores > WebContent > Web-INF. c. Open the struts-config-ext.xml file. d. Click the Source tab. e. Associate a new view with the new JSP file. Add a entry in the global forward section, which is found at the beginning of the file. For example: This entry creates a view and maps the view to a JSP page. viewName Specify a new view name to associate with the new JSP file. For example, CoffeeMakerSearchLandingPageLayoutView. path The relative path to the JSP file, that you created in step 1, from the following location in your development environment: Stores > WebContent > Storedir. For example, /Layouts /CoffeeMakerSearchLandingPage.jsp. The name is the name of the view that you created, concatenated with / and your storeId. f. Add an entry in the action mappings section, which is found at the end of the file. Replace the value 10851 with your own storeId and replace CoffeeMakerSearchLandingPageLayoutView with the viewName that you created in step 2.e. Note: For extended sites, use the storeent_id of the Asset Store to which these JSP files are registered. Individual extended sites stores inherit these commands from the asset store because created stores do not have any JSP files of their own. 3. Repeat step 1 and step 2 to create and register more page layout JSP files for other pages that are defined in your store. For example, home page, department page, and category page. 4. Create access control policies for the new JSP files. By default, only site administrators can access new views. Create access control policies for each new JSP file to allow general access. a. Stop the WebSphere Commerce server if it is running. b. Navigate to WCDE_installdir/xml/policies/xml. c. Create an XML file for your access control policies under the directory WCDE_installdir\xml\policies\xml. For example, create a file called PageLayoutCommand.xml. d. Paste the following code into the XML file. a. Within the tag, create access control policies for the views that you created in the strutsconfig-ext.xml file using the following template. Replace viewName with the name of the view that you created in step 2.e:

7.1.2013 16:04

Creating and enabling new page layouts for new static pages

5 of 22

https://infocenters.hursley.ibm.com/websphere/commerce/v7/help/advanc...

For example: