Example 5: OBN with Designated
Relation
Show object-based navigation, including relation resolving with a designated relation, based on the com.sap.portal.unification.OBNExamples PAR.
Sample Details:
Description |
Clicking on author name opens TitlesIview representing all the titles of the author, which were published at the author’s current publisher. |
Operation name |
DragAndRelateRelationOp |
Source iView |
RelationOpAuthors_iView |
Target iView |
Titles_iView |
...
1. Create an operation with the name DragAndRelateRelationOp for the authors business object.
2. Attach the created operation to Titles_iView.
Operations and iViews may be attached to one another from either the Business Object Editor or the Object-Based Navigation Editor of a specific iView. In this case, however, since this iView does not appear in the Content Catalog, but is only accessible from the role of the user, the procedure is performed as follows, using the Object-Based Navigation Editor of the iView:
a. In the Content Catalog tree, go to Portal Content ® OBNExamIViews ® OBNExamRoles ® OBNExamImplRole.
b. From the context menu, choose Edit Object.
c. In the editor expand the OBNImplIViews workset.
d. Select Titles_iView and choose Edit at the bottom of the editor.
e. In the editor drop-down list choose Object-Based Navigation to open the OBN Editor for this iView.
f. In the Content Catalog, navigate to the desired operation as follows: Business Objects ® OBNTestSysAlias ® dbo ® authors ® DragAndRelateOp operation.
g. From the context menu of the operation, choose Add Operation to iView.
h. Save the iView changes.
3. Set the main object property of Titles_iView to OBNTestSysAlias.dbo.titles.
4. Create a relation for the DragAndRelateRelationOp operation of the Titles_iView as follows:
a. Select DragAndRelateRelationOp operation in the operations table and choose the Relation button in the buttom of the table.
b. Define the designated relation between OBNTestSysAlias.dbo.authors, which is the main object of the source iView, and OBNTestSysAlias.dbo.titles, which is the main object of the implementing iView. This relation overrides the default relation.
i. Set the Object-Alias Map to include the following objects:
OBNTestSysAlias.dbo.authors with Alias_1 alias
OBNTestSysAlias.dbo.titles with Alias_2 alias
OBNTestSysAlias.dbo. titleauthor with Alias_3 alias
OBNTestSysAlias.dbo.titles with Alias_4 alias
ii. Mark the objects with aliases Alias_1 and Alias_4 as representative objects.
iii. Write the following condition in the Relation Condition edit box:
Alias_1.au_id=Alias_3.au_id AND Alias_3.title_id= Alias_2.title_id AND Alias_2.pub_id= Alias_4.pub_id
To activate these steps at runtime:
...
1. Go to the OBNSrcIViews workset.
2. Choose RelationOpAuthors_iView.
3. Click on any cell button.
Titles_iView shows records relevant for the selected author.
If the author with the last name Green is chosen, then Titles_iView will show a list of ten titles, all of which were published by same publishers as were those of the author Green.
