Defining the get preview URL service in the primary object definition of the business object
In order to enable in-context preview for additional business objects, you must define the get preview URL service in the primary object definition. When the store preview action is triggered by the user, the Management Center framework issues the get preview URL service to retrieve the appropriate URLs for the object that you are working on and populate the store preview dialog with the URL of the business object.
For a successful response to the service call, the service expects the returned information to be in the expected format. To ensure that the information is returned in the expected format, you must Create a JSP file to retrieve the URL information in the expected format.
Procedure
- In the Enterprise Explorer view, expand .
- Open the business object definition file for editing.
- In the
<PrimaryObjectDefinition>
section, add the Get Preview URL service:
where<GetPreviewURLService url="/cmc/pathName"> <ServiceParam name="uniqueId" propertyName="propertyId"/> </GetPreviewURLService>
- pathName
- Represents the action path that you defined in the spring-extension.xml configuration file.
- uniqueId
- Represents the name of the business object parameter that is passed to the controller JSP file.
- propertyId
- Represents the name of the business object property value to pass in as the parameter value.
For example, the following code snippet defines a
GetPreviewURLService
in a Recipe Collection object.<GetPreviewURLService url="/cmc/GetRecipeCollectionPageSeoUrl"> <ServiceParam name="recipeCollectionId" propertyName="recipeCollectionId"/> </GetPreviewURLService>
- Save and close the file.