Definition Label
Quinton Wall's Blog |
August 27, 2005 3:21 AM
|
Comments (0)
For any of you that have worked with Portal, one of the items that you have to get your head around is the differences between streaming mode and file or .portal mode. Streaming mode provides additional functionality such as entitlements and performance improvements but it also means that everything is now stored in the database and constrainted by referential integrity rules.
One such rule, which always seems to catch me, especially late at night when you are trying to get that one last piece of functionality in the build before tomorrow is the requirement for all portlets to have unique defintion labels and instance labels.
A best practice to set in place at the start of a portal project is some naming conventions when it comes to these unique names.
I try to follow the following rules:
.portlet files
pdefn_section_name
For example I may have a portlet called MyAccounts in the banking section. I may define a definition label such as pdef_banking_myaccounts.
Remember its always better to stick to lowercase to avoid any confusion.
Adding an instance to a .portal
The next step is simply dragging and dropping it onto your .portal file. By default this will create an instance label such as portal_defn_banking_myaccounts_1.
Where the instance number is automatically incremented by the Portal framework. I usually change this incremental number to a label that is more reflective
to where it placed in the portal. The convention I try to follow is _book(s)_page. So to continue the example from above my final instance label would be:
pdef_banking_myaccounts_accounts_main
Where possible I try to avoid abbreviations as it soon becomes just another thing that I have to keep track of if I want to remain consistent.
In the end there is nothing magic here but defining a convention throughout your project/organization/team may save you a lot of heartaches when you move into a streaming mode and you find that you cant create your desktop due to naming conflicts.
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
|