I have gone through the portal creation chapter , where the harness and sections that are being used in the portal rule are created in the Data-portal class.
For example if my class structure is as ORG-DIV-UNIT-DATA and ORG-DIV-UNIT-WORK, I thought that as a best practice we should for creating the rules in the ORG-DIV-UNIT-DATA , ie in the data class specific to application , but not in the Data-portal class.
Could you please clarify what is the best approach , in which class pega recommends to create the portal related rules.whether it is Data-portal or in the data class specific to application .
Portals reference a harness for content. If we are intending to use any of the shipped gadgets from Pega7, the harness that is referenced in the portal rule must be defined in Data-Portal class. Most of the newer gadgets are defined in @baseclass so we can save the harness in the application class layer as well.
Portal rule does not apply to any class. It is one of the few rules that do not apply to a specific class. Portals reference harnesses for content and when portal rule reference harness it also includes the class name where the harness is defined. Like Tara pointed in her post, the lesson recommends using Data-Poral if the customer portal requires using any of the sections used in CaseManager7 such as Recents, Reportbrowser, the navigation rule used for displaying the operator menu.
Another important point to consider, Data-Portal is the class used by Pega 7 for designing the default shipped portals such as Designer Studio, Case Manager and Case Worker. That being said, we can always define harness in the application class if that is what we would like to do. There is nothing wrong in it.
The recommendation to save Data-Portal is to help in reusing default sections instead of creating custom ones. If you want to use the application specific data class, you can also configure the class to use Data-Portal as the directed parent.