This chapter provides an overview of PortalRegistry classes and discusses how to:
Use the PortalRegistry API
Use security
Work with ValidFrom and ValidTo
Do error handling
Understand the life-cycle of a PortalRegistry object
View the PortalRegistry class hierarchy
Use content references
Understand naming conventions
Delete content considerations
Save content considerations
Declare a PortalRegistry object
Understand the scope of a PortalRegistry object
Use PortalRegistry (reference section)
Understand PortalRegistry classes examples
See Also
Understanding Portal Technology
The portal registry is a tree structure in which content for a portal is organized, classified, and registered. The PortalRegistry classes (API) are used to update the portal registry. The Portal Administration pages provide a GUI access to the PortalRegistry API. You can also access them using a PeopleCode program you write yourself. How you access the portal registry depends on the type of updates required. Your organization will likely use both methods of updating the portal registry. This chapter focuses on accessing the PortalRegistry classes using PeopleCode.
A portal is a website that helps you navigate to other web-based applications and content. The PeopleSoft Portal is a business portal. It is similar to general purpose portals, except that its main purpose is to help end-users be more effective in accessing information to perform their jobs.
Each PeopleSoft Portal is defined by one PeopleSoft portal registry. The PeopleSoft portal registry consists of a number of system tables and associated data in a PeopleSoft database. The portal registry must reside within one PeopleSoft database. There can be more than one portal registry in a PeopleSoft database, but only one portal registry is associated with a PeopleSoft Portal.
The portal registry consists of the following primary parts:
Folders
Content references
Nodes
Folders and content references make up the majority of the portal registry, and provide a hierarchical tree structure to describe various content that is registered as part of a PeopleSoft portal.
Nodes provide a logical name to a specific webserver and database, so content can be registered independent of specific webservers. It is used when the portal servlet attempts to retrieve content—both internal PeopleSoft content as well as external content—and to assemble pages.
The primary function of the portal is to take a target URL (generally a URL for a PeopleSoft component) that comes in from a user's browser, and assemble a page with that content and any other content. The layout and what content to assemble on the page is defined by the node template, which is composed of HTML. The portal attempts to find the content reference associated (that is, registered) with the target URL to get the template, or uses a series of default templates if it cannot get the template from a content reference.
Folders are how a hierarchical structure is created within a portal registry. Each folder has a parent, except the root folder, which is the top-level folder in a portal registry. Each folder can also contain child folders and content references. Folders are roughly analogous to directories within a file system. A folder can be further defined by a number of attributes (description, security, when it expires, and so on) that are useful within the portal environment.
See Also
A content reference is simply a reference to a URL. After you create an entry for a content reference in the portal registry, it's considered registered. A content reference can be further defined by a number of attributes (description, security, when it expires, and so on) that are useful within the portal environment.
There are a number of distinct types of content references that can be broken down into the following broad categories:
Target
Template
Component
A target type of content reference describes a registered URL that a user might reference. Typically, these would be a PeopleSoft Pure Internet Architecture component, such as a page in a transaction. When a user references a URL, the URL is looked up in the registry to find the target content reference.
A template type of content reference describes what, if any, other content to put on the page, and where to place that content. The portal attempts to find a template for every URL that is requested.
A component type of content reference describes a component that is typically placed on a target page or homepage.
See Also
When a content reference is created to register some content (that is, a URL) the specific URI (that is, the scheme, webserver, and so on) can be specified in the content reference. However, this has the drawback that every time the URI for a content reference changes (the webserver name changes, and so on), the content reference must be changed. Nodes are a way to create a logical name for a specific webserver, scheme, and so on. When the content reference is created you can specify a node name.
For example, suppose the name of a webserver changed. If you don't use nodes, you must check all your content references and change them accordingly. If you use nodes, you have to change only the webserver name in one place, and all the content references that use that node now automatically reference the correct webserver.
Nodes can be optional for content where the specified URL is already a complete URL, such as for external content. Nodes can be categorized as:
default local
local
non-local (remote)
See Also
The same security mechanism is used for folders, content references, content reference links, tab definitions, pagelets, and user homepages. All of these items can be marked as public, owner accessible, or can have explicit PeopleSoft permission values set, including cascading the permissions to its child objects (that is, the child objects have the same permissions as the parent objects, when applicable.)
When marked as public, the item is accessible by any user. Public access cannot be cascaded, that is, passed down, to child objects.
When marked as owner accessible, an item is accessible only by the same user that created that item. Owner accessible cannot be cascaded, that is, passed down, to child objects.
Items can be marked as accessible by PeopleSoft permissions. This means that if a user is a member of a role, and the role contains the permission list that the item is also associated with, the user has access to that item. Additionally, when applied to folder permissions the permission can be cascaded. This means that any child of that folder, including a content reference, automatically has that permission added to its permission list.
Role-based security can applied to the portal objects (folders, content references and content reference links) using the RolePermissions collection.
Note. You can only use role-based security for content references, folders, and content reference links that are not components or iScripts.
You can specify which roles are allowed to access the objects. This works similarly to permission lists. If a user has a specified role, authorization is granted.
A role collection is the same as the PermissionValue collection, though there are additional properties on PermissionValue.
Folders, content references, content reference links, PageletCategory objects, and Pagelets can have any number of attributes added to them. Attributes are simply name/value pairs. These name/value pairs are defined and used by many portal-aware applications, such as the search engine, navigational display, and so on.
See Using Attributes.
Using the PortalRegistry, you can also add and customize other items in your portal, such as tabs, homepages, and favorites.
The TabDefinition is a homepage tab that has been defined to the portal. It is what an administrator creates when they want to define a new homepage tab. The TabDefinition is based on content references.
The User Homepage is a personalized homepage for a user. It contains all the tabs and pagelets the user has selected for their homepage. The User Homepage is based on folders.
A Favorite represents a content reference that the user wants to keep a shortcut to. It contains the name of the content reference, and the label the user wants displayed for this favorite.
A Pagelets is an area on a page that contains content, and the template used to specify the style for that content. Pagelets are a type of content reference.
The PortalRegistry API provides the entry point to a specific portal registry. Common administrative tasks include adding, deleting, and renaming the registry objects (that is, folders, content references, tabs, and so on.) Additionally, there are many properties associated with every registry object, and all of these properties can be accessed and modified.
You can use the PortalRegistry API in batch mode to make many changes to a portal at once. For example, suppose something changed in your security system. You could write your own PeopleCode program, using the PortalRegistry classes, in an Application Engine program and change the access for all your users at once.
You can also use the PortalRegistry API to exchange data with an external system. For example, suppose an external merchant had an area on your company's portal, and the information there must be updated. One way to do this is for the merchant to use an Application Message to send the data to your system, then a subscription program would update the portal using the PortalRegistry API.
Each PortalRegistry object represents one specific PortalRegistry in a system. An empty PortalRegistry object is initially gotten from the PeopleSoft Session object. You can then open an existing PortalRegistry to view or change existing content, create a new PortalRegistry, or delete an existing PortalRegistry.
The PermissionValue object associated with a folder, content reference, and so on, as well as specific properties on the object, work together to form the security for an object. In this section, we discuss how to:
Use object properties.
Access objects.
The properties that set permissions for an object are:
AuthorAccess
PublicAccess
The AuthorAccess property determines whether the author of the object has access to the object.
The PublicAccess property determines whether the object is generally accessible or not. If this property is set to True, all users have access to the object.
These properties apply only to an object. They cannot be cascaded, that is, passed down to child objects.
The other object property used with security, the Authorized property, indicates whether a user is authorized to access an object. The value of this property depends on whether the user has access.
When you get a folder, content reference, content reference link, PageletCategory or Pagelet collection, only the items that the end-user is authorized to access are in the collection.
An object is contained in a collection is based on the following algorithm.
If the object is marked as PublicAccess it is automatically accessible.
If the object is marked as AuthorAccess and the current UserId is the Author it is accessible.
If the current user is in a permission list (class) that is in the Permissions collection for that object.
If the current user is in a permission list (class) that is in the CascadedPermissions collection for that object.
If the current user has the Portal Administrator role.
When you access a content reference or folder using a valid name and one of the Find methods (FindCRefByURL, FindCRefByName, FindCRefForURL, or FindFolderByName) a content reference or folder is returned whether the user is authorized to it. When you use these methods, always check the Authorized property. This is the only property you can view from an object that an end-user isn't authorized to.
In addition, if you know the specific URL for a tab, you could specify that in the FindCRefByURL. The tab is returned whether the user is authorized to it, so you should always check the Authorized property.
To set non role-based permissions for a folder, content reference, content reference link, PageletCategory object, or Pagelet, you must access the PermissionValue collection for that object using the Permissions property. The PermissionValue objects refer to permission list values that already exist on the system, such as ALLPANLS, CUSTOMER, EMPLOYEE, and so on.
To set role-based permissions for a folder, content reference, or a content reference link that are not component or iScript, you must access the RolePermissionValue collection for that object using the RolePermissions property. The PermissionValue objects refer to role-based permission values that already exist on the system.
Note. The PORTAL_PAGELETS folder is the parent folder for all PageletCategories. Its security is set to public. PeopleSoft does not recommend cascading any permissions from this folder object. Cascade permissions only from the pagelet category (folder).
Both the PermissionValue collection and the RolePermissionValue collection return PermissionValue objects. Use the PermType property to determin if a particular PermissionValue is role-based or not.
For every PermissionValue object, you can chose whether all the child folders and content references of this folder have the same permissions. This is called cascading. You cascade permissions by setting the Cascade property to True.
There are two types of PermissionList collections you can access. One is returned by the Permissions and RolePermissions properties, the other by the CascadedPermissions and CascadedRolePermissions properties.
Permissions and RolePermissions
The Permissions and RolePermissions properties return a collection containing the permissions set at the current level, that is, set with that folder or content reference. You can add PermissionValues to this list. Use the Cascade property to cascade the permission you add to child folders and content references.
Note. Folders can contain other folders, but the other objects that use the Permissions property can't contain themselves, that is, content references can't contain other content references, and so on. Therefore, the Cascade property is applicable only to folders, not to any other object.
CascadedPermissions and CascadedRolePermissions
The CascadedPermissions and CascadedRolePermissions properties return the a collection for all the permissions for an object. It contains any permission list values set in any parent folder.
Note. You cannot add any PermissionValues to a collection returned by the CascadedPermissions or CascadedRolePermissions property. You can add values only to the collection returned by the Permissions or RolePermissions property.
You can add PermissionValues for a child folder, but you cannot delete any of the existing ones that are cascaded. Permissions are augmented, not overwritten, that is, the permissions are the sum of both the parent permissions and whatever is set at the current level.
Therefore, keep the following in mind when working with PermissionValues:
Set permissions only at the level where they're needed.
Cascade permissions only when necessary.
Generally, don't set cascaded PermissionValues for the root folder.
Only the values in a PermissionValue object cascade. Properties on the folder itself (such as PublicAccess or AuthorAccess) do not cascade.
For example, suppose your PortalRegistry had the following hierarchy:
PortalRegistry hierarchy example
The following permission list values are assigned to the PermissionValue objects for the Employees folder, and both of them are cascaded:
EMPLOYEE
MANAGER
The Homepages and Benefits folders have the exact same permissions as the Employees folder, that is, all users associated with these two permission lists have access to these folders.
Suppose you decide that you don't want the permission list EMPLOYEE to access the Benefits folder. If you delete the EMPLOYEE PermissionValue from the Benefits PermissionValue collection, you have not altered the permissions. The permissions set at the parent folder, that is, at the Employees folder, can't be deleted, they can only be added to.
To make this change, you must:
Change the Cascaded property for the EMPLOYEES PermissionValue in the Employees folder to False
Add EMPLOYEES as a PermissionValue object to the Homepages folder.
See Also
Setting Permissions Using the PermissionValue Object
Folders, content references, content reference links, and tab definitions have both ValidFrom and ValidTo dates. What's the difference and how are they used in the PortalRegistry API?
A ValidFrom date is when something begins.
A ValidTo date is when something ends.
For example, suppose your HR department has a page describing the benefits for your employees, and that page changed every calendar year. This means the page for the year 2000 has a ValidFrom date of 01/01/2000 and a ValidTo date of 12/31/2000. The benefits page for the year 2001 has a ValidFrom date of 01/01/2001 and a ValidTo date of 12/31/2001.
Folders, content references, content reference links and tab definitions are returned in their collections regardless of the ValidTo and ValidFrom dates. You must take these dates into account and only display to the end-user those values that should be seen.
In addition, a ValidFrom should always come before a ValidTo date. If they are set incorrectly, you receive a runtime error.
For all newly created folders, content references, content reference links and tab definitions, the default value for both these properties is Null (""), that is, they begin immediately and do not expire.
In addition, you can also check the IsVisible property to see if a portal object is viewable. IsVisible verifies if an object is Hidden, as well as if the ValidTo and ValidFrom dates are within the specified dates.
All errors for the PortalRegistry classes, like the other APIs, are logged in the PSMessages collection, instantiated from a session object.
The PortalRegistry classes log errors that occur with methods immediately, and errors that occur with properties only after a method is executed.
For example, suppose you specified an invalid name when you were trying to delete a folder. The method (DeleteItem) returns False, and the error is logged in the PSMessages collection immediately.
Now suppose you created a new folder, and specified an invalid ValidTo date. The error won't be logged in the PSMessages collection until you tried to save your changes.
When you want to check for errors depends on your application. When users are entering data dynamically, and your program is registering their data in the portal, you may want to check for errors often. If you're using a batch program, you may want to check for errors only after the Open, Save, Insert, and Delete methods.
Most methods return a Boolean value indicating success or failure. After the failure of a method, you may want to check the PSMessages collection to determine the exact error.
Local ApiObject &MySession; Local ApiObject &ErrorCol; Local ApiObject &FolderCol, &Folder, &Registry; Local Boolean &Open;/* Access the current session */ &MySession = %Session; If &MySession Then /* connection is good */ &Registry = &MySession.GetRegistry(); &Open = &Registry.Open("CUSTOMER"); If &Open Then /* Registry opened successfully */ /* do processing */ Else /* Do error checking */ &ErrorCol = &MySession.PSMessages; For &I = 1 to &ErrorCol.Count /* do processing */ End-For; End-If; Else /* do processing for no connection */ End-If;
See Also
At runtime, there are certain things you want to do with a PortalRegistry object, like getting an instance of it, adding tabs, editing content references, and so on. The following is an overview of this process. These steps are expanded in other sections.
Perform one of these steps.
Execute the GetPortalRegistry method on the PeopleSoft session object to get a PortalRegistry object, or
Use the FindPortalRegistries method on a session object to get a collection of all PortalRegistries. Select a PortalRegistry from the collection.
Open the PortalRegistry, using the portal name.
After you have an open PortalRegistry object, you can do various actions such as:
Add content references to the existing folders.
Add folders and the content references for them.
Add or change Nodes.
Modify the PortalRegistry properties.
Modify the existing content references, folders, tabs, homepages, and so on.
After you make your changes, you must save your work. The Save method must be executed at the appropriate level, such as at the folder level for changes to a folder, at the PortalRegistry level for changes to the default template, and so on.
A property value change isn't committed to the database until the parent object is saved.
Some methods commit data to the database only when the parent object is saved. However, other methods cause data to be committed to the database as soon as they are executed, like DeleteItem on a folder. Methods that automatically make database changes are noted as such in their description.
When you finish all operations for a PortalRegistry, close the object.
Note. PeopleSoft recommends that you open and close every PortalRegistry in a single PeopleCode event. You shouldn't open a PortalRegistry object and keep it open across multiple events. You should also keep only one PortalRegistry object open at a time.
Life cycle of a PortalRegistry object
Examples of using the PortalRegistry objects are provided at the end of this chapter.
See Also
PortalRegistry Classes Example
There are many different classes used with the PortalRegistry API. The following flowchart shows the different classes, and how they are interrelated.
Hierarchy Considerations
The following are considerations for the representation of the hierarchy:
The flowchart shows only two levels of folders. In reality, you can embed as many levels of folders as you need.
From a PortalRegistry object, you must access the root folder before you can access the sub-folders for that PortalRegistry.
PortalRegistry class hierarchy (part 1 of 4)
PortalRegistry class hierarchy (part 2 of 4)
PortalRegistry class hierarchy (part 3 of 4)
PortalRegistry class hierarchy (part 4 of 4)
Content references have a number of properties, but several properties work together to define the type of Content reference. The values of these properties are interdependent, that is, the value of one indicates the values of others. The properties are:
UsageType
TemplateType
URLType
Nodes and URL
This is the primary specifier for the type of content reference. There are a number of different types of content references, but all content references can be categorized into the following major types:
Target
Template
Portal Component
The target is the page referenced by a URL in the user's browser. This is the main transaction or page that the user wants, and the portal may place other content around this target page based on the template. The template describes any other content, and where to place it, on the page. The template is either gotten from the content reference or a set of default templates.
Content reference links can only be created for content references that have a type of target.
A portal template defines how the portal creates a user's page. It's an HTML document that describes the content and where the content is placed. The template specifies one target and zero or more portal components.
The portal template in the following example is comprised of four separate template components: one for the navigation and search header, one for related links, one for the target content region, and one for the overall template which specifies where the other components should be placed. At runtime, the target content region would be filled by the HTML returned by the target page, as would the other template component regions.
A portal template
See Working with Portal Templates.
A portal component is an HTML document, or something that produces an HTML document. The portal component must be defined within a template.
A portal component could be one of a Homepage tab, component reference, or Homepage Pagelet.
UsageType Values
The following table matches the general types of target, template, and portal component to the actual values of the UsageType property.
General Type |
UsageType Value |
Target |
Target (TARG) |
Template |
Frame template (FRMT) or HTML template (HTMT) |
Pagelet |
Pagelet (HPGC) |
Homepage Tab |
Homepage Tab (HPGT) |
More specifically:
A UsageType value of TARG specifies a content reference that is a target.
A UsageType value of FRMT specifies a content reference that is an HTML frame template.
A UsageType value of HTMP specifies a content reference that is an HTML template.
A UsageType value of HPGC specifies a content reference that is a PeopleSoft homepage component (pagelet).
A UsageType value of HPGT specifies a Homepage tab.
A UsageType value of LINK specifies a content reference link.
This property is valid only when the UsageType property is a target. For target type content references (TARG) this controls whether the portal looks for and uses a template to wrap the target.
TemplateType |
Meaning |
NONE |
There is no template for this target |
HTML |
There is some kind of HTML template for this target |
This property gives information about what format the URL is in.
URLType Value |
Meaning |
UEXT |
URL points to a non-PeopleSoft (external) URL |
UMPG |
URL points to a PeopleSoft mobile page |
UPGE |
URL points to a component |
UPHP |
URL points to a homepage tab |
UPTM |
URL points to a template |
USCR |
URL points to an iScript |
UGEN |
URL points to a generic PeopleSoft URL. |
The URL property is always required (it's one of the parameters for the InsertItem method.) The format of this parameter (or property) depends on the other properties.
See Also
Understanding Portal Technology
Nodes and the URL property work together and are interrelated. The node is how to ‘register’ a logical name for a webserver (the webserver name, on the servlet, and so on) not the actual details. This way, content references don’t change when a webserver changes.
For example, suppose you had content that you referenced on the HRMS webserver. However, the machine name for that server changed. You can change the URI of the Node, instead of changing every content reference that referred to that content.
At least one node must be specified as the default local node. Nodes are also required for PeopleSoft components and iScripts.
Considerations When Using Nodes and the URL Property
When a content reference is created it is ‘registered’ with its URL (the portal, and others, typically find a content reference by its URL). The node is used to create a logical name for the webserver, servlet, and so on, so these details are not included in a content reference’s URL. When details of a webserver change, such as at installation time, only the URI for the content provider must change. You don’t have to change the URL for any content references.
When the node is specified, the content provider’s URI is concatenated with the URL property.
The format of the URL property depends on the content it's pointing to.
Summary
The following table summarizes the interrelations between the different content reference properties.
UsageType |
TemplateType |
StorageType |
URLType |
Target (TARG) |
HTML |
Remote (RMTE) |
Component (UPGE) |
Target (TARG) |
HTML |
Remote (RMTE) |
Internet Script (USCR) |
Target (TARG) |
HTML |
Remote (RMTE) |
External (UEXT) |
Target (TARG) |
NONE |
Remote (RMTE) |
Component (UPGE) |
Target (TARG) |
NONE |
Remote (RMTE) |
Internet Script (USCR) |
Target (TARG) |
NONE |
Remote (RMTE) |
External (UEXT) |
Frame template (FRMT), HTMP template |
NONE |
Remote (RMTE) |
Internet Script (USCR) |
Frame template (FRMT), HTMP template |
NONE |
Local (LOCL) |
N/A |
Homepage (HPGT) |
NONE |
Local (LOCL) |
N/A |
Template component (TMPC), Homepage component (HPGC) |
N/A |
Remote (RMTE) |
Component (UPGE) |
Template component (TMPC), Homepage component (HPGC) |
N/A |
Remote (RMTE) |
Internet Script (USCR) |
Template component (TMPC), Homepage component (HPGC) |
N/A |
Remote (RMTE) |
External (UEXT) |
Template component (TMPC), Homepage component (HPGC) |
N/A |
Local (LOCL) |
N/A |
If you create two content references or with the exact same URL, the second one fails.
For example, suppose you create an external content reference with a URL of www.peoplesoft.com. Then you create a second content reference that has a node of PeopleSoft, whose URI is www.peoplesoft.com. The creation of the second content reference fails because the URL already exists.
If you have multiple nodes with the same URI, FindCRefByURL looks for the specified content reference with all those nodes.
If you have multiple nodes with the same URI, but no registered content references, the system uses the template from the alphabetically first node it finds.
Pagelet, node, and portal registry names can consist of any combination of letters, digits and underscores, but they must not contain any spaces or begin with a digit.
Content reference link names cannot have start with numbers, and can not have special characters and spaces.
Be extremely careful when you delete any content. There may be more than one object relying on the content you delete.
If you try to delete a template currently used by a content reference, the node template is set as the default template for the portal, you receive an error when you try to save the item.
If you delete a homepage template for a user, the system tries to use the default user's template first, before resorting to the portal default template.
If you try to delete a content provider that is currently used by a content reference, you receive an error and cannot save the PortalRegistry object.
Warning! If you delete a folder, you delete all content in the folder. If you delete a folder that contains other folders, that is, a parent folder, all the child folders, and all the content references are deleted.If you delete a PortalRegistry, you delete everything. Your entire PortalRegistry is gone, all the folders, content references, templates, and so on. Do not delete a PortalRegistry object unless you are absolutely certain you want to.
The following PortalRegistry classes have Save methods:
PortalRegistry
Folder
Content reference
Content reference links
TabDefinition
PageletCategory
Pagelet
Homepage
Favorites collection
This means if you change a folder, you must save the folder. If you change a folder and only save at the PortalRegistry level, your changes are not saved.
Some classes do not have a Save method. For these classes, you must save the parent object.
If you change a node, node template, or remote portal, you must use the PortalRegistry Save method.
If you change an AttributeValue you must use the Save method with the item that contains the AttributeValue (folder, content reference, PageletCategory, or Pagelet).
If you change a PermissionValue, you must use the Save method with the item that contains the PermissionValue (folder, content reference, PageletCategory or Pagelet).
If you change a UserTab or a SelectedPagelet, you must use the Homepage Save method.
PortalRegistry objects, and all objects instantiated from a PortalRegistry object, are declared as data type ApiObject. For example,
Local ApiObject &MyRegistry; Local ApiObject &MyFolder, &MyAttributeValue;
Note. PortalRegistry objects can only be declared as Local.
Considerations Using Local Variables
When a local variable has a reference to an object and the end-user clicks the Back button on a browser, the local variable is set to NULL. This is always logged in the trace file.
Considerations Using Global Variables
Global variables are not available to a portal or applications on separate databases. They are available only on applications and Portals in the same database.
A PortalRegistry object can be instantiated from the following language environments:
PeopleCode
C/C++
Java
See Also
PortalRegistry Classes Example
The following sections provide more detail of the properties, methods, and other objects that you can use with a PortalRegistry object. If you don't want to programmatically change a portal registry, you can use the Portal Administration Tool pages instead.
See Also
Understanding Portal Technology
PortalRegistry objects don’t have any built-in functions. They are instantiated from a session object. In this section, we discuss the Session Object methods. The methods are listed in alphabetical order.
See Also
Syntax
FindPortalRegistries(Name)
Description
The FindPortalRegistries method returns a reference to a PortalRegistry Collection filled with zero or more PortalRegistry objects matching the Name parameter. The Name parameter takes a string value.
You can use a partial key to get a smaller subset of the PortalRegistry collection. For example, to get a collection of all the PortalRegistry objects whose names start with the letter "B", specify just the letter B for Name:
&MyColl = &MySession.FindPortalRegistries("B");
Parameters
Name |
Specify the name of the PortalRegistry object to find. This parameter takes a string value. |
Returns
A PortalRegistry Collection object.
Example
The following example returns a collection with references to all PortalRegistry objects.
Local ApiObject &MySession; Local ApiObject &MyColl; &MySession = %Session; &MyColl = &MySession.FindPortalRegistries("");
Syntax
GetLocalNode()
Description
Use the GetLocalNode method to return a reference to the node defined as the local node for this session.
Parameters
None.
Returns
A reference to a node object if successful, Null otherwise.
Example
&Node = %Session.GetLocalNode();
See Also
Syntax
GetNodes()
Description
Use the GetNodes method to return a collection of both local and remote nodes for the session.
Parameters
None.
Returns
A reference to a collection of nodes if successful, Null otherwise.
Example
&NodeColl = %Session.GetNodes();
See Also
Syntax
GetPortalRegistry()
Description
The GetPortalRegistry method returns an empty PortalRegistry object. You can then open or delete an existing PortalRegistry, or create a new one.
Parameters
None.
Returns
An empty PortalRegistry object.
Example
Local ApiObject &MyPortal; &MyPortal = %Session.GetPortalRegistry(); &PORTAL_NAME = %Request.GetParameter("PORTAL_NAME"); &Portal.Open(PORTAL_NAME);
Syntax
GetRemoteNodes()
Description
Use the GetRemoteNodes method to return a collection of nodes for the session.
Note. This method returns both local and remote nodes.
Parameters
None.
Returns
A reference to a collection of nodes if successful, Null otherwise.
Example
&NodeColl = %Session.GetNodes();
See Also
A PortalRegistry object is returned from:
The GetPortalRegistry session method.
The PortalRegistry Collection Methods First, ItemByName, or Next.
Note. In addition to the following methods, the PortalRegistry class has methods used with the Search API.
See Also
PortalRegistry Collection Methods
Changing PortalRegistry Properties
In this section, we discuss the PortalRegistry class methods. The methods are discussed in alphabetical order.
Syntax
Close()
Description
The Close method closes the PortalRegistry object, that is, this method sets the object to the state it was in immediately after the GetPortalRegistry was done on the PeopleSoft Session object. Any unsaved changes are discarded. The Close method can be used only on an open PortalRegistry, not a closed one. This means you must have opened the PortalRegistry with the Open method before you can close it.
Parameters
None.
Returns
A Boolean value: True if the PortalRegistry object is successfully closed, False otherwise.
Example
&Rslt = &MyRegistry.Close(); If Not &Rslt Then /* registry not closed - do error processing */ End-if;
See Also
PortalRegistry class: Open method, Save method.
Syntax
CopyObject(sourcePortalName, sourceRefType, sourceObjName, targetPortalName, targetPrntFldrName, copyChildren)
Description
Use the CopyObject method to copy folders and content references between portal registries.
If the object being copied has related HTML, the HTML is also copied and named according to the current portal naming convention for HTML objects, which is:
PR_<portalname>_<objectname>
where <portalname> is up to the first 8 characters of the portal name and <objectname> is up to the first 17 characters of the object name.
Considerations Using CopyObject
The source portal name and the target portal name cannot be the same name.
The targetPrntFldrName must be a folder that exists in the portal identified by the target portal name. It cannot be null (or empty). If you need to copy an entire portal, the portal must first be "created" using the Create method, before copying over all the folders and content references.
The copyChildren parameter is ignored for content references. However, it still must be set to "Yes" or "No".
Parameters
sourcePortalName |
Specify the name of the portal from which the object is to be copied. |
sourceRefType |
Specify the type of object to be copied. Values are:
This parameter is case-sensitive. |
sourceObjName |
Specify the name of the object to be copied. |
targetPortalName |
Specify the name of the portal to which the object will be copied. |
targetPrntFldrName |
Specify the name of the folder that will be the parent folder for the source object. |
copyChildren |
Specify whether to also copy the children of the source object. This parameter is valid only with folder objects. Values are:
This parameter is case-sensitive. |
Returns
A Boolean value: True if object copied successfully, False otherwise.
Example
&Success = &Portal.CopyObject("PORTAL", "F", "PEOPLETOOLS_QUALITY", "BOGUS", "PORTAL_ROOT_OBJECT", "Yes"); If (&Success = False) Then WinMessage("portal copy failed"); Exit; End-If;
Syntax
Create(RegistryName)
Description
The Create method creates a new PortalRegistry in the PortalRegistry object called RegistryName. The specified registry must be a new registry. The Create method returns False if the registry already exists.
The new PortalRegistry is immediately committed to the database. If you change any property of a PortalRegistry after you create the object, use the Save method to commit your changes to the database.
When a registry is created, a folder called Root is automatically created. This is the root folder for the registry.
Note. If you're using Visual Basic, you must check that the PortalRegistry is actually created. If you use a duplicate name, a zero is returned, but no error results.
Parameters
RegistryName |
The name of the registry to create. This parameter takes a string value. If you specify a registry that already exists, this method returns a False value. |
Returns
A Boolean value: True if the PortalRegistry object is successfully created, False otherwise.
Example
&PORTAL_NAME = MY_PORTAL_RECORD.PORTALNAME; &MyPortal = %Session.GetPortalRegistry(); If NOT &MyPortal.Create(&PORTAL_NAME) Then; /* portal not created - do error processing */ End-If;
See Also
PortalRegistry class: Open method, Save method, Close method, Delete method.
Syntax
CreateContentRefLink(LinkName, LinkLabel, LinkParent, CRefPortalName, CRefObjectName)
Description
Use the CreateContentRefLink method to create a link to any content reference in any portal in a local database.
For example, using this method, you can create a link to a content reference in the EMPLOYEE portal, to a content reference in the CUSTOMER portal, or to a content reference in the current portal.
Parameters
LinkName |
Specify the name of the link as a string. This is the ID of the link. The name is validated as that of the content reference name. It cannot start with a number, and can not have special characters and spaces. This property is not translated. |
LinkLabel |
Specify the label of the link as a string. This property can be translated. This is the label that appears on the left hand navigation menu If this value is blank, a linked content reference label is displayed instead. |
LinkParent |
Specify the parent folder of the link, as a string. |
CRefPortalName |
Specify the portal name of the content reference, to which the link is pointing, as a string. |
CRefObjectName |
Specify the ID of the content reference to which the link is pointing, as a string. |
Returns
A reference to a newly created CRefLink object.
Example
Local ApiObject &Portal, &CRef, &CReflink; &Portal = PortalOpen(); &CReflink = &Portal.CreateContentRefLink(<Unique Link Name> , <LinkLable>, "<Link's Parent folder >", "<Cref Portal Name>", <Cref Object Name>); /*... Use the link object */ &Portal.Close();
Syntax
CreateRemote(PortalName, RemoteNodeName)
Description
Use the CreateRemote method to create a remote portal. Although you can have more than one portal on a node, they must all be uniquely named.
Parameters
PortalName |
Specify the name of the new portal to create on the remote node. |
RemoteNodeName |
Specify the name of the remote node to create the new portal on. |
Returns
A Boolean value: True if the PortalRegistry object is successfully created, False otherwise.
See Also
PortalRegistry class: Create method, Portals property.
Syntax
Delete(RegistryName)
Description
The Delete method deletes the PortalRegistry from the database, including any data and tables.
Warning! If you delete a PortalRegistry, you delete everything. Your entire PortalRegistry is gone, all the folders, content references, templates, and so on. Do not delete a PortalRegistry object unless you are absolutely certain that you want to.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.
The Delete method can only be used with a closed registry, it cannot be used on an open registry. Before you use the Delete method, you must explicitly close the PortalRegistry object (with the Close method.) The Delete method returns False if you try to delete an open PortalRegistry object.
Parameters
RegistryName |
The name of the registry to delete. This parameter takes a string value. If you specify a registry that doesn't exist, this method returns a False value. |
Returns
A Boolean value: True if the PortalRegistry object is successfully deleted, False otherwise.
Example
The following example deletes all PortalRegistry objects that start with HRMS_99.
Local ApiObject &MySession; Local ApiObject &MyPortal; &MySession = %Session; &MyPortal = &MySession.GetPortalRegistry(); &MyPortal.Delete("HRMS_99");
See Also
PortalRegistry class: Close method, Open method.
Syntax
DeleteHomepage()
Description
The DeleteHomepage method deletes the current user's homepage. This method is valid only after a user has opened a PortalRegistry object.
Parameters
None.
Returns
A Boolean value: True if the homepage is successfully deleted, False otherwise.
See Also
Syntax
FindCRefByName(Name)
Description
The FindCRefByName method returns the content reference object corresponding to Name. The name is a unique identifier for each content reference.
Considerations on Returned Content References
This method returns content reference objects that aren't yet valid as well as ones that are no longer valid. When you create your program, you must check for these invalid values if you don't want to use them. You can check using ValidTo, ValidFrom, or IsVisible.
This method returns content reference objects that you aren't authorized to. When you create your program, you should always check the Authorized property. This is the only property you can view from an object that you're not authorized to view.
Parameters
Name |
A unique name within the registry that identifies the content reference. This parameter takes a string value. This parameter uses the name, not the label, of a content reference. |
Returns
What this method returns depends on the condition of the content reference:
If the content reference name is valid and the end-user has access to the content reference, a content reference object is returned.
If the content reference is valid but the end-user doesn't have access to it a content reference object is returned, however, the only property you can access is the Authorized property.
If you specified an invalid name this method returns NULL.
Example
The following example returns a GLOBAL_PAYROLL content reference object:
&CRef = &Portal.FindCRefByName("GLOBAL_PAYROLL");
See Also
Syntax
FindCRefByURL(URL)
Description
The FindCRefByURL method returns the content reference object corresponding to URL. The URL specified by URL must be an absolute URL.
Note. The portal registry API needs the current URI of the local node to work. During runtime, it gets this information from the current webserver. For Application Engine programs, there isn't a current webserver, so it has to get this information from the database.
If you have multiple content providers with the same URI, FindCRefByURL looks for the specified content reference with all those content providers.
To access pagelet categories and their associated pagelets, use the PageletCategories collection from the PortalRegistry object, not FindCRefByURL.
Considerations on Returned Content References
This method returns content reference objects that aren't yet valid as well as ones that are no longer valid. When you create your program, check for these properties (ValidTo and ValidFrom) if you don't want to use them.
This method returns content reference objects that the end-user isn't authorized to. When you create your program, always check the Authorized property. This is the only property you can view from an object that the end-user isn't authorized to view.
Parameters
URL |
A URL that represents the content. This parameter takes a string value. This URL must be an absolute URL. This parameter is case-insensitive. |
Returns
What this method returns depends on the condition of the content reference:
If the end-user has access to the URL, a content reference object is returned.
If the content reference is registered, but the end-user doesn't have access to it, a content reference is returned, but the only property you can access is the Authorized property.
If a URL isn't registered or is invalid, this method returns NULL.
Example
The following example finds a content reference from a URL:
&UserCRef = &Portal.FindCRefByURL("http://www.PeopleSoft.Com");
See Also
GetQualifiedURL, QualifiedURL.
Syntax
FindCRefForURL(URL)
Description
The FindCRefForURL method returns the content reference object corresponding to URL. The URL specified by URL must be an absolute URL.
If the exact content reference is not found, this method tries to look for the content reference again, after stripping off the query portion of the URL.
If you don't want the system searched without the query string, use the FindCRefByURL method.
Note. The portal registry API needs the current URI of the local node to work. During runtime, it gets this information from the current webserver. For Application Engine programs, there isn't a current webserver, so it has to get this information from the database.
If you have multiple content providers with the same URI, FindCRefForURL looks for the specified content reference with all those content providers.
To access pagelet categories and their associated pagelets, use the PageletCategories collection from the PortalRegistry object, not FindCRefForURL.
Considerations on Returned Content References
This method returns content reference objects that aren't yet valid as well as ones that are no longer valid. When you create your program, check for these properties (ValidTo and ValidFrom) if you don't want to use them.
This method returns content reference objects that the end-user isn't authorized to. When you create your program, always check the Authorized property. This is the only property you can view from an object that the end-user isn't authorized to view.
Parameters
URL |
A URL that represents the content. This parameter takes a string value. This URL must be an absolute URL. This parameter is case-insensitive. |
Returns
What this method returns depends on the condition of the content reference:
If the end-user has access to the URL, a content reference object is returned.
If the content reference is registered, but the end-user doesn't have access to it, a content reference is returned, but the only property you can access is the Authorized property.
If a URL isn't registered or is invalid, this method returns NULL.
Example
The following example finds a content reference from a URL. If the content reference isn't found from the full URL, the query string is stripped and the system searches again:
&UserCRef = &Portal.FindCRefForURL("http://www.peoplesoft.com/crefs/psportal/technologies/?url=http%3a%2f%2faugust2004%2fipass.html");
See Also
GetQualifiedURL, QualifiedURL, FindCRefByURL.
Syntax
FindCRefLinkByName(LinkName)
Description
Use the FindCRefLinkByName method to find the existing link in the current portal. If the link is found a reference to CRefLink object is returned. A Null value is returned if the CRefLink is not found in the database, and the error message is added to message collection
Considerations on Returned Links
This method returns links that aren't yet valid as well as ones that are no longer valid. When you create your program, you must check for these properties (ValidTo and ValidFrom) if you don't want to use them. This method may also return objects that you aren't authorized to. When you create your program, you should always check the Authorized property. This is the only property you can view from an object that you're not authorized to view.
Parameters
LinkName |
Specify the name of the link as a string. This is the ID of the link. |
Returns
A reference to an existing CRefLink object. or a Null value if the CRefLink is not found.
Syntax
FindFolderByName(Name)
Description
The FindFolderByName method returns the Folder object corresponding to Name. The name is a unique identifier for each folder.
Considerations on Returned Folders
This method returns Folder objects that aren't yet valid as well as ones that are no longer valid. When you create your program, check for these properties (ValidTo and ValidFrom) if you don't want to use them.
This method returns folder objects that you aren't authorized to. When you create your program, always check the Authorized property. This is the only property you can view from an object that you're not authorized to view.
Parameters
Name |
A unique name within the registry that identifies the folder. This parameter takes a string value. This parameter takes the name of a folder, not the label. |
Returns
What this method returns depends on the condition of the folder:
If the folder name is valid and the end-user has access to the folder, a folder object is returned.
If the folder is valid but the end-user doesn't have access to it a folder object is returned, however, the only property you can access is the Authorized property.
If you specified an invalid name this method returns NULL.
Example
The following example returns a folder named ROOT:
&MyFolder = &MyPortal.FindFolderByName("ROOT");
The following example returns the folder object for an already instantiated content reference:
&Folder = &Portal.FindFolderByName(&CRef.ParentName);
See Also
Syntax
FindPgltByName(PageletName)
Description
The FindPgltByName method returns the pagelet object corresponding to PageletName. The name is a unique identifier for each pagelet.
Considerations on Returned Pagelets
This method returns pagelet objects that aren't yet valid as well as ones that are no longer valid. When you create your program, check for these properties (ValidTo and ValidFrom) if you don't want to use them.
This method returns pagelet objects that you aren't authorized to. When you use create your program, always check the Authorized property. This is the only property you can view from an object that you're not authorized to view.
Parameters
PageletName |
A unique name within the registry that identifies the Pagelet. This parameter takes a string value. This parameter takes the name of a Pagelet, not the label. |
Returns
What this method returns depends on the condition of the Pagelet:
If the Pagelet name is valid and the end-user has access to the Pagelet, a Pagelet object is returned.
If the Pagelet is valid but the end-user doesn't have access to it a Pagelet object is returned, however, the only property you can access is the Authorized property.
If you specified an invalid name this method returns NULL.
Example
The following example returns a pagelet named HomePg_Dictionary:
&MyPglt = &MyPortal.FindPgltByName("HomePg_Dictionary");
See Also
Syntax
GetAbsoluteContentURL(NodeName, URL)
Description
The GetAbsoluteContentURL method returns the absolute unwrapped simple URL of the content, in the context of the current portal. For example, if the PortalRegistry object accessed a portal called Employees, and the method were called like this:
&Registry.getAbsoluteContentURL(Node.CRM, "/c/SERVICES.ORDERS.GBL");
It would return the following string:
http://crmserver/servlets/psc/crmHome/Employees/CRM/c/SERVICES.ORDERS.GBL
In the returned string, the portion of the string from server name through PS_Home (crmHome in the example) are the ones associated with the content node (CRM in the example). The portal is the current portal, and the rest of the URL is the URL string passed in.
Parameters
NodeName |
Specify the name of the node that contains the content. You can also use a string, such as %Node, for this value. |
URL |
Specify the relative URL pointing to the content that you want the absolute URL generated for. |
Returns
A string containing the absolute URL.
Syntax
GetDefaultHPTabOID()
Description
Use the GetDefaultHPTabOID method to return the name of the first homepage tab that is found and authorized for the current UserID.
The search order of the tabs depends on Sequence number of the tab name and is sorted alphabetically.
Parameters
None.
Returns
A string
Syntax
GetQualifiedURL(ContentProvider, RelativeURL)
Description
Note. This method is maintained only for backward compatibility. If your existing code uses this method, it actually returns the value from GetAbsoluteContentURL method. New applications should use the GetAbsoluteContentURL method.
See Also
PortalRegistry class: GetAbsoluteContentURL method.
Syntax
GrantPermissionForComponent(MenuName, ComponentName, Market, PermListName, NodeName)
Description
Use the GrantPermissionForComponent method to grant the specified permission and cascaded upwards on parent folders to the specified component. In addition, the specified permission is granted to any component references that point to the specified component, and any parent folders.
Components that have query strings are also searched and permissions are applied on them.
If you use the string "LOCAL_NODE" as NodeName, the system uses the node name currently defined as local.
All component entries in the portal registry are affected for all the portals. Not just the current portal.
Parameters
MenuName |
Specify the menu name, as a string, that the component you want to grant permissions for is associated with. |
ComponentName |
Specify the component name, as a string, that you want to grant permissions for. |
Market |
Specify the market, as a string, associated with the component that you want to grant permissions for. |
PermListName |
Specify the name of the permission list, as a string, that you want to use. |
NodeName |
Specify the node of the component reference, as a string, that points to the component reference that you want to grant permissions for. If you use the string "LOCAL_NODE", the system uses the node name currently defined as local. |
Returns
A Boolean value: True if method completed successfully, False otherwise.
Example
The My Profile Component Reference points to the USERMAINT_SELF component. Using the following example, "ALLPANLS" permission is granted to the MY_PROFILE component reference, as well as "MY INFO", the parent folder.
&Portal.GrantPermissionForComponent("MAINTAIN_SECURITY", "USERMAINT_SELF", "GBL", "ALLPANLS", "LOCAL_NODE");
See Also
Syntax
GrantPermissionForScript(RecordName, FieldName, EventName, FuncName, PermListName, NodeName)
Description
Use the GrantPermissionForScript method to grant the specified permission to the specified iScript. In addition, the specified permission is granted to any component references that point to the specified iScript, and any parent folders.
If you use the string "LOCAL_NODE" as NodeName, the system uses the node name currently defined as local.
All iScript entries in the portal registry are affected for all the portals. Not just the current portal.
Parameters
RecordName |
Specify the record name, as a string, of the record containing the iScript. All iScripts are contained on records whose names start with "WEBLIB". |
FieldName |
Specify the name of the field, as a string, containing the iScript. |
EventName |
Specify the name of the event, as a string, containing the iScript. Generally iScripts are contained in the FieldFormula event. |
FuncName |
Specify the name of the function, as a string, containing the iScript. |
PermListName |
Specify the name of the permission list, as a string, that you want to use. |
NodeName |
Specify the node of the component reference, as a string, that points to the component reference that you want to grant permissions for. If you use the string "LOCAL_NODE", the system uses the node name currently defined as local. |
Returns
A Boolean value: True if method completed successfully, False otherwise.
Example
&Portal.GrantPermissionForScript("WEBLIB_ALERT", "ALERTCOUNT", "FieldFormula", "Connect_Alert", "ALLPGS", "Local_Node");
See Also
Syntax
Open(RegistryName)
Description
The Open method opens the PortalRegistry specified by the parameters. The registry must already exist. The Open method can be used only with a closed PortalRegistry, it cannot be used on an open registry.
Parameters
RegistryName |
The name of the registry to open. This parameter takes a string value. If you specify a registry that doesn’t exist, this method returns a False value. |
Returns
A Boolean value: True if the PortalRegistry object is successfully opened, False otherwise.
Example
In the following example, the name of the portal is stored as the value of a field in a record.
&PORTAL_NAME = EO_PE_REG_AET.PORTAL_NAME; &Portal = %Session.GetPortalRegistry(); &Portal.Open(&PORTAL_NAME);
See Also
PortalRegistry class: Open method, Save method, Close method, Delete method.
Syntax
PermissionListDelete(PermListName)
Description
Use the PermissionListDelete method to delete the specified permission list from the PortalRegistry.
If you try to delete a permission list that is still in use, you receive an error when you try to save the object.
The permission list is deleted from all the portal objects for all the portal.
Parameters
PermListName |
Specify the permission list to delete from the PortalRegistry. |
Returns
A Boolean value: True if the permission list is successfully deleted, False otherwise.
Syntax
PermissionListSaveAs(PermListSourceName, PermListTargetName)
Description
Use the PermissionListSaveAs method to copy the specified permission list in the PortalRegistry.
Parameters
PermListSourceName |
Specify the name of the PermissionList to copy. |
PermListTargetName |
Specify the name that you want to give the new PermissionList. |
Returns
A Boolean value: True if the permission list is successfully copied, False otherwise.
Syntax
RevokePermissionForComponent(MenuName, ComponentName, Market, PermListName, NodeName)
Description
Use the RevokePermissionForComponent method to revoke the specified permission to the specified component. In addition, the specified permission is revoked for any component references that point to the specified component.
If you use the string "LOCAL_NODE" as NodeName, the system uses the node name currently defined as local.
All component entries in the portal registry are affected for all the portals. Not just the current portal.
Parameters
MenuName |
Specify the menu name, as a string, that the component that you want to revoke permissions for is associated with. |
ComponentName |
Specify the component name, as a string, that you want to revoke permissions for. |
Market |
Specify the market, as a string, associated with the component that you want to revoke permissions for. |
PermListName |
Specify the name of the permission list, as a string, that you want to use. |
NodeName |
Specify the node of the component reference, as a string, that points to the component reference that you want to revoke permissions for. If you use the string "LOCAL_NODE", the system uses the node name currently defined as local. |
Returns
A Boolean value: True if method completed successfully, False otherwise.
Example
The My Profile Component Reference points to the USERMAINT_SELF component. Using the following example, "ALLPANLS" permission is revoked to the MY_PROFILE component reference.
&Portal.RevokePermissionForComponent("MAINTAIN_SECURITY", "USERMAINT_SELF", "GBL", "ALLPANLS", "LOCAL_NODE");
See Also
PortalRegistry class: GrantPermissionForComponent method.
Syntax
RevokePermissionForScript(RecordName, FieldName, EventName, FuncName, PermListName, NodeName)
Description
Use the RevokePermissionForScript method to revoke the specified permission to the specified iScript. In addition, the specified permission is revoked for any component references that point to the specified iScript.
If you use the string "LOCAL_NODE" as NodeName, the system uses the node name currently defined as local.
All component entries in the portal registry are affected for all the portals. Not just the current portal.
Parameters
RecordName |
Specify the record name, as a string, of the record containing the iScript. All iScripts are contained on records whose names start with "WEBLIB". |
FieldName |
Specify the name of the field, as a string, containing the iScript. |
EventName |
Specify the name of the event, as a string, containing the iScript. |
FuncName |
Specify the name of the function, as a string, containing the iScript. Generally iScripts are contained in the FieldFormula event. |
PermListName |
Specify the name of the permission list, as a string, that you want to use. |
NodeName |
Specify the node of the component reference, as a string, that points to the component reference that you want to revoke permissions for. If you use the string "LOCAL_NODE", the system uses the node name currently defined as local. |
Returns
A Boolean value: True if method completed successfully, False otherwise.
Example
&Portal.RevokePermissionForScript("WEBLIB_ALERT", "ALERTCOUNT", "FieldFormula", "Connect_Alert", "ALLPGS", "Local_Node");
See Also
Syntax
Save()
Description
The Save method saves changes that you made to the PortalRegistry or to a node template. It does not save any changes that you made to a folder, content reference, and so on.
Note. To save changes for a folder or content reference use the save method associated with that object.
Parameters
None.
Returns
A Boolean value: True if the PortalRegistry object is successfully saved, False otherwise.
Example
If Not(&MyPortal.Save()) Then /* do error checking */ End-if:
See Also
Save folder method
Save content reference method
In this section, we discuss the PortalRegistry class properties. The properties are discussed in alphabetical order.
Description
This property returns or sets the name of the default template for this PortalRegistry object as a string.
If you delete a template for a content reference, and none of the other content references on a page have a template, the default template specified with the Node is used. If there's no template for the Node, the template specified with this property is used.
To return a reference to the content reference that contains the template specified by this property, use the TemplateObject property.
Note. If you change the Default Template for a portal, the template won't take effect until you close all the existing browser windows with the session and open a new browser window.
This property takes only the first 30 characters of a value. If you specify a value longer than 30 characters, the remaining characters are ignored.
This property is read-write.
See Also
PortalRegistry class: TemplateObject property.
Description
This property returns or sets the description of this PortalRegistry object as a string
The length of this property is 256 characters.
This property is read-write.
Description
This property returns a reference to the Favorites Collection for the current end-user.
This property is read-only.
See Also
Description
This property specifies the content reference name to be used for the folder navigation object. When the folder navigation is tunred on, this content reference is displayed as the folder navigation homepage. This property takes a string value.
This property is read-write.
See Also
Description
This property returns a reference to the Homepage for the current end-user.
This property is read-only.
Description
This property specifies if there is folder navigation. When the folder navigation is turned on, the user can see a folder homepage when clicked on the folder in the lefthand navigation menu. This property takes a boolean value: true if folder navigation is on, false otherwise.
This property is read-write.
See Also
Description
This property returns the name of the PortalRegistry object as a string.
The length of this property is 30 characters.
This property is read-only.
Description
This property returns a reference to a NodeTemplate Collection. This property can be used with a closed portal registry, that is, before you open it with the Open method.
This property is read-only.
See Also
Description
This property returns or sets the owner ID of the PortalRegistry object as a string.
This property is read-write.
Description
This property returns a reference to a PageletCategories Collection that contains all the PageletCategories for a portal.
This property is read-only.
See Also
Description
This property returns a reference to a Portal collection that contains references to all the portals in the database.
This property is read-only.
See Also
Description
This property returns the root folder object for this PortalRegistry object.
This property is read-only.
Description
This property returns reference to a TabDefinitions Collection that contains all the TabDefinitions for a portal.
This property is read-only.
See Also
Description
This property returns a reference to a content reference object that contains the template specified by the DefaultTemplate property. If no template is specified with DefaultTemplate, this property returns Null.
This property is read-only.
See Also
PortalRegistry class: DefaultTemplate property.
A PortalRegistry Collection is returned by the FindPortalRegistries session class method.
See Session class: FindPortalRegistries method.
In this section, we discuss the PortalRegistry collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first PortalRegistry object in the PortalRegistry collection.
Example
&MyRegistry = &MyCollection.First();
Syntax
Item(number)
Description
The Item method returns the PortalRegistry object with the position in the PortalRegistry collection specified by number.
Parameters
number |
Specify the position number in the collection of the PortalRegistry object that you want returned. |
Returns
A PortalRegistry object if successful, NULL otherwise.
Example
For &I = 1 to &MyCollection.Count &MyRegistry = &MyCollection.Item(&I); /* Do processing */ End-For;
Syntax
Next()
Description
The Next method returns the next PortalRegistry object in the PortalRegistry collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Example
&MyRegistry = &MyCollection.Next();
This section discusses the Count property.
Description
This property returns the number of PortalRegistry objects in the PortalRegistry collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The node indicates the URI of the content server. If the node is a PeopleSoft content server, it has a PeopleSoft server URI. If the node has external content, the URI indicates the external content.
Use the IsLocal or IsDefault to determine if a node from a RemoteNode collection is remote or local.
Node objects are instantiated from the following:
From a Session object with the GetLocalNode method.
From a Node Collection with the First, InsertItem, ItemByName, and Next methods.
From a RemoteNode Collection with the First, InsertItem, ItemByName, and Next methods.
See GetLocalNode, Node Collection, RemoteNode Collection.
In this section, we discuss the Node class properties. The properties are discussed in alphabetical order.
Description
This property indicates whether the node has been specified as an active node. This property returns a Boolean value: True, the node is active, False otherwise.
This property is read-only.
Description
This property returns the release of the PeopleSoft Applications hosted on this node as a string. This property is valid only when the NodeType property is set to PeopleSoft (PIA).
This property is read-only.
See Also
Node class: NodeType property.
Description
This property returns the URI for the content webserver of this node as a string.
This property is read-only.
Description
This property returns the name of the portal associated with the node as the default portal for the node.
This property is read-only.
Description
This property returns the description for this node as a string.
The length of this property depends on your system database limit for LONG fields.
This property is read-only.
Description
This property indicates whether the node has been specified as the default local node. This property takes a Boolean value: True, this node has been specified as the default local node, False otherwise.
This property is valid only when the NodeType property is set to PeopleSoft (PIA).
This property is read-only.
See Also
Node class: NodeType property.
Description
This property indicates whether this node has been specified as the local PeopleSoft node. This property takes a Boolean value: True, this node has been specified as a local node, False otherwise.
This property is valid only when the NodeType property is set to PeopleSoft (PIA).
This property is read-only.
See Also
Node class: NodeType property.
Description
This property returns the name for this node object as a string. The name is a unique identifier for each node object.
Every node name must be unique in the database.
This property is read-only.
Description
This property returns the password for this node object as a string.
This property is read-only.
Description
This property indicates what the node is used for. Nodes can either define PeopleSoft or external systems. PeopleSoft nodes have more capabilities than external nodes, therefore several other properties depend on this property.
Values are:
Value |
Description |
PIA |
PIA (Peoplesoft 8.4 simple URL format) |
EX |
External Node |
ICT |
ICType (used for 8.1x content) |
PIA is the default value on a new Node.
This property is read-only.
Description
This property returns the URI for the portal webserver of this node as a string. This property is valid only when the NodeType property is set to PeopleSoft (PIA).
This property is read-only.
See Also
Node class: NodeType property.
Description
This property returns the release of PeopleTools running on this node as a string. This property is valid only when the NodeType property is set to PeopleSoft (PIA).
This property is read-only.
See Also
Node class: NodeType property.
A node collection contains a set of references to all nodes defined in the database.
In this section, we discuss the Node collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first Node object in the Node collection.
Parameters
None.
Returns
A Node object.
Example
&MyNode = &MyCollection.First();
Syntax
ItemByName(NodeName)
Description
The ItemByName method returns the Node object with the name specified by NodeName.
Parameters
NodeName |
Specify the name of an existing node in the Node collection. If you specify an invalid name, the object returned is NULL. |
Returns
A Node object if successful, NULL otherwise.
Example
&MyOldNode = &MyPortal.Nodes.ItemByName("HRMS");
Syntax
Next()
Description
The Next method returns the next Node object in the Node collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A Node object.
Example
&MyNode = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of Node objects in the Node Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
A remote node collection contains a set of references to all the nodes defined in the database, both local and remote.
Use the IsLocal property of the returned node object to determine if the node is remote or local.
In this section, we discuss the RemoteNode collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first Node object in the RemoteNode collection.
Parameters
None.
Returns
A Node object.
Example
&MyNode = &MyCollection.First();
Syntax
ItemByName(NodeName)
Description
The ItemByName method returns the Node object with the name specified by NodeName.
Parameters
NodeName |
Specify the name of an existing node in the RemoteNode collection. If you specify an invalid name, the object returned is NULL. |
Returns
A Node object if successful, NULL otherwise.
Example
&MyOldNode = &MyPortal.RemoteNodes.ItemByName("HRMS");
Syntax
Next()
Description
The Next method returns the next Node object in the RemoteNode collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A Node object.
Example
&MyNode = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of Node objects in the RemoteNode Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The portal class provides access to portals declared in the session.
A portal object is instantiated by the First, InsertItem, ItemByName, and Next Portal Collection methods
See Portal Collection.
In this section, we discuss the Portal class methods. The methods are discussed in alphabetical order.
Syntax
Save()
Description
Use the Save method to save changes you made to the portal object.
Parameters
None.
Returns
A Boolean value: True if the portal object is successfully saved, False otherwise.
See Also
Save PortalRegistry method
In this section, we discuss the Portal class properties. The properties are discussed in alphabetical order.
Description
This property sets or returns the name of the node hosting the portal as a string.
This property is read-write.
Description
This property indicates whether the portal is defined as local or remote. This property returns a Boolean value: True, the portal is defined as local, False otherwise.
This property is read-only.
Description
This property returns the name of this portal as a string. This name exactly matches the portal name of the portal registry defined in the database.
This property is read-only.
The portal collection contains a set of references to each portal defined in the database.
A portal collection is instantiated by the Portals PortalRegistry property.
See PortalRegistry class: Portals property.
In this section, we discuss the Portal collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first Portal object in the Portal collection.
Parameters
None.
Returns
A Portal object.
Example
&MyPortal = &MyCollection.First();
Syntax
ItemByName(PortalName)
Description
The ItemByName method returns the Portal object with the name PortalName.
Parameters
PortalName |
Specify the name of an existing portal within the collection. If you specify an invalid name, the object returns NULL. |
Returns
A Portal object if successful, NULL otherwise.
Example
&MyPortal = &MyPortal.Portals.ItemByName("HRMS");
Syntax
Next()
Description
The Next method returns the next Portal object in the Portal collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A Portal object.
Example
&MyPortal = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of Portal objects in the Portal Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The NodeTemplate class provides access to the default template assigned to a node in this portal.
A NodeTemplate object is instantiated by the First, InsertItem, ItemByName, and Next NodeTemplate Collection methods.
In this section, we discuss the NodeTemplate class properties. The properties are discussed in alphabetical order.
Description
This property specifies the name of the template to be applied to the node.
This property is read-write.
Description
This property specifies the name of node that the template is to be applied to.
This property is read-write.
Description
This property returns a reference to the template object associated with this node as a content reference.
This property is read-only.
See Also
The NodeTemplate collection contains a set of references to each node template object in a portal.
A NodeTemplate collection is instantiated by the NodeTemplates PortalRegistry property.
See PortalRegistry class: NodeTemplates property.
In this section, we discuss the NodeTemplate collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(NodeName)
Description
The DeleteItem method deletes the NodeTemplate object identified by NodeName from the NodeTemplate Collection.
This method is not executed automatically. It is executed only when the PortalRegistry is saved.
Parameters
NodeName |
Specify the name of a NodeTemplate to delete. |
Returns
A Boolean value: True if the NodeTemplate was deleted, False otherwise.
Example
If Not &MyNodeTemplates.DeleteItem("HRMS") Then /* Do error processing */ End-if
Syntax
First()
Description
The First method returns the first NodeTemplate object in the NodeTemplate collection.
Parameters
None.
Returns
A NodeTemplate object.
Example
&MyNodeTemplate = &MyCollection.First();
Syntax
InsertItem(NodeName)
Description
The InsertItem method inserts the NodeTemplate object identified by NodeName into the NodeTemplate Collection.
This method is not executed automatically. It is executed only when the PortalRegistry is saved.
Parameters
NodeName |
Specify the name of the node template to insert. |
Returns
A reference to the new NodeTemplate object if the method executed successfully, NULL otherwise.
Example
&NewNodeTemplate = &MyPortal.NodeTemplates.InsertItem("CRM");
Syntax
ItemByName(NodeName)
Description
The ItemByName method returns the NodeTemplate object with the name NodeName.
Parameters
NodeName |
Specify the name of an existing NodeTemplate object in the collection. If you specify an invalid name, the object is NULL. |
Returns
A NodeTemplate object if successful, NULL otherwise.
Example
&MyNodeTemplate = &MyPortal.NodeTemplates.ItemByName("HRMS");
Syntax
Next()
Description
The Next method returns the next NodeTemplate object in the NodeTemplate collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A NodeTemplate object.
Example
&MyNodeTemplate = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of NodeTemplate objects in the NodeTemplate Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
Folder objects are instantiated from other classes as follows:
From a PortalRegistry object with the RootFolder property or the FindFolderByName method.
From a Folder Collection with the First, ItemByName, or Next methods
See PortalRegistry class: RootFolder property, FindFolderByName method, Folder Collection .
See Adding a Folder.
In this section, we discuss the Folder class methods. The methods are discussed in alphabetical order.
Syntax
Save()
Description
The Save method saves any changes you made to the folder, for example, a changed description or ValidFrom date.
Using this method also saves any changes you made to PermissionValue (both role-based and non role-based) and AttributeValue objects associated with this folder. Security permissions added are cascade upward until the root folder or first public folder. Removed security permissions are removed from all the parent folders until root or public folder in folder hierarchy.
Parameters
None.
Returns
A Boolean value: True if the Folder object is successfully saved, False otherwise.
Example
If Not(&MyFolder.Save()) Then /* do error checking */ End-If;
See Also
Save PortalRegistry method
Save content reference method
In this section, we discuss the Folder class properties. The properties are discussed in alphabetical order.
Description
This property returns an Attribute Collection containing the AttributeValue objects for this folder.
This property is read-only.
See Also
Description
This property returns the author (PeopleSoft user ID) for this folder as a string.
This property is read-only.
Description
This property specifies whether the author of the folder has access to the folder. This property takes a Boolean value. The default value for this property for a newly created object is True. This property is not cascaded.
This property is read-write.
Description
This property specifies whether the user is authorized to view this Folder.
This property is used when you access a particular Folder using FindFolderByName. If you've specified a valid Folder with this method, a Folder is always returned, whether you are authorized to view it or not. This is the only property you can view from an object that you are not authorized to.
The initial value of this property depends on the other permission properties (PublicAccess and AuthorAccess) and the permission list values in the PermissionValue object associated with this folder.
This property is read-only.
See Also
PortalRegistry class: FindFolderByName method.
Description
This property returns a PermissionValue Collection. This collection contains the value of the non role-based permissions for all the child and parent objects (up to the root folder). To determine only the permissions of the object use the Permission property instead. To determine the role-based permissions of the object use the CascadedRolePermissions property instead.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions property. You can add values only to the collection returned by the Permissions or RolePermissions property.
This property is read-only.
See Also
CascadedRolePermissions, PermissionValue Collection, Permissions.
Description
This property returns a RolePermissionValue Collection. This collection contains the value of the role-based permissions for all the child and parent objects (up to the root folder). To determine only the role-based permissions of the object use the RolePermission property instead. To determine the non role-based permissions of the object use the CascadedPermissions property.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedRolePermissions property. You can add values only to the collection returned by the Permissions or RolePermissions property.
This property is read-only.
See Also
CascadedPermissions, RolePermissions, RolePermissionValue Collection.
Description
This property returns the ContentReference Collection for this folder.
This property is read-only.
See Also
Description
This property returns the creation date for this folder as a string.
This property is read-only.
Description
This property returns or sets the description for this folder as a string.
The length of this property is 256 characters. This property is translatable.
This property is read-write.
Description
This property returns a reference to the Folder Collection for this folder.
This property is read-only.
See Also
Description
This property returns True if the folder is used with mobile applications, False otherwise.
This property is read-write.
Description
This property returns True if the Hide from Portal Navigation check box is not selected when the folder is created. If the folder is hidden from portal navigation, this property returns False.
Considerations Using IsVisible
If you do not specifically set this property on a new or copied folder, the IsVisible property is set as follows:
If the ValidFrom date is less then or equal to that day's date, the IsVisible property is set to True.
If there is no ValidTo date the IsVisible property is set to True.
If the ValidTo date is greater then or equal to that day's date, the IsVisible property is set to True.
This property is read-only.
See Also
Folder class: ValidFrom property, ValidTo property.
Description
This property returns or sets the label for this folder as a string.
The length of this property is 30 characters.
This property is translatable.
This property is read-write.
Description
This property returns the name for this folder as a sting. The name is a unique identifier for each folder.
Every folder name must be unique across the portal, not just in the parent folder.
This property is not translatable. However, the values for the Label and Description properties are translatable.
This property is read-only.
See Also
Folder class: Description property, Label property.
Description
This property returns the name of the owner for this folder as a string.
This property is read-write.
Description
This property returns the parent folder name for this folder as a string. This property is valid only if the folder is contained within another folder. If the folder using this property is the root folder, this property returns an empty string.
This property is read-only.
Description
The Path property returns a path to this folder, with each element of the path separated by a period. The path has the following syntax:
FolderLabel{Name}.[ChildFolderLabel{Name}.]. . .
This property is read-only.
Example
Departments{PORTA_ROOT_OBJECT}.HR{EastCoast}.AdministerWorkforce{Global}
Description
This property returns a PermissionValue Collection. This collection contains the value of the non role-based permissions for this folder. To determine the permissions for all the parent objects (up to the root folder) use the CascadedPermissions property. To access the role-based permissions, use the RolePermissions property.
This property is read-only.
See Also
PermissionValue Collection, CascadedPermissions, RolePermissionValue Collection.
Description
This property returns or sets the PeopleSoft product for this folder as a string.
The length of this property is 4 characters.
This property is read-write.
Description
This property returns a RolePermissionValue Collection. This collection contains the value of the role-based permissions for this folder. To determine the role-based permissions for all the parent objects (up to the root folder) use the CascadedRolePermissions property. To access the non role-based permissions, use the Permissions property.
This property is read-only.
See Also
CascadedRolePermissions, Permissions, RolePermissionValue Collection.
Description
The sequence number is used when returning a collection. The default order of the returned folders is based on the sequence number. Use this property to reorder folders.
If there are duplicates in the sequence number, the folders are returned alphabetically.
The length of this property is 4 characters.
This property is read-write.
Description
This property indicates whether a folder is generally accessible, that is, if this property is set to True, any user can access the folder. This property is not cascaded.
This property takes a Boolean value.
The default value for this property for a newly created object is False.
This property is read-write.
Description
This property returns or sets the date this folder is valid from as a string.
This property is read-write.
Description
This property returns or sets the date this folder is valid until as a string.
This property is read-write.
Note. The PortalRegistry API never uses the ValidTo and ValidFrom fields to determine what to return in a collection. You must check for these values in your application.
The Folder Collection provides access to a collection of folders in a Folder object.
The Folder Collection is instantiated from the Folders Folder Class property.
See Folder class: Folders property.
In this section, we discuss the Folder collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(FolderName)
Description
The DeleteItem method deletes the folder object identified by FolderName from the database. If the folder contains other folders, all child folders and their contents are also deleted.
Warning! If you delete a folder, you delete all content in the folder. If you delete a folder that contains other folders, that is, a parent folder, all the child folders, and all the content references are deleted.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.
Parameters
FolderName |
Specify the name of a folder existing in the folder collection. |
Returns
A Boolean value: True if the folder was deleted, False otherwise.
Example
If Not &MyFolderColl.DeleteItem("MYFOLDER") Then /* Folder not deleted. Do error checking */ End-If;
Syntax
First()
Description
The First method returns the first Folder object in the folder collection.
Parameters
None.
Returns
Folder object.
Example
&MyFolder = &MyCollection.First();
Syntax
InsertItem(FolderName, Label)
Description
The InsertItem method inserts the folder object identified by FolderName from the Folder Collection. You must specify both a name and a label for all folders. This method returns a reference to the new folder object. You must specify a unique FolderName, or you receive an error.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted into the database as soon as the method is executed.
Parameters
FolderName |
Specify the name of a folder existing in the folder collection. This parameter takes a string value. |
Label |
Specify a label for the new folder. This parameter takes a string value. |
Returns
A reference to the new Folder object if the method executed successfully, null otherwise.
Example
&DeptHPFldr = &MyPortal.Folders.InsertItem("PORT0145", "HR Folder for Department 0145");
Syntax
ItemByName(Name)
Description
The ItemByName method returns the Folder object with the name Name.
Parameters
Name |
Specify the name of an existing folder within the folder collection. If you specify an invalid name, the object is NULL. You must specify a name, not a label. |
Returns
A folder object if successful, NULL otherwise.
Example
&DeptFldr = &MyPortal.RootFolder.Folders.ItemByName(&Dept_Name);
Syntax
Next()
Description
The Next method returns the next Folder object in the Folder collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A folder object.
Example
Local ApiObject &MySession, &Root, &Folders, &MyFolder; &MySession = %Session; &MyPortal = &MySession.GetPortalRegistry("ADMIN"); &Root = &MyPortal.GetRoot(); &Folders = &Root.Folders; &MyFolder = &Folders.First(); For &I = 1 to &Folders.Count /* Do processing on folders */ If &I <> &Folders.Count &MyFolder = &Folders.Next(); End-If; End-For;
In this section, we discuss the Count property.
Description
This property returns the number of Folder objects in the Folder Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The content reference class provides access to some kind of content. The type of content depends on the content reference.
The content reference objects are instantiated from other classes:
From a PortalRegistry object with the FindCRefByURL, FindCRefForURL, or FindCRefByName properties.
From a Content Reference Collection (instantiated from a folder) with the First, ItemByName or Next methods
See PortalRegistry class: FindCRefByURL method, FindCRefByName method, FindCRefForURL method, Content Reference Collection .
See Adding a Content Reference.
In this section, we discuss the Content Reference class methods. The methods are discussed in alphabetical order.
Syntax
CreateLink(LinkName, Label)
Description
Use the CreateLink method to create a link quickly to the same content reference executing the method. The link by defaults assumes the parent folder is the same as the content reference's parent.
A CReflink object is returned if there is no error.
After you create a link you must use the Save method to save it to the database.
Parameters
LinkName |
Specify the name of the link as a string. This parameter takes 30 characters. This is considered as ID of the link. It cannot start with number, and can not have special characters and spaces. |
Label |
Specify the label of the link as a string. This parameter takes 30 characters. |
Returns
A reference to a CRefLink object.
Example
&CRef = &Portal.FindCRefByName("MyCRef"); &Link = &CRef.CreateLink("Link Object"); &Link.Save();
See Also
Syntax
Save()
Description
The Save method saves any changes you made to the content reference, for example, a changed description. It also performs some validation.
Using this method also saves any changes you made to PermissionValue or AttributeValue objects associated with this content reference.
Parameters
None.
Returns
A Boolean value: True if the content reference and its associated objects saved successfully, False otherwise.
Example
If NOT(&MyCRef.Save()) Then /* save failed, do error processing */ End-If;
See Also
Save PortalRegistry method
Save Folder method
In this section, we discuss the Content Reference class properties. The properties are discussed in alphabetical order.
Description
This property returns the absolute content URL, that is, the content from the content servlet (psc).
This property is read-only.
Example
The following is an example absolute content URL:
http://serverx/psp/PS84/EMPLOYEEPORTAL/CRM/c/SFA.CUSTOMERINFO.GBL?page=CUST_DATA1&&Action=U&emplid=00001
Description
This property returns the absolute content reference portal URL.
This property is read-only.
Example
http://serverx/psp/PS84/EMPLOYEEPORTAL/CRM/c/SFA.CUSTOMERINFO.GBL?page=CUST_DATA1&&Action=U&emplid=00001
Description
This property returns an AssignedPagelet collection.
This property is read-only.
See Also
Description
This property returns an Attribute Collection containing the AttributeValues for this content reference object.
This property is read-only.
See Also
Description
This property returns the author (PeopleSoft user ID) for this content reference object as a string.
This property is read-only.
Description
This property specifies whether the author of the content reference has access to the content reference. This property takes a Boolean value. The default value for this property is True.
This property is read-write.
Description
This property specifies whether the user is authorized to view this content reference.
This property is used when you access a particular content reference using FindCRefByURL, FindCRefForURL, or FindCRefByName. If you specified a valid content reference with either of these methods, a content reference is always returned, whether you are authorized to view it or not. This is the only property you can view from an object for which you are not authorized.
The initial value of this property depends on the other permission properties (PublicAccess and AuthorAccess) and the permission list values in the PermissionValue object associated with this content reference.
This property is read-only.
See Also
PortalRegistry class: FindCRefByURL method, FindCRefForURL method, FindCRefByName method.
Description
This property returns a PermissionValue Collection. This collection contains the value of the non role-based permissions for all the parent objects (up to the root folder). To determine only the permissions of the object use the Permissions property instead. To access the role-based permissions, use the CascadedRolePermissions property.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions property. You can add values only to the collection returned by the Permissions property.
This property is read-only.
See Also
CascadedRolePermissions, PermissionValue Collection, Permissions.
Description
This property returns a RolePermissionValue Collection. This collection contains the value of the role-based permissions for all the parent objects (up to the root folder). To determine only the permissions of the object use the RolePermissions property instead. To determine non role-based permissions, use the CascadedPermissions property.
Note. You cannot add any RolePermissionValue objects to a collection returned by the CascadedRolePermissions property. You can add values only to the collection returned by the RolePermissions property.
This property is read-only.
See Also
CascadedRolePermissions, RolePermissions, RolePermissionValue Collection.
Description
This property returns or sets the name of the node for the content reference as a string.
This property takes the following values:
Value |
Description |
Node name |
Specify the exact name of the node. |
LOCAL_NODE |
Specify the node for the content reference as the node defined as the local node. |
This property is read-write.
Description
This property returns the creation date for this content reference object as a string.
This property is read-only.
Description
This property returns the data for this content reference. This property is valid only when the StorageType property is LOCL.
The length of this property depends on your system database limit for LONG fields.
This property is read-write.
Example
&MyData = &MyCRef.Data;
See Also
Content Reference class: StorageType property.
Description
This property returns or sets the description for this content reference object as a string.
The length of this property is 256 characters.
This property is translatable.
This property is read-write.
Description
This property returns the HTML text associated with this content reference as a string.
This property is read-only.
Description
This property returns True if this content reference is used with mobile applications, False otherwise.
This property is read-write.
Description
This property returns True if the Hide from Portal Navigation check box is not selected when the content reference is created. If the content reference is hidden from portal navigation, this property returns False.
Considerations Using IsVisible
If you do not specifically set this property on a new or copied content reference object, the IsVisible property is set as follows:
If the ValidFrom date is less then or equal to that day's date, the IsVisible property is set to True.
If there is no ValidTo date the IsVisible property is set to True.
If the ValidTo date is greater then or equal to that day's date, the IsVisible property is set to True.
This property is read-only.
See Also
Content Reference class: ValidFrom property, ValidTo property.
Description
This property returns or sets the label for this content reference object as a string.
The length of this property is 30 characters.
This property is translatable.
This property is read-write.
Description
This property returns a reference to a Link collection. This collection contains all the links that are associated with this content reference.
This property is read-only. However, a link collection is updated in realtime when a new link is created on the object.
See Also
Description
This property returns the name for this content reference object as a string. The name is a unique identifier for each content reference object.
Every content reference name must be unique in the portal, not just in the parent folder.
This property is read-only.
Description
This property returns or sets the owner ID of the content reference object as a string.
This property is read-write.
Description
This property returns the parent folder name for this content reference object as a string.
This property is read-only.
Example
The following example uses the ParentName to return a folder object for the content reference.
&Folder = &Portal.FindFolderByName(&CRef.ParentName);
Description
The Path property returns a path to this content reference, with each element of the path separated by a period. The path has the following syntax:
ContentReferenceLabel{Name}.[ChildContentReferenceLabel{Name}.]. . .
This property is read-only.
Description
This property returns a PermissionValue Collection. This collection contains the value of the non role-based permissions for this content reference. To determine the permissions for all the parent objects (up to the root folder) use the CascadedPermissions property.
If you want to find role-based permissions for the content reference, use the RolePermission property.
This property is read-only.
See Also
PermissionValue Collection, CascadedPermissions, RolePermissions.
Description
This property returns or sets the PeopleSoft product for this content reference object as a string.
The length of this property is 4 characters.
This property is read-write.
Description
This property indicates whether a content reference is generally accessible, that is, if it will always be included in the general content reference collection. This property takes a Boolean value.
The default value for this property is False.
This property is read-write.
Description
Note. This property is being kept for backward compatibility only. If your code uses this property, the value returned is actually from the AbsoluteContentURL property. New applications should use the AbsoluteContentURL property instead.
See Also
Content Reference class: AbsoluteContentURL property.
Description
This property returns the relative URL in the following format:
../../../Portal/Node/Content_Type/ContentID
For example, from the following URL:
http://mlee2038/servlets/psp/PS84/e_procurement/fdm/c/E_PRO.CheckOut.GBL?page=view&Setid=110&Custid=99
The RelativeURL returns the following:
e_procurement/fdm/c/E_PRO.CheckOut.GBL?page=view&Setid=110&Custid=99
This property is read-only.
Description
This property returns a RolePermissionValue Collection. This collection contains the value of the role-based permissions for this content reference. To determine the permissions for all the parent objects (up to the root folder) use the CascadedRolePermissions property.
If you want to find non role-based permissions for the content reference, use the Permission property.
This property is read-only.
See Also
CascadedRolePermissions, Permissions, RolePermissionValue Collection.
Description
The sequence number is used when returning a collection. The default order of the returned content references is based on the sequence number. Use this property to reorder content references. This property takes a number value.
If there are duplicates in the sequence number, the content references are returned alphabetically.
The length of this property is 4 characters.
This property is read-write.
Description
In general, content references contain information about where to get the content, and do not store the content. However, content references that are template or portal component types can have their content accessible directly from the content reference. In these cases, the Data property is valid and can be read or written, and the data is stored locally in the portal database.
StorageType |
Meaning |
LOCL |
Local: Data property on content reference is valid. |
RMTE |
Remote: Data property is not valid. |
When UsageType is a target this property must be set to RMTE and the URLType property should specify what format the Node and URL are in.
When UsageType is either a template or a portal component this property can be set to either LOCL or RMTE.
Note that when StorageType is LOCL, it specifies a static template or portal component. But, when StorageType is RMTE it can specify either:
a dynamically generated template or portal component
a static template or portal component
In both cases, the Node and URL properties specifies how to get the template or portal component.
Only templates and homepage tab content references can have StorageType LOCL. The StorageType is always LOCL for homepage tabs. For templates LOCL means that corresponding URL is stored in database, not retrieved by URL.
The following table indicates the usage type, and what type of storage is available.
UsageType |
RMTE |
LOCL |
FRMT (Frame template) |
X |
X |
HTMT (HTML template) |
X |
X |
HPGT (Homepage tab) |
X |
|
HPGC (Pagelet) |
X |
|
TARG (Target) |
X |
RMTE is the default value for a new content reference.
The length of this property is 4 characters.
This property is read-write.
See Also
Content Reference class: Data property.
Description
This property returns or sets the name of the template used with this content reference as a string. You must specify the name of an existing template.
This property uses the name not the label of a content reference.
This property is used only when the UsageType property is specified as Target (TARG) and the TemplateType property is specified as HTML.
To return a reference to the content reference that contains the template specified by this property, use the TemplateObject property.
The length of this property is 30 characters.
This property is read-write.
See Also
Content Reference class: UsageType property, TemplateType property, TemplateObject property.
Description
This property returns a reference to a content reference object that contains the template specified by the Template property as a content reference. If no template is specified with Template, this property returns NULL.
This property is read-only.
See Also
Content Reference class: Template property.
Description
This property indicates whether a template should be used to wrap the content. This property takes a string value.
Values are:
Value |
Description |
HTML |
An HTML template should wrap the data (URL) in the content reference. |
NONE |
No template should be used. The text should not be wrapped. |
HTML is the default value on a new content reference.
Use the NONE value if the URL should not appear in the portal. An example is when the content reference is a template itself.
If the homepage template for the user is un-retrievable, the system tries to use the default user's template first, before resorting to the portal default template.
When the content reference describes content, this property should be set to HTML.
This property is read-write.
See Also
Description
This property returns or sets the URL for this content reference object as a string. The URL returns exactlyas it appears in the database.
If you're setting a URL, you must use a unique URL.
The absolute URL, that is, the URL from the node concatenated with this URL must be unique.
You receive an error if the URL your use is already registered.
To retrieve a qualified URL, that is, one that contains the node URI, use the AbsoluteContentURL property.
The length of this property depends on your system database limit for LONG fields.
This property is read-write.
The format of the value for this property depends on the setting of other properties.
See Also
AbsoluteContentURL, Using Content References.
Description
This property indicates what kind of URL is used to retreive the content. This property takes a string value.
Note. This property is used only for content that has the StorageType property set as Remote.
Values are:
URLType Value |
Meaning |
UEXT |
URL points to a non-PeopleSoft (external) URL |
UMPG |
URL points to a PeopleSoft mobile page |
UPGE |
URL points to a component. |
UPHP |
URL points to a homepage tab |
UPTM |
URL points to a template |
USCR |
URL points to an iScript |
UGEN |
URL points to a generic PeopleSoft URL |
WRKL |
URL points to a Worklist URL |
UPGE is the default value on a new content reference.
This property is read-write.
See Also
Content Reference class: StorageType property.
Description
This property indicates what the content reference is used for. Several other properties depend on this property.
This property takes a string value.
The length of this property is 4 characters.
Value |
Description |
FRMT |
Frame template: the content reference is a frame-based template. |
HTMT |
HTML template: the content reference is an HTML template. |
HPGT |
Homepage tab: the content reference is a homepage tab. |
HPGC |
Pagelet: the content reference is a pagelet used in the homepage. |
TARG |
Target: the content reference is the target content its template determines what else must be loaded and how it will look. |
LINK |
Link: the content reference is a link. |
TARG is the default value on a new content reference.
This property is read-write.
See Also
Description
This property returns or sets the date this content reference is valid from as a string.
This property is read-write.
Description
This property returns or sets the date this content reference is valid until as a string.
This property is read-write.
Note. The PortalRegistry API never uses the ValidTo and ValidFrom fields to determine what to return in a collection. You must check for these values in your application.
The Content Reference Collection provides access to the collection of content references in a Folder object.
The Content Reference Collection is instantiated from the ContentRefs Folder property.
See Folder class: ContentRefs property.
In this section, we discuss the Content Reference collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(ContentReferenceName)
Description
The DeleteItem method deletes the content reference object identified by ContentReferenceName from the content reference Collection.
If you delete a template for a content reference, and none of the other content references on a page have a template, the default template specified with the ContentProvider is used. If there's no template for the ContentProvider, the template for the PortalRegistry is used. However, if you delete the template for the content reference, the ContentProvider, and the PortalRegistry, you receive a runtime error.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.
Parameters
ContentReferenceName |
Specify the name of a content reference existing in the content reference collection. |
Returns
A Boolean value: True if the content reference was deleted, False otherwise.
Example
If Not &MyCRef.DeleteItem("Test_CRef") Then /* can't delete test data. Do error processing */ End-if;
Syntax
First()
Description
The First method returns the first content reference object in the content reference collection.
Parameters
None.
Returns
A content reference object.
Example
&MyCRef = &MyCollection.First();
Syntax
InsertItem(ContentReferenceName, ContentReferenceLabel, Node, URL)
Description
The InsertItem method inserts the content reference object identified by ContentReferenceName into the content reference Collection.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted into the database as soon as the method is executed.
Parameters
ContentReferenceName |
Specify the name of a new content reference. This parameter takes a string value. If you specify a name that already exists in the collection, you get an error. |
ContentReferenceLabel |
Specify a description of the new content reference. This is the translated value. This parameter takes a string value. |
Node |
Specify a node. This parameter takes a string value. If you specify a fully qualified value for URL, you can specify a NULL (that is, two quotation marks with no space between them ("")). |
URL |
Specify a URL that contains the content. The format of this parameter depends on other properties, such as the type of content reference, where the data is stored, and so on. |
Returns
A reference to the new content reference object if the method executed successfully, NULL otherwise.
Example
The following example inserts an external content reference that is a template:
&URL = "t/" | &ITEMNAME; &MyCRef = &CRefColl.InsertItem(&ITEMNAME, &ITEMLABEL, "", &URL);
The following example inserts a content reference where URLType is iScript (USCR):
&URL = "s/WEBLIB_PORTAL.FieldFormula.Portal_Trans_Dyn" &MyCRef = &CRefColl.InsertItem(&ITEMNAME, &ITEMLABEL, "HRMS", &URL);
See Also
Syntax
ItemByName(Name)
Description
The ItemByName method returns the content reference object with the name Name.
Parameters
Name |
Specify the name of an existing content reference within the content reference collection. If you specify an invalid name, the object is NULL. |
Returns
A content reference object if successful, NULL otherwise.
Example
&MyCRef = &CRefColl.ItemByName("PORTAL_ADMIN);
Syntax
Next()
Description
The Next method returns the next content reference object in the content reference collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
content reference object.
Example
&MyCRef = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of content reference objects in the content reference Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The AttributeValue class provides access to attributes associated with either folders or content references.
AttributeValue objects are instantiated from an Attribute Collection Methods with the First, InsertItem, ItemByName, or Next methods.
See Attribute Collection Methods.
See Using Attributes.
In this section, we discuss the AttributeValue class properties. The properties are discussed in alphabetical order.
Description
This property returns the label of the AttributeValue as a string. This property works with the Translatable property. If Translatable is set to True, the value of Label can be translated.
The length of this property is 30 characters.
This property is read-write.
See Also
AttributeValue class: Translatable property.
Description
This property returns the name of the AttributeValue as a string.
The length of this property is 30 characters.
This property is read-only.
Example
&AttrColl = &Folder.Attributes; &Attr = &AttrColl.First(); &Scroll = GetLevel0().GetRow(1).GetRowset(Scroll.PORTAL_FLDR_ATR); &I = 1; While All(&Attr) &Record = &Scroll.GetRow(&I).GetRecord(Record.PORTAL_FLDR_ATR); &Record.PORTAL_ATTR_NAM.Value = &Attr.Name; &Record.PORTAL_ATTR_VAL.Value = &Attr.Value; &Attr = &AttrColl.Next(); /* need this check so we don't insert extra blank row */ If All(&Attr) Then &Scroll.InsertRow(&I); &I = &I + 1; End-If; End-While;
Description
This property specifies if the AttributeValue is translatable. This property takes a Boolean value: True if the AttributeValue can be translated, False otherwise.
If this property is set to True, the value of the Label property can be translated.
Note. Regardless of the order in which attributes were entered, they are ordered according to their translatable property, that is, attributes that have this property set as True come first, followed by attributes that have this property set as False.
This property is read-write.
See Also
AttributeValue class: Label property.
Description
This property returns the value of the AttributeValue as a string.
The length of this property depends on your system database limit for LONG fields.
This property is read-write.
Example
To specify more than a single value for an AttributeValue, you can specify several values separated by a semicolon. For example:
&MyAtt.value = "401k;benefits;dependants;HR";
The Attribute Collection provides access to the collection of Attribute in a Folder or a content reference object.
An Attribute Collection is instantiated from other classes as follows:
From a content reference object with the Attributes property.
From a Folder object with the Attributes property.
From a PageletCategory object with the Attributes property.
From a Pagelet object with the Attributes property.
See Content Reference class: Attributes property.
See Folder class: Attributes property.
See PageletCategory class: Attributes property.
See Pagelet class: Attributes property.
In this section, we discuss the Attribute collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(AttributeValueName)
Description
The DeleteItem method deletes the AttributeValue object identified by AttributeValueName from the Attribute Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
AttributeValueName |
Specify the name of an AttributeValue existing in the Attribute Collection. |
Returns
A Boolean value: True if the AttributeValue was deleted, False otherwise.
Syntax
First()
Description
The First method returns the first AttributeValue object in the Attribute Collection.
Parameters
None.
Returns
An AttributeValue object.
Example
&MyAttributeValue = &MyCollection.First();
Syntax
InsertItem(AttributeValueName)
Description
The InsertItem method inserts the AttributeValue object identified by AttributeValueName from the Attribute Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
AttributeValueName |
Specify the name of an AttributeValue existing in the Attribute Collection. |
Returns
A reference to the new AttributeValue object if the method executed successfully, NULL otherwise.
Example
For &I = 1 To &Rowset.ActiveRowCount If &CompName = "PORTAL_CREF_ADM" Then &Record = &Rowset.GetRow(&I).GetRecord(Record.PORTAL_CATR_DV); Else &Record = &Rowset.GetRow(&I).GetRecord(Record.PORTAL_FATR_DV); End-If; If &Record.PORTAL_ATTR_NAM.Value <> "" Then &Attr = &AttrColl.InsertItem(&Record.PORTAL_ATTR_NAM.Value); &Attr.Value = &Record.PORTAL_ATTR_VAL.Value; End-If; End-For;
Syntax
ItemByName(Name)
Description
The ItemByName method returns the AttributeValue object with the name Name.
Parameters
Name |
Specify the name of an existing AttributeValue within the Attribute Collection. If you specify an invalid name, the object is NULL. |
Returns
An AttributeValue object if successful, NULL otherwise.
Example
&Attr = &AttrColl.ItembyName("RELLINK");
Syntax
Next()
Description
The Next method returns the next AttributeValue object in the Attribute Collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
AttributeValue object.
Example
&MyAttributeValue = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of AttributeValue objects in the Attribute Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The PermissionValue provides access to permission lists associated with folders, content references, PageletCategory objects, or Pagelets.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions or CascadedRolePermissions property. You can add values only to the collection returned by the Permissions or RolePermissions property.
PermissionValue objects are instantiated from the following:
A PermissionValue Collection with the First, InsertItem, ItemByName, or Next methods.
A RolePermissionValue Collection with the First, InsertItem, ItemByName, or Next methods.
See PermissionValue Collection.
See Using Security.
See Setting Permissions Using the PermissionValue Object.
In this section we discuss the Cascade and Name properties.
Description
This property indicates whether the current permission should be granted to all child folders.
This property is valid only with folders, not with content references.
This property takes a Boolean value. The default value for a new PermissionValue object is False.
This property is read-write.
Description
Specify the name of a permission list as the name of this object. You must specify a permission list that has already been created. This property takes a string value.
The length of this property is 30 characters.
This property is read-write.
Description
Specify the type of the permission. Values are:
Value |
Description |
P |
Specify a non role-based permission. |
R |
Specify a role-based permission. |
This property is read-write.
See Also
RolePermissionValue Collection, PermissionValue Collection.
A PermissionValue collection is returned by the following:
CascadedPermissions and Permissions folder property
CascadedPermissions and Permissions content reference property
CascadedPermissions and Permissions PageletCategory object property
CascadedPermissions and Permissions Pagelet property
What is contained in the PermissionValue collection depends on the property that created it.
See Folder class: CascadedPermissions property, Permissions property.
See Content Reference class: CascadedPermissions property, Permissions property.
See PageletCategory class: CascadedPermissions property, Permissions property.
See Pagelet class: CascadedPermissions property, Permissions property.
See Using Security.
In this section, we discuss the PermissionValue collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(PermissionValueName)
Description
The DeleteItem method deletes the PermissionValue object identified by PermissionValueName from the PermissionValue Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
PermissionValueName |
Specify the name of a PermissionValue existing in the PermissionValue collection. |
Returns
A Boolean value: True if the PermissionValue was deleted, False otherwise.
Example
If Not &MyPValColl.DeleteItem("ALLPNLS") Then /* do error processing */ End-If;
Syntax
First()
Description
The First method returns the first PermissionValue object in the PermissionValue collection.
Parameters
None.
Returns
A PermissionValue object.
Example
&MyPermissionValue = &MyCollection.First();
Syntax
InsertItem(PermissionValueName)
Description
The InsertItem method inserts the PermissionValue object identified by PermissionValueName into the PermissionValue Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions property. You can only add values to the collection returned by the Permissions property.
Parameters
PermissionValueName |
Specify the name of an existing permission list. |
Returns
A reference to the new PermissionValue object if the method executed successfully, NULL otherwise.
Example
&MyPermV = &MyPermVColl.InsertItem("ALLPNLS"); If Not &MyPermV Then /* do error processing */ End-If;
Syntax
ItemByName(Name)
Description
The ItemByName method returns the PermissionValue object with the name Name.
Parameters
Name |
Specify the name of an existing PermissionValue within the PermissionValue collection. If you specify an invalid name, the object is NULL. |
Returns
A PermissionValue object if successful, NULL otherwise.
Example
&MyPVal = &MyPValColl.ItemByName("CUSTOMER");
Syntax
Next()
Description
The Next method returns the next PermissionValue object in the PermissionValue collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
PermissionValue object.
Example
&MyPermissionValue = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of PermissionValue objects in the PermissionValue Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
A RolePermissionValue collection is returned by the following:
CascadedRolePermissions and RolePermissions folder property
See Folder class: CascadedRolePermissions property.
See Folder class: RolePermissions property.
CascadedRolePermissions and RolePermissions content reference property
See Content Reference class: CascadedRolePermissions property.
See Content Reference class: RolePermissions property.
CascadedRolePermissions and RolePermissions content reference link property
See Content Reference Link class: CascadedRolePermissions property.
See Content Reference Link class: RolePermissions property.
What is contained in the RolePermissionValue collection depends on the property that created it.
In this section, we discuss the RolePermissionValue collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(RolePermissionValueName)
Description
The DeleteItem method deletes the RolePermissionValue object identified by RolePermissionValueName from the RolePermissionValue Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
RolePermissionValueName |
Specify the name of a RolePermissionValue existing in the RolePermissionValue collection. |
Returns
A Boolean value: True if the RolePermissionValue was deleted, False otherwise.
Example
If Not &MyPValColl.DeleteItem("ALLPNLS") Then /* do error processing */ End-If;
Syntax
First()
Description
The First method returns the first RolePermissionValue object in the RolePermissionValue collection.
Parameters
None.
Returns
A RolePermissionValue object.
Example
&MyRolePermissionValue = &MyCollection.First();
Syntax
InsertItem(RolePermissionValueName)
Description
The InsertItem method inserts the RolePermissionValue object identified by RolePermissionValueName into the RolePermissionValue Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Note. You cannot add any RolePermissionValue objects to a collection returned by the CascadedRolePermissions property. You can only add values to the collection returned by the RolePermissions property.
Parameters
RolePermissionValueName |
Specify the name of an existing role permission list. |
Returns
A reference to the new RolePermissionValue object if the method executed successfully, NULL otherwise.
Example
&MyPermV = &MyPermVColl.InsertItem("ALLPNLS"); If Not &MyPermV Then /* do error processing */ End-If;
Syntax
ItemByName(Name)
Description
The ItemByName method returns the RolePermissionValue object with the name Name.
Parameters
Name |
Specify the name of an existing RolePermissionValue within the RolePermissionValue collection. If you specify an invalid name, the object is NULL. |
Returns
A RolePermissionValue object if successful, NULL otherwise.
Example
&MyPVal = &MyPValColl.ItemByName("CUSTOMER");
Syntax
Next()
Description
The Next method returns the next RolePermissionValue object in the RolePermissionValue collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
RolePermissionValue object.
Example
&MyRolePermissionValue = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of RolePermissionValue objects in the RolePermissionValue Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
A content reference link is a content reference object that delegates most of its properties to another content reference. It has its own separate properties, as well as a reference to the linked cref.
A content reference link is instantiated from the following:
CreateLink content reference method
CreateContentRefLink PortalRegistry method
Note. The CreateLink method creates a new link. To instantiate an existing link use the FindLinkByName method.
See Also
In this section, we discuss the content reference link methods. The methods are discussed in alphabetical order.
Syntax
Delete()
Description
Use the delete method to delete the link from the database.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The link is not marked for deletion, then actually deleted later. The link is deleted from the database as soon as the method is executed.
Parameters
None.
Returns
A Boolean value: True if the content reference link and its associated objects are deleted successfully, False otherwise.
Syntax
Save()
Description
The Save method saves any changes you made to the content reference link, for example, a changed description or ValidFrom date.
After you create a link using either the CreateLink or CreateContentRefLink methods you must use the Save method to save the link to the database.
Using this method also saves any changes you made to PermissionValue or AttributeValue objects associated with this content reference link.
Parameters
None.
Returns
A Boolean value: True if the content reference link and its associated objects saved successfully, False otherwise. If False is returned, a message is also written to the PSMessage collection.
Example
If NOT(&MyCRefLink.Save()) Then /* save failed, do error processing */ End-If;
In this section, we discuss the content reference link properties. The properties are discussed in alphabetical order.
Description
This property returns the absolute content URL, that is, the content from the content servlet (psc). The content is displayed without any portal template.
This property is read-only.
Example
The following is an example absolute content URL:
http://serverx/psc/PS84/EMPLOYEEPORTAL/CRM/c/SFA.CUSTOMERINFO.GBL?page=CUST_DATA1&&Action=U&emplid=00001
Description
This property returns the absolute content reference link portal URL. This URL also contains the content in the portal template.
This property is read-only.
Example
http://serverx/psp/PS84/EMPLOYEEPORTAL/CRM/c/SFA.CUSTOMERINFO.GBL?page=CUST_DATA1&&Action=U&emplid=00001
Description
This property returns an Attribute Collection containing the AttributeValues for this content reference link object.
This property is read-write.
See Also
Description
This property returns the author (PeopleSoft user ID) for this content reference link as a string.
This property is read-only.
Description
This property specifies whether the author of the content reference link has access to the content reference link. This property takes a Boolean value. The default value for this property is true.
This property is read-write.
Description
This property specifies whether the user is authorized to view this content reference link.
This property is used when you access a particular content reference link using FindCRefLinkByURL. If you specified a valid content reference link, a content reference link is always returned, whether you are authorized to view it or not. This is the only property you can view from an object that you are not authorized tom and the content reference is empty.
The initial value of this property depends on the other permission properties (PublicAccess and AuthorAccess) and the permission list values in the PermissionValue object associated with this content reference link.
This property is read-only.
See Also
Description
This property returns a PermissionValue Collection. This collection contains the value of the permissions for all the parent objects (up to the root folder). To determine only the permissions of the object use the Permissions property instead.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions property. You can add values only to the collection returned by the Permissions property.
This property is read-only.
See Also
PermissionValue Collection, Permissions.
Description
This property returns a RolePermissionValue Collection. This collection contains the value of the role-based permissions for all the parent objects (up to the root folder). To determine only the permissions of the object use the RolePermissions property instead. To determine the non role-based permissions of the object use the Permissions property instead.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedRolePermissions property. You can add values only to the collection returned by the RolePermissions property.
This property is read-only.
See Also
CascadedRolePermissions, RolePermissions, RolePermissionValue Collection.
Description
This property returns the name of the node for the content reference link as a string.
This property is read-only.
Description
This property returns the creation date for this content reference link object as a string.
This property is read-only.
Description
This property returns the data for this content reference link. This property is valid only when the StorageType property is LOCL.
The length of this property depends on your system database limit for LONG fields.
This property is read-write.
Example
&MyData = &MyCReflink.Data;
See Also
Content Reference class: StorageType property.
Description
This property returns or sets the description for this content reference link object as a string.
The length of this property is 256 characters.
This property is translatable.
This property is read-write.
Description
This property returns True if this content reference link is used with mobile applications, False otherwise.
This property is read-write.
Description
This property returns True if the Hide from Portal Navigation check box is not selected when the content reference link is created. If the content reference link is hidden from portal navigation, this property returns False. Also, if the date associated with the link is not valid (is not within the valid to and valid from dates,) this property returns False.
Considerations Using IsVisible
If you do not specifically set this property on a new or copied content reference link, the IsVisible property is set as follows:
If the ValidFrom date is less then or equal to that day's date, the IsVisible property is set to True.
If there is no ValidTo date the IsVisible property is set to True.
If the ValidTo date is greater then or equal to that day's date, the IsVisible property is set to True.
This property is read-only.
See Also
Content Reference class: ValidFrom property, ValidTo property.
Description
This property returns or sets the label for this content reference link object as a string.
The length of this property is 30 characters.
This property is translatable.
This property is read-write.
Description
This property returns the name for this content reference link object as a string. The name is a unique identifier for each content reference link object. The name cannot start with a number, and it cannot have spaces and special characters.
Every content reference link name must be unique in the portal, not just in the parent folder.
This property is read-write.
Description
This property returns or sets the owner ID of the content reference link object as a string.
This property is read-write.
Description
This property returns the parent folder name for this content reference link object as a string.
You can use this property to move the content reference link to another folder.
This property is read-write.
Example
The following example uses the ParentName to return a folder object for the content reference link.
&Folder = &Portal.FindFolderByName(&CReflink.ParentName);
Description
The Path property returns a path to this content reference link, with each element of the path separated by a period. The path has the following syntax:
Root{PORTAL_ROOT_OBJECT}.LinkFolder {<Id of links folder>}.CrefLink {<Id of the cref link> }
This property is read-only.
Description
This property returns a PermissionValue Collection. This collection contains the value of the non role-based permissions for this content reference link. To access the role-based permissions, use the RolePermissions property.
This property is read-only.
See Also
PermissionValue Collection, CascadedPermissions, RolePermissions.
Description
This property returns or sets the PeopleSoft product for this content reference link object as a string.
The length of this property is 4 characters.
This property is read-write.
Description
This property specifies whether the link is public or private. This property takes a Boolean value: true if the content reference link is public and there are no permission lists associated with it. If it is false, the link uses permission list control.
For links, this values is same as that of the linked content reference. If the content reference is public, the link is public and can be viewed by anyone logged on to the system.
This property is read-only.
Description
This property returns the relative URL in the following format:
../../../Portal/Node/Content_Type/ContentID
For example, from the following URL:
http://mlee2038/servlets/psp/PS84/e_procurement/fdm/c/E_PRO.CheckOut.GBL?page=view&Setid=110&Custid=99
The RelativeURL returns the following:
e_procurement/fdm/c/E_PRO.CheckOut.GBL?page=view&Setid=110&Custid=99
This property is read-only.
Description
This property returns a RolePermissionValue Collection. This collection contains the value of the role-based permissions for this content reference link. To access the non role-based permissions, use the Permissions property.
This property is read-only.
See Also
CascadedRolePermissions, Permissions, RolePermissionValue Collection.
Description
The sequence number is used when returning a collection. The default order of the returned content reference links is based on the sequence number. Use this property to reorder content reference links. This property takes a number value.
If there are duplicates in the sequence number, the content reference links are returned alphabetically.
The length of this property is 4 characters.
This property is read-write.
Description
This property returns or sets the name of the template used with this content reference link as a string. You must specify the name of an existing template.
This property uses the name, not the label, of a content reference link.
This property is used only when the UsageType property is specified as Target (TARG) and the TemplateType property is specified as HTML.
To return a reference to the content reference link that contains the template specified by this property, use the TemplateObject property.
The length of this property is 30 characters.
This property is read-write.
See Also
Content Reference class: UsageType property, TemplateType property, TemplateObject property.
Description
This property returns a reference to a content reference link object that contains the template specified by the Template property as a content reference link. If no template is specified with Template, this property returns a null value.
This property is read-only.
See Also
Content Reference class: Template property.
Description
This property indicates whether a template should be used to wrap the content. This property takes a string value.
Values are:
Value |
Description |
HTML |
An HTML template should wrap the data (URL) in the content reference. |
NONE |
No template should be used. The text should not be wrapped. |
HTML is the default value on a new content reference.
Use the NONE value if the URL should not appear in the portal. An example is when the content reference link is a template itself.
If the homepage template for the user is un-retrievable, the system tries to use the default user's template first, before resorting to the portal default template.
When the content reference link describes content, this property should be set to HTML.
This property is read-write.
See Also
Description
This property returns the URL for this content reference link object as a string. The content reference link derives the URL from the content reference it is linked to. The URL of the link is same as that of the linked content reference.
A query string value is added on the content reference URL to make the link unique. If the URL of the linked content reference changes, this URL is changed.
This property is read-only.
See Also
AbsoluteContentURL, Using Content References.
Description
This property returns what kind of URL is used to retreive the content.
This property is read-only.
See Also
Content Reference class: StorageType property.
Description
This property returns what the content reference link is used for.
The value for this property is same as that of the content reference when the link is vieved as a content reference.
The usage type of the link is LINK in the database.
A content reference link can be created only for content references that have a type of TARG.
This property is read-only.
See Also
Description
This property returns or sets the date this content reference link is valid from as a string.
This property is read-write.
Description
This property returns or sets the date this content reference link is valid until as a string.
This property is read-write.
Note. The PortalRegistry API never uses the ValidTo and ValidFrom fields to determine what to return in a collection. You must check for these values in your application.
A Links collection is returned by the Links content reference property.
See Also
In this section, we discuss the link collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first link object in the link collection.
Parameters
None.
Returns
A link object.
Syntax
Next()
Description
The Next method returns the next link object in the collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A link object.
In this section, we discuss the link collection property Count.
Description
This property returns the number of link objects in the link collection, as a number.
This property is read-only.
A Link object is returned by the First and Next Link collection methods.
See Also
In this section, we discuss the link properties. The properties are discussed in alphabetical order.
Description
This property returns the object name of the link as a string.
This property is read-only.
Description
This property returns the object type as a string. Valid value is CONTENTREF.
This property is read-only.
Description
This property returns the name of the portal from which the link originated.
This property is read-only.
The TabDefinition class provides access to the homepage tab defined for the portal.
TabDefinition objects are instantiated from a TabDefinition Collection with the First, InsertItem, ItemByName, or Next methods.
In this section, we discuss the Save method.
Syntax
Save()
Description
The Save method saves any changes you made to the TabDefinition, for example, a changed description. It also performs some validation.
Using this method also saves any changes you made to DynamicCategories and AssignedPagelets objects associated with this TabDefinition.
Parameters
None.
Returns
A Boolean value: True if the TabDefinition and its associated object saved successfully, False otherwise.
Example
If NOT(&MyTabDefn.Save()) Then /* save failed, do error processing */ End-If;
See Also
Save PortalRegistry method
Save Folder method
Save ContentReference method
In this section, we discuss the TabDefinition class properties. The properties are discussed in alphabetical order.
Description
This property returns a reference to an AssignedPagelet Collection for this TabDefinition object.
This property is read-only.
See Also
Description
This property returns a reference to an AvailableCategory Collection for this TabDefinition object.
This property is read-only.
See Also
Description
This property returns a reference to an AvailablePagelet Collection for this TabDefinition object.
This property is read-only.
See Also
Description
This property returns an Attribute Collection containing the AttributeValues for this TabDefinition object.
This property is read-only.
See Also
Description
This property returns the author (PeopleSoft user ID) for this TabDefinition object as a string.
This property is read-only.
Description
This property specifies whether the author of the TabDefinition has access to the TabDefinition. This property takes a Boolean value. The default value for this property is True.
This property is read-write.
Description
This property indicates whether the tab layout is for two or three columns. This property takes a string value.
The values for this property are:
Value |
Description |
2 |
Two-column table |
3 |
Three-column table |
This property is read-write.
Description
This property returns the creation date for this TabDefinition object as a string.
This property is read-only.
Description
This property returns or sets the description for this TabDefinition object as a string.
The length of this property is 256 characters.
This property is translatable.
This property is read-write.
Description
This property returns a reference to a DynamicCategory Collection for this TabDefinition object.
This property is read-only.
See Also
Description
This property returns the help system identifier for this tab. It enables the help system to provide tab-specific help. This property takes a string value.
This property is read-write.
Description
This property returns the HTML text associated with this tab definition as a string.
This property is read-only.
Description
This property hides all pagelet action bar images for all pagelets used on this tab. This property overrides any properties for the pagelets used on this tab. This property takes a Boolean value: True, hide images, False, display images
This property is read-write.
Description
This property indicates whether the user can change the tab's default number of columns. This property takes a Boolean value: True, the user can change the tab columns, False, the columns can't be changed by the user.
This property is read-write.
Description
This property indicates whether the tab's label can be changed by the user. This property takes a Boolean value: True, the user can change the label, False, the user can't.
This property is read-write.
Description
This property returns or sets the label for this TabDefinition object as a string.
The length of this property is 30 characters.
This property is translatable.
This property is read-write.
Description
This property indicates whether the user can change when and how the tab displays. This property takes a string value.
The values are:
Value |
Description |
4OPT |
The user can choose to add this tab to their homepage. It doesn't show up by default. |
3DEF |
The user sees this tab the first time they log in, however, they can remove this tab if they'd like. |
2REQ |
The user can't remove this tab from their homepage. However, they are allowed to change its sequence or order on the page. |
1FIX |
The user can't remove this tab or change its position on the page. |
This property is read-write.
Description
This property returns the name for this TabDefinition object as a string. The name is a unique identifier for each TabDefinition object.
Every TabDefinition name must be unique in the portal, not just in the parent folder.
This property is read-only.
Description
This property returns or sets the owner ID of the TabDefinition object as a string.
This property is read-write.
Description
This property returns or sets the PeopleSoft product for this TabDefinition object as a string.
The length of this property is 4 characters.
This property is read-write.
Description
This property indicates whether a TabDefinition is generally accessible, that is, if it is always included in the general TabDefinition collection. This property takes a Boolean value.
The default value for this property is False.
This property is read-write.
Description
This property returns an absolute URL. If the TabDefinition has a ContentProvider associated with it, the URI from the ContentProvider is concatenated with the URL from the TabDefinition. If there is no ContentProvider, this property returns the text in the URL property.
This property is read-only.
See Also
Content Reference class: URL property.
Description
The sequence number is used when returning a collection. The default order of the returned TabDefinitions is based on the sequence number. Use this property to reorder TabDefinitions. This property takes a number value.
If there are duplicates in the sequence number, the TabDefinitions are returned alphabetically.
The length of this property is 4 characters.
This property is read-write.
Description
This property defines the style sheet to use for this tab. This property takes a string value. This property is 30 characters long.
If no style sheet is specified, the default style sheet PSSTYLEDEF is used.
This property is read-write.
Description
This property returns or sets the date this TabDefinition is valid from as a string.
This property is read-write.
Description
This property returns or sets the date this TabDefinition is valid until as a string.
This property is read-write.
Note. The PortalRegistry API never uses the ValidTo and ValidFrom fields to determine what to return in a collection. You must check for these values in your application.
A TabDefinition collection is the collection of all TabDefinitions for a portal.
A TabDefinition collection is returned by the TabDefinitions PortalRegistry property.
See PortalRegistry class: TabDefinitions property.
This section describes the TabDefinition collection methods in alphabetical order.
Syntax
DeleteItem(TabDefinitionName)
Description
The DeleteItem method deletes the TabDefinition object identified by TabDefinitionName from the TabDefinition Collection.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.
Parameters
TabDefinitionName |
Specify the name of a TabDefinition existing in the TabDefinition collection. |
Returns
A Boolean value: True if the TabDefinition was deleted, False otherwise.
Example
If Not &MyColl.DeleteItem("TabDefnTest") Then /* do error processing */ End-If;
Syntax
First()
Description
The First method returns the first TabDefinition object in the TabDefinition collection.
Parameters
None.
Returns
A TabDefinition object.
Example
&MyTabDefinition = &MyCollection.First();
Syntax
InsertItem(TabDefinitionName)
Description
The InsertItem method inserts the TabDefinition object identified by TabDefinitionName into the TabDefinition Collection.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted into the database as soon as the method is executed.
Parameters
TabDefinitionName |
Specify the name of an existing permission list. |
Returns
A reference to the new TabDefinition object if the method executed successfully, NULL otherwise.
Example
&MyTabDef = &MyColl.InsertItem("Empl_Homepage"); If Not &MyTabDef Then /* do error processing */ End-If;
Syntax
ItemByName(Name)
Description
The ItemByName method returns the TabDefinition object with the name Name.
Parameters
Name |
Specify the name of an existing TabDefinition within the TabDefinition collection. If you specify an invalid name, the object is NULL. |
Returns
A TabDefinition object if successful, NULL otherwise.
Example
&MyTebDefn = &MyColl.ItemByName("Empl_Homepage");
Syntax
Next()
Description
The Next method returns the next TabDefinition object in the TabDefinition collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
TabDefinition object.
Example
&MyTabDefinition = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of TabDefinition objects in the TabDefinition Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
An AssignedPagelet is a pagelet object that has been assigned to a particular tab. This pagelet also contains the layout data that is specific to the pagelet and tab.
AssignedPagelet objects are instantiated from an AssignedPagelet Collection with the First, InsertItem, ItemByName, or Next methods.
See AssignedPagelet Collection.
In this section, we discuss the AssignedPagelet class properties. The properties are discussed in alphabetical order.
Description
This property returns the column in which this pagelet is displayed, as a number.
This property is read-write.
Description
This property indicates whether the user can change when and how the pagelet displays. This property takes a string value.
The values are:
Value |
Description |
4OPT |
The user can choose to add this pagelet to their tab. It doesn't show up by default. The user can remove and reposition this pagelet on the tab. |
3DEF |
The user sees this pagelet the first time they log in, however, they can remove or reposition this pagelet if they'd like. |
2REQ |
The user can't remove this pagelet from the tab. However, they are allowed to reposition the pagelet on the tab. |
1FIX |
The user can't remove this pagelet or change its position on the tab. |
This property is read-write.
Description
This property returns the name for this Pagelet object as a string. The name is a unique identifier for each Pagelet object.
This property is read-only.
Description
This property returns the row in which this pagelet is displayed, as a number.
This property is read-write.
An AssignedPagelet collection is returned by the AssignedPagelet TabDefinition method.
It contains a collection of all the pagelets explicitly assigned to the tab.
See TabDefinition class: AssignedPagelets property.
In this section, we discuss the AssignedPagelet collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(PageletName)
Description
The DeleteItem method deletes the AssignedPagelet object identified by PageletName from the AssignedPagelet Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
PageletName |
Specify the name of an AssignedPagelet existing in the AssignedPagelet collection. |
Returns
A Boolean value: True if the AssignedPagelet was deleted, False otherwise.
Example
If Not &MyColl.DeleteItem("Weather_411") Then /* do error processing */ End-If;
Syntax
First()
Description
The First method returns the first AssignedPagelet object in the AssignedPagelet collection.
Parameters
None.
Returns
An AssignedPagelet object.
Example
&MyAssignedPagelet = &MyCollection.First();
Syntax
InsertItem(PageletName, Column, Row, LayoutBehavior)
Description
The InsertItem method inserts the AssignedPagelet object identified by the parameters into the AssignedPagelet Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
PageletName |
Specify the name of the pagelet that you want to insert. |
Column |
Specify the column that you want this pagelet to display in, as a number. |
Row |
Specify the row that you want this pagelet to display in, as a number. You can specify a zero if you don't know which row. |
LayoutBehavior |
Specify whether the user can change when and how the pagelet displays. This property takes a string value. The values are: |
Value |
Description |
4OPT |
The user can choose to add this pagelet to their tab. It doesn't show up by default. The user can remove and reposition this pagelet on the tab. |
3DEF |
The user sees this pagelet the first time they log in, however, they can remove or reposition this pagelet if they'd like. |
2REQ |
The user can't remove this pagelet from the tab. However, they are allowed to reposition the pagelet on the tab. |
1FIX |
The user can't remove this pagelet or change its position on the tab. |
Returns
A reference to the new AssignedPagelet object if the method executed successfully, NULL otherwise.
Example
&MyPagelet = &MyColl.InsertItem("Weather_411"); If Not &MyPagelet Then /* do error processing */ End-If;
Syntax
ItemByName(Name)
Description
The ItemByName method returns the AssignedPagelet object with the name Name.
Parameters
Name |
Specify the name of an existing AssignedPagelet within the AssignedPagelet collection. If you specify an invalid name, the object is NULL. |
Returns
An AssignedPagelet object if successful, NULL otherwise.
Example
&MyPagelet = &MyColl.ItemByName("Dictionary");
Syntax
Next()
Description
The Next method returns the next AssignedPagelet object in the AssignedPagelet collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
An AssignedPagelet object.
Example
&MyAssignedPagelet = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of AssignedPagelet objects in the AssignedPagelet Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
An AvailableCategory class is composed of a category name and an AvailablePagelet Collection, that is, a collection of all the available pagelets associated with that category.
AvailableCategory objects are instantiated from an AvailableCategory Collection with the First, ItemByName, or Next methods.
See AvailableCategory Collection.
In this section, we discuss the AvailableCategory class properties. The properties are discussed in alphabetical order.
Description
This property returns a reference to an AvailablePagelet Collection associated with the specified CategoryName.
This property is read-only.
See Also
Description
Use this property to return the name of a category to be associated with the TabDefinition, as a string.
This property is read-only.
An AvailableCategory is composed of a category name and an AvailablePagelet Collection, that is, a collection of all the available pagelets associated with that category.
An AvailableCategory collection is returned by the AvailableCategories TabDefinition property.
See AvailableCategory Collection.
In this section, we discuss the AvailableCategory collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first AvailableCategory object in the AvailableCategory collection.
Parameters
None.
Returns
An AvailableCategory object.
Example
&MyAvailableCategory = &MyCollection.First();
Syntax
ItemByName(Name)
Description
The ItemByName method returns the AvailableCategory object with the name Name.
Parameters
Name |
Specify the name of an existing AvailableCategory within the AvailableCategory collection. If you specify an invalid name, the object is NULL. |
Returns
An AvailableCategory object if successful, NULL otherwise.
Example
&MyCat = &MyColl.ItemByName("Dictionary");
Syntax
Next()
Description
The Next method returns the next AvailableCategory object in the AvailableCategory collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
AvailableCategory object.
Example
&MyAvailableCategory = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of AvailableCategory objects in the AvailableCategory Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
An AvailablePagelet is a pagelet object can be assigned to a particular tab. This includes all pagelets from the dynamic categories, and assigned pagelets. Each pagelet also contains the layout data that is specific to that pagelet.
AvailablePagelet objects are instantiated from an AvailablePagelet Collection with the First, ItemByName, or Next methods.
See AvailablePagelet Collection.
In this section, we discuss the AvailablePagelet class properties. The properties are discussed in alphabetical order.
Description
This property turns the label of the category to which the pagelet is assigned, as a string.
This property is read-only.
Description
This property returns the name of the category to which the pagelet is assigned, as a string.
This property is read-only.
Description
This property returns the column in which this pagelet is displayed, as a number.
This property is read-only.
Description
This property indicates whether the user can change when and how the pagelet displays. This property takes a string value.
The values are:
Value |
Description |
4OPT |
The user can choose to add this pagelet to their tab. It doesn't show up by default. The user can remove and reposition this pagelet on the tab. |
3DEF |
The user sees this pagelet the first time they log in, however, they can remove or reposition this pagelet if they'd like. |
2REQ |
The user can't remove this pagelet from the tab. However, they are allowed to reposition the pagelet on the tab. |
1FIX |
The user can't remove this pagelet or change its position on the tab. |
This property is read only.
Description
This property returns the label for this property as a string.
This property is read-only.
Description
This property returns the name for this Pagelet object as a string. The name is a unique identifier for each Pagelet object.
This property is read-only.
Description
This property returns the row in which this pagelet is displayed, as a number.
This property is read-only.
An AvailablePagelet collection is returned by the AvailablePagelet TabDefinition method.
It contains a collection of all the pagelets that could be assigned to the tab. It's an aggregation of the pagelets in the AssignedPagelets collection and all the pagelets in each of the categories in the DynamicCategories collection. Pagelet category sequence numbers, followed by pagelet sequence numbers, then name, sort this collection.
If you have two pagelets assigned with the same name (that is, an assigned pagelet and a dynamic category pagelet), the assigned pagelet takes precedence over the dynamic category one, and is the only one listed.
See TabDefinition class: AvailablePagelets property.
In this section, we discuss the AvailablePagelet collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first AvailablePagelet object in the AvailablePagelet collection.
Parameters
None.
Returns
An AvailablePagelet object.
Example
&MyAvailablePagelet = &MyCollection.First();
Syntax
ItemByName(Name)
Description
The ItemByName method returns the AvailablePagelet object with the name Name.
Parameters
Name |
Specify the name of an existing AvailablePagelet within the AvailablePagelet collection. If you specify an invalid name, the object is NULL. |
Returns
An AvailablePagelet object if successful, NULL otherwise.
Example
&MyPagelet = &MyColl.ItemByName("DICTIONARY");
Syntax
Next()
Description
The Next method returns the next AvailablePagelet object in the AvailablePagelet collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
AvailablePagelet object.
Example
&MyAvailablePagelet = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of AvailablePagelet objects in the AvailablePagelet Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
A DynamicCategory collection contains a collection of PageletCategory names associated with a TabDefinition. The collection is initially ordered by category name.
When a PageletCategory is dynamic, it is immediately available to an end-user.
A DynamicCategory Collection is instantiated by the DynamicCategories property of a TabDefinition.
See TabDefinition class: DynamicCategories property.
In this section, we discuss the DynamicCategory collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(Name)
Description
The DeleteItem method deletes the PageletCategory object identified by Name from the DynamicCategory Collection. This does not delete the PageletCategory from the database, just from the DynamicCategory collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Note. If you delete a DynamicCategory, tabs with the attribute PORTAL_HPTAB_DYN lists must be searched for and updated (if necessary) to reflect the deleted category.
Parameters
Name |
Specify the name of an existing category in the DynamicCategory collection. |
Returns
A Boolean value: True if the PageletCategory was deleted from the DynamicCategory collection, False otherwise.
Example
If Not &MyColl.DeleteItem("Dictionaries") Then /* do error processing */ End-If;
Syntax
First()
Description
The First method returns the name of the first PageletCategory in the DynamicCategory collection.
Parameters
None.
Returns
A string.
Example
&MyDynamicCategory = &MyCollection.First();
Syntax
InsertItem(Name)
Description
The InsertItem method inserts the PageletCategory object identified by Name into the DynamicCategory Collection. This does not insert the PageletCategory into the database, just into the DynamicCategory collection. After a PageletCategory is marked as dynamic, it is immediately available to the end-user.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
Name |
Specify the name of the DynamicCategory to insert. |
Returns
A string containing the name of the new DynamicCategory object if the method executed successfully, Null otherwise.
Example
&MyCat = &MyColl.InsertItem("User_Info");
Syntax
ItemByName(Name)
Description
The ItemByName method returns the name of the PageletCategory object with the name Name.
Parameters
Name |
Specify the name of an existing DynamicCategory within the DynamicCategory collection. If you specify an invalid name, this method returns a Null string. |
Returns
A string.
Example
&MyPagelet = &MyColl.ItemByName("Dictionary");
Syntax
Next()
Description
The Next method returns the name of the next PageletCategory object in the DynamicCategory collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A string.
Example
&MyDynamicCategory = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of PageletCategory names in the DynamicCategory Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
A PageletCategory is a group of related pagelets, such as Weather, News, Reference, and so on. Each PageletCategory has a collection of pagelets associated with it.
A PageletCategory is instantiated from a PageletCategory Collection with the First, InsertItem, ItemByName, or Next methods.
All PageletCategory objects that are dynamic are contained in the DynamicCategory collection. The methods from this collection return the names of the PageletCategory objects only, not references to the objects themselves.
See PageletCategory Collection.
In this section, we discuss the Save method.
Syntax
Save()
Description
The Save method saves any changes you made to the PageletCategory, for example, a changed description or sequence number.
Parameters
None.
Returns
A Boolean value: True if the PageletCategory object is successfully saved, False otherwise.
Example
If Not(&MyPageletCategory.Save()) Then /* do error checking */ End-If;
See Also
Save PortalRegistry method
Save Folder method
In this section, we discuss the PageletCategory class properties. The properties are discussed in alphabetical order.
Description
This property returns an Attribute Collection containing the AttributeValues for this PageletCategory object.
This property is read-only.
See Also
Description
This property returns the author (PeopleSoft user ID) for this PageletCategory as a string.
This property is read-only.
Description
This property specifies whether the author of the PageletCategory has access to the PageletCategory. This property takes a Boolean value. The default value for this property for a newly created object is True. This property is not cascaded.
This property is read-write.
Description
This property specifies whether the user is authorized to view this PageletCategory.
The initial value of this property depends on the other permission properties (PublicAccess and AuthorAccess) and the permission list values in the PermissionValue object associated with this PageletCategory.
This property is read-only.
Description
This property returns a PermissionValue Collection. This collection contains the value of the permissions for all the child and parent objects (up to the root PageletCategory). To determine only the permissions of the object use the Permission property instead.
Note. The PORTAL_PAGELETS folder is the parent folder for all PageletCategories. Its security is set to public. PeopleSoft does not recommend cascading any permissions from this folder object. Cascade permissions only from the pagelet category (folder). You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions property. You can add values only to the collection returned by the Permissions property.
This property is read-only.
See Also
PermissionValue Collection, Permissions.
Description
This property returns the creation date for this PageletCategory as a string.
This property is read-only.
Description
This property returns or sets the description for this PageletCategory as a string.
The length of this property is 256 characters.
This property is translatable.
This property is read-write.
Description
This property returns or sets the label for this PageletCategory as a string.
The length of this property is 30 characters.
This property is translatable.
This property is read-write.
Description
This property returns the name for this PageletCategory as a sting. The name is a unique identifier for each PageletCategory.
Every PageletCategory name must be unique in across the portal, not just in the parent PageletCategory.
This property is not translatable. However, the values for the Label and Desrciption properties are translatable.
This property is read-only.
See Also
PageletCategory class: Label property.
Description
This property returns or sets the owner ID of the PageletCategory object as a string.
This property is read-write.
Description
This property returns a reference to a Pagelet Collection for this PageletCategory.
This property is read-only.
See Also
Description
This property returns a PermissionValue Collection. This collection contains the value of the permissions for this PageletCategory.
Note. The PORTAL_PAGELETS folder is the parent folder for all PageletCategories. Its security is set to public. PeopleSoft does not recommend cascading any permissions from this folder object. Cascade permissions only from the pagelet category (folder).
This property is read-only.
See Also
Description
This property returns or sets the PeopleSoft product for this PageletCategory as a string.
The length of this property is 4 characters.
This property is read-write.
Description
This property indicates whether a PageletCategory is generally accessible, that is, if this property is set to True, any user can access the PageletCategory. This property is not cascaded.
This property takes a Boolean value.
The default value for this property for a newly created object is False.
This property is read-write.
Description
The sequence number is used when returning a collection. The default order of the returned PageletCategory objects is based on the sequence number. Use this property to reorder PageletCategory objects.
If there are duplicates in the sequence number, the PageletCategory objects are returned in alphabetical order.
The length of this property is 4 characters.
This property is read-write.
The PageletCategory Collection provides access to a collection of PageletCategory objects in a PageletCategory object.
The PageletCategory Collection is instantiated from the PageletCategories PortalRegistry property.
See PortalRegistry class: PageletCategories property.
In this section, we discuss the PageletCategory collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(PageletCategoryName)
Description
The DeleteItem method deletes the PageletCategory object identified by PageletCategoryName from the database.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.
Parameters
PageletCategoryName |
Specify the name of a PageletCategory existing in the PageletCategory collection. |
Returns
A Boolean value: True if the PageletCategory was deleted, False otherwise.
Example
If Not &MyPageletCategoryColl.DeleteItem("MYPAGELETCATEGORY") Then /* PageletCategory not deleted. Do error checking */ End-If;
Syntax
First()
Description
The First method returns the first PageletCategory object in the PageletCategory collection.
Parameters
None.
Returns
PageletCategory object.
Example
&MyPageletCategory = &MyCollection.First();
Syntax
InsertItem(PageletCategoryName, Label)
Description
The InsertItem method inserts the PageletCategory object identified by PageletCategoryName from the PageletCategory Collection. You must specify both a name and a label for each PageletCategory. This method returns a reference to the new PageletCategory object. You must specify a unique PageletCategoryName, or you receive an error.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted into the database as soon as the method is executed.
Parameters
PageletCategoryName |
Specify the name of a PageletCategory existing in the PageletCategory collection. This parameter takes a string value. |
Label |
Specify a label for the new PageletCategory. This parameter takes a string value. |
Returns
A reference to the new PageletCategory object if the method executed successfully, False otherwise.
Syntax
ItemByName(Name)
Description
The ItemByName method returns the PageletCategory object with the name Name.
Parameters
Name |
Specify the name of an existing PageletCategory within the PageletCategory collection. If you specify an invalid name, the object is NULL. You must specify a name, not a label. |
Returns
A PageletCategory object if successful, NULL otherwise.
Syntax
Next()
Description
The Next method returns the next PageletCategory object in the PageletCategory collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A PageletCategory object.
In this section, we discuss the PageletCategory collection properties. The properties are discussed in alphabetical order.
Description
This property returns the number of PageletCategory objects in the PageletCategory Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
A pagelet represents a URL that renders a section of content for a homepage. Pagelets are assigned to specific categories.
A pagelet is instantiated from the First, InsertItem, ItemByName, and Next Pagelet Collection methods.
See Pagelet Collection.
In this section, we discuss the Save method.
Syntax
Save()
Description
The Save method saves any changes you made to the Pagelet, for example, a changed description or sequence number.
Parameters
None.
Returns
A Boolean value: True if the Pagelet object is successfully saved, False otherwise.
Example
If Not(&MyPagelet.Save()) Then /* do error checking */ End-If;
See Also
Save PortalRegistry method
Save ContentReference method
Save PageletCategory method
In this section, we discuss the Pagelet class properties. The properties are discussed in alphabetical order.
Description
This property returns an Attribute Collection containing the AttributeValues for this pagelet object.
This property is read-only.
See Also
Description
This property returns the author (PeopleSoft user ID) for this pagelet object as a string.
This property is read-only.
Description
This property specifies whether the author of the pagelet has access to the pagelet. This property takes a Boolean value. The default value for this property is True.
This property is read-write.
Description
This property specifies whether the user is authorized to view this pagelet.
The initial value of this property depends on the other permission properties (PublicAccess and AuthorAccess) and the permission list values in the PermissionValue object associated with this pagelet.
This property is read-only.
Description
This property returns a PermissionValue collection. This collection contains the value of the permissions for all the parent objects (up to the root folder). To determine only the permissions of the object use the Permission property instead.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions property. You can add values only to the collection returned by the Permissions property.
This property is read-only.
See Also
PermissionValue Collection, Permissions.
Description
This property returns or sets the name of the node for the pagelet as a string.
If no node was specified when the pagelet was created, this property returns Null.
This property is read-write.
Description
This property returns the creation date for this pagelet object as a string.
This property is read-only.
Description
This property returns or sets the default column this pagelet displays in. This property takes a number value.
The default value for this property is 1.
This property is read-write.
Description
This property returns or sets the description for this pagelet object as a string.
The length of this property is 256 characters.
This property is translatable.
This property is read-write.
Description
This is the node part of the URL to the page that enables a user to personalize a page. The default value is an empty string.
This property is read-write.
Description
This is the query string part of the URL to the page that enables a user to personalize a page. The default value for this property is an empty string.
This property is read-write.
Description
This property returns the help system identifier for this pagelet. It enables the help system to provide pagelet specific help. This property takes a string value.
This property is read-write.
Description
This property specifies if the minimize image icon displays. This property takes a Boolean value: True, display the icon, False, hide the icon. The default value is True.
This property is read-write.
Description
This property returns or sets the label for this pagelet object as a string.
The length of this property is 30 characters.
This property is translatable.
This property is read-write.
Description
This property returns the name for this pagelet object as a string. The name is a unique identifier for each pagelet object.
Every pagelet name must be unique in the portal, not just in the parent folder.
This property is not translatable. However, the values for the Label and Description properties are.
This property is read-only.
Description
This property returns or sets the owner ID of the pagelet object as a string.
This property is read-write.
Description
This property returns the parent folder name for this pagelet object as a string.
This property is read-write.
Description
This property returns a PermissionValue Collection. This collection contains the value of the permissions for this pagelet. To determine the permissions for all the parent objects (up to the root folder) use the CascadedPermissions property.
This property is read-only.
See Also
PermissionValue Collection, CascadedPermissions.
Description
This property returns or sets the PeopleSoft product for this pagelet object as a string.
The length of this property is 4 characters.
This property is read-write.
Description
This property indicates whether a pagelet is generally accessible, that is, if it will always be included in the general pagelet collection. This property takes a Boolean value.
The default value for this property is False.
This property is read-write.
Description
This property returns an absolute URL. If the pagelet has a node associated with it, the URI from the node is concatenated with the URL from the pagelet. If there is no ContentProvider, this property returns the text in the URL property.
This property is read-only.
See Also
Content Reference class: URL property.
Description
The sequence number is used when returning a collection. The default order of the returned pagelets is based on the sequence number. Use this property to reorder pagelets. This property takes a number value.
If there are duplicates in the sequence number, the pagelets are returned alphabetically.
The length of this property is 4 characters.
This property is read-write.
Description
This property returns or sets the URL for this pagelet object as a string. The URL returns exactly as it appears in the database.
If you're setting a URL, you must use a unique URL.
The absolute URL, that is, the URL from the ContentProvider concatenated with this URL must be unique.
You receive an error if the URL you use is already registered.
To retrieve a qualified URL, that is, one that contains the node URI, use the AbsoluteContentURL property.
The length of this property depends on your system database limit for LONG fields.
The format of the value for this property depends on the setting of other properties.
This property is read-write.
Description
This property indicates what kind of PeopleCode definition is used to retrieve the content of the pagelet. This property takes a string value.
Values are:
URLType Value |
Meaning |
UEXT |
URL points to a non-PeopleSoft (external) URL |
UPGE |
URL points to a component. |
UGEN |
URL points to a generic PeopleSoft URL |
USCR |
URL points to an iScript |
UPGE is the default value on a new pagelet.
This property is read-write.
The Pagelet Collection provides access to the collection of pagelets in a category.
The Pagelet Collection is instantiated from the Pagelets PageletCategory property.
See PageletCategory class: Pagelets property.
In this section, we discuss the Pagelet collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(PageletName)
Description
The DeleteItem method deletes the pagelet object identified by PageletName from the pagelet Collection.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.
Parameters
PageletName |
Specify the name of a pagelet existing in the pagelet collection. |
Returns
A Boolean value: True if the pagelet was deleted, False otherwise.
Example
If Not &MyColl.DeleteItem("Test_Pagelet") Then /* can't delete test data. Do error processing */ End-if;
Syntax
First()
Description
The First method returns the first pagelet object in the pagelet collection.
Parameters
None.
Returns
A reference to a pagelet object if successful, NULL otherwise.
Example
&MyCRef = &MyCollection.First();
Syntax
InsertItem(PageletName, Label, NodeName, URL)
Description
The InsertItem method inserts the pagelet object identified by PageletName into the pagelet Collection.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted into the database as soon as the method is executed.
Parameters
PageletName |
Specify the name of a new pagelet. This parameter takes a string value. If you specify a name that already exists in the collection, you receive an error. |
Label |
Specify the label for the new pagelet. This parameter takes a string value. |
NodeName |
Specify a node. This parameter takes a string value. If you specify a fully qualified URL, you can specify a Null (that is, two quotation marks with no space between them ("")). |
URL |
Specify a URL that contains the content. The format of this parameter depends on other properties, such as the type of pagelet, where the data is stored, and so on. |
Returns
A reference to the new pagelet object if the method executed successfully, NULL otherwise.
See Also
Syntax
ItemByName(Name)
Description
The ItemByName method returns the pagelet object with the name Name.
Parameters
Name |
Specify the name of an existing pagelet within the pagelet collection. If you specify an invalid name, the object will be NULL. |
Returns
A reference to a pagelet object if successful, NULL otherwise.
Example
&MyPagelet = &CRefColl.ItemByName("PORTAL_ADMIN);
Syntax
Next()
Description
The Next method returns the next pagelet object in the pagelet collection. You can only use this method after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A reference to a pagelet object if successful, NULL otherwise.
Example
&MyPagelet = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of pagelet objects in the pagelet Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The UserHomepage represents a homepage for a user. It contains all the tabs and pagelets the user has selected for their homepage.
A UserHomepage is instantiated from the Homepage PortalRegistry property.
See PortalRegistry class: Homepage property.
In this section, we discuss the Save method.
Syntax
Save()
Description
The Save method saves any changes you made to the UserHomepage, for example, a changed greeting.
Using this method also saves any changes you've made to any UserTab or SelectedPagelet objects associated with this UserHomepage.
Parameters
None.
Returns
A Boolean value: True if the UserHomepage object is successfully saved, False otherwise.
Example
If Not(&MyHP.Save()) Then /* do error checking */ End-If;
See Also
Save PortalRegistry class method
Save Folder class method
In this section, we discuss the UserHomepage properties. The properties are discussed in alphabetical order.
Description
This property is a user-definable message that appears on their homepage when they login, such as "My Homepage" or "Welcome." This property takes a text string. The length of this character is 254.
This property is read-write.
Description
This property returns the UserId for this UserHomepage as a string.
This property is read-only.
Description
This property returns a reference to a UserTab collection.
This property is read-only.
See Also
A UserTab is a personalized tab for a specific user. This user can potentially change the pagelets that appear on the tab, the name of the tab, and the order of the tab. All these changes can be allowed or denied on the TabDefinitions Class. The UserTab is used in place of the TabDefinition whenever a user has personalized a tab.
A UserTab object is instantiated from the First, ItemByName, InsertItem, or Next UserTab Collection methods.
See UserTab Collection.
In this section, we discuss the UserTab class properties. The properties are discussed in alphabetical order.
Description
This property specifies how many columns the UserTab contains. This property takes a numeric value. The values are:
Value |
Description |
2 |
Two-column layout |
3 |
Three-column layout. This is the default value. |
This property is read-write.
Description
This property returns or sets the label for this UserTab object as a string. This value is initially set to the Label of the TabDefinition.
The length of this property is 30 characters.
This property is translatable.
This property is read-write.
Description
This property returns an absolute URL as a string. This URL includes the URI from the TabDefinition's node and the URL that points to the actual content of the tab.
This property is read-only.
Description
This property returns a SelectedPagelets Collection, containing the pagelets that have been selected by the user to appear on this tab.
This property is read-only.
See Also
Description
This property specifies the order that this tab should appear as on the homepage. This property takes a number value. This value is initially set by the referenced TabDefinition.
This property is read-write.
Description
This property returns the tab name as a sting.
This property is read-only.
The UserTab collection is the collection of personalized tabs for a user.
The UserTab Collection is instantiated from the UserTabs UserHomepage property.
See UserHomepage class: UserTab property.
In this section, we discuss the UserTab collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(UserTabName)
Description
The DeleteItem method deletes the UserTab object identified by UserTabName from the UserTab Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
UserTabName |
Specify the name of a UserTab existing in the UserTab collection. |
Returns
A Boolean value: True if the UserTab was deleted, False otherwise.
Example
If Not &MyColl.DeleteItem("Test_UserTab") Then /* can't delete test data. Do error processing */ End-if;
Syntax
First()
Description
The First method returns the first UserTab object in the UserTab collection.
Parameters
None.
Returns
A UserTab object.
Example
&MyUserTab = &MyCollection.First();
Syntax
InsertItem(UserTabName)
Description
The InsertItem method inserts the UserTab object identified by UserTabName into the UserTab Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
The new user tab must be unique within the portal.
Parameters
UserTabName |
Specify the name of a new UserTab. This parameter takes a string value. If you specify a name that already exists in the collection, you get an error. |
Returns
A reference to the new UserTab object if the method executed successfully, NULL otherwise.
Syntax
ItemByName(Name)
Description
The ItemByName method returns the UserTab object with the name Name.
Parameters
Name |
Specify the name of an existing UserTab within the UserTab collection. If you specify an invalid name, the object is NULL. |
Returns
A UserTab object if successful, NULL otherwise.
Example
&MyUserTab = &MyColl.ItemByName("PORTAL_ADMIN");
Syntax
Next()
Description
The Next method returns the next UserTab object in the UserTab collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A UserTab object.
Example
&MyUserTab = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of UserTab objects in the UserTab Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
The SelectedPagelet class contains data on pagelets selected by the user that display on this tab.
A SelectedPagelet object is instantiated by the First, InsertItem, ItemByName, and Next SelectedPagelet Collection methods.
See SelectedPagelet Collection.
In this section, we discuss the SelectedPagelet class properties. The properties are discussed in alphabetical order.
Description
This property returns the category of the pagelet as a string.
This property is read-only.
Description
This property returns the number of the column the pagelet displays in, as a number.
The values are:
Value |
Description |
1 |
First column |
2 |
Second column |
3 |
Third column |
This property is read-write.
Description
This property specifies whether the pagelet is displayed minimized. This property takes a Boolean value: True, the pagelet is minimized, False otherwise.
This property is read-write.
Description
This property returns the name of the pagelet as a string.
This property is read-only.
Description
This property specifies which row the pagelet is displayed in, as a number.
This property is read-write.
The SelectedPagelet collection contains a collection of all the selected pagelets for a tab.
A SelectedPagelet collection is instantiated by the SelectedPagelets UserTab property.
See UserTab class: SelectedPagelets property.
In this section, we discuss the SelectedPagelet collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(SelectedPageletName)
Description
The DeleteItem method deletes the SelectedPagelet object identified by SelectedPageletName from the SelectedPagelet Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
SelectedPageletName |
Specify the name of a SelectedPagelet existing in the SelectedPagelet collection. |
Returns
A Boolean value: True if the SelectedPagelet was deleted, False otherwise.
Example
If Not &MyColl.DeleteItem("Test_SelectedPagelet") Then /* can't delete test data. Do error processing */ End-if;
Syntax
First()
Description
The First method returns the first SelectedPagelet object in the SelectedPagelet collection.
Parameters
None.
Returns
A SelectedPagelet object.
Example
&MySelectedPagelet = &MyCollection.First();
Syntax
InsertItem(SelectedPageletName, Column, Row)
Description
The InsertItem method inserts the SelectedPagelet object identified by SelectedPageletName into the SelectedPagelet Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
SelectedPageletName |
Specify the name of a new SelectedPagelet. This parameter takes a string value. If you specify a name that already exists in the collection, you get an error. |
Column |
Specify the column number for this pagelet. |
Row |
Specify the row number for this pagelet. |
Returns
A reference to the new SelectedPagelet object if the method executed successfully, NULL otherwise.
Syntax
ItemByName(Name)
Description
The ItemByName method returns the SelectedPagelet object with the name Name.
Parameters
Name |
Specify the name of an existing SelectedPagelet within the SelectedPagelet collection. If you specify an invalid name, the object is NULL. |
Returns
A SelectedPagelet object if successful, NULL otherwise.
Example
&MySelectedPagelet = &MyColl.ItemByName("PORTAL_ADMIN");
Syntax
Next()
Description
The Next method returns the next SelectedPagelet object in the SelectedPagelet collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A SelectedPagelet object.
Example
&MySelectedPagelet = &MyCollection.Next();
In this section, we discuss the Count property.
Description
This property returns the number of SelectedPagelet objects in the SelectedPagelet Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count;
A favorite represents a content reference the user wants to keep a shortcut to. It contains the name of the content reference and the label the user wants to see displayed for this favorite. Labels must be unique in each favorite collection.
Use the Save method of the Favorite class to save any changes you made to any favorite objects.
A favorite object is instantiated by the First, InsertItem, ItemByName, and Next Favorite Collection methods.
See Favorite Collection.
In this section, we discuss the Favorite class properties. The properties are discussed in alphabetical order.
Description
This property returns the name of the content reference as a string.
This property is read-only.
Description
This property specifies the description of the favorite that's displayed to the user. This label must be unique for the favorite collection.
This property is read-write.
Description
This property returns the qualified URL for the content reference based on the Node and the URL for the name of the content reference, as a string.
This property is read-only.
Description
This property returns the sequence number used to order favorites.
This property is read-write.
Description
This property returns the relative URL for this favorite as a string.
For example, the following code:
&URL = &MyFavorite.URL;
could return the following string:
c/PORTAL_PERS_HOMEPAGE.PORTAL_HOMEPAGE.GBL?PORTALPARAM_PAGE=CONTENT&tab=DEFAULT&PortalFavorite=QEDMO
This property is read-write.
The favorite collection provides access to the favorites for a particular user.
A favorite collection is instantiated by the Favorites PortalRegistry property.
See PortalRegistry class: Favorites property.
In this section, we discuss the Favorite collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(FavoriteLabel)
Description
The DeleteItem method deletes the Favorite object identified by FavoriteLabel from the Favorite Collection.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.
Parameters
FavoriteLabel |
Specify the label of a Favorite existing in the Favorite collection, that is, the text used to identify the favorite to the end-user. |
Returns
A Boolean value: True if the Favorite was deleted, False otherwise.
Example
If Not &MyColl.DeleteItem("My Local Test") Then /* can't delete test data. Do error processing */ End-if;
Syntax
First()
Description
The First method returns the first Favorite object in the Favorite collection.
Parameters
None.
Returns
A Favorite object.
Example
&MyFav = &MyCollection.First();
Syntax
InsertItem(FavoriteLabel, FavoriteName)
Description
The InsertItem method inserts the Favorite object identified by FavoriteName into the Favorite Collection.
Note. The PortalRegistry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted to the database as soon as the method is executed.
Parameters
FavoriteLabel |
Specify a label for the new Favorite. This is the text by which the favorite is identified to the end-user. |
FavoriteName |
Specify the name of a new Favorite. This parameter takes a string value. If you specify a name that already exists in the collection, you get an error. |
Returns
A reference to the new Favorite object if the method executed successfully, NULL otherwise.
Syntax
ItemByLabel(FavoriteLabel)
Description
The ItemByLabel method returns the Favorite object with the label FavoriteLabel. The label is the text used to identify the favorite to the end-user.
Parameters
FavoriteLabel |
Specify the label of an existing Favorite within the Favorite collection. If you specify an invalid favorite, the object returned is Null. |
Returns
A Favorite object if successful, Null otherwise.
Example
&MyFavorite = &MyColl.ItemByLabel("My Local Login");
Syntax
Next()
Description
The Next method returns the next Favorite object in the Favorite collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.
Parameters
None.
Returns
A Favorite object.
Example
&MyFavorite = &MyCollection.Next();
Syntax
Save()
Description
Use the Save method to save any changes you made to the Favorite collection.
Parameters
None.
Returns
A Boolean value: True, the collection saved successfully, False otherwise.
In this section, we discuss the Count property.
Description
This property returns the number of Favorite objects in the Favorite Collection, as a number.
This property is read-only.
Example
&COUNT = &MY_COLLECTION.Count
There are several actions you may want to perform using a PortalRegistry, such as adding a folder, changing permissions, and so on. The following examples discuss the most common tasks. In addition, there are example programs of accessing the PortalRegistry classes using language environments other than PeopleCode.
This example shows how to change the default template used by a PortalRegistry. The following is the complete code sample: the steps explain each line.
Local ApiObject &MySession; Local ApiObject &MyPortal, &MyPortalColl; /* Access the current session */ &MySession = %Session; If NOT &MySession Then /* do error processing */ End-if; &MyPortalColl = &MySession.FindPortalRegistries(); For &I = 1 to &MyPortalColl.Count &MyPortal = &MyPortalColl.Item(&I); If &MyPortal.DefaultTemplate = "HR99" Then &MyPortal.DefaultTemplate = "HR00" &MyPortal.Save(); End-If End-For;
To change PortalRegistry properties:
Get a Session object.
Before you can access a PortalRegistry object, you must get a session object. The session controls access to the registry, provides error tracing, enables you to set the runtime environment, and so on. Because you want to use the existing session, use the %Session system variable (instead of the GetSession function.)
&MySession = %Session;
Get a PortalRegistry collection.
Use the FindPortalRegistries method with no parameters to return a collection of all the PortalRegistries because you want to check all the registries for the invalid template.
&MyPortalColl = &MySession.FindPortalRegistries();
Use the Count property on the collection to loop through all the registries.
For &I = 1 to &MyPortalColl.Count
Get a PortalRegistry object.
You can access a PortalRegistry object from the PortalRegistry collection using the Item method.
&MyPortal = &MyPortalColl.Item(&I);
Check for the invalid template and correct if necessary.
Use the DefaultTemplate property both to check for the invalid template name, and to set the correct template. Save the PortalRegistry when you make a correction.
If &MyPortal.DefaultTemplate = "HR99" Then &MyPortal.DefaultTemplate = "HR00" &MyPortal.Save(); End-If;
You may want to do error checking after you save the PortalRegistry.
The following example adds a ContentProvider to an existing PortalRegistry. The following is the complete code sample: the steps explain each line.
Local ApiObject &MyPortal; Local ApiObject &MyCPColl, &MyCProvider; &MyPortal = %Session.GetPortalRegistry(); If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if; /* Add a ContentProvider */ &MyCPColl = &MyPortal.ContentProviders; &MyCProvider = &MyCPColl.InsertItem("HRMS_00"); &MyCProvider.URI = "http://MYMACHINE103100/servlets/iclientservlet/HRMS/"; &MyCProvider.DefaultTemplate = "MYPORTAL_HRMS"; &MyCProvider.Description = "Updated Content Provider for HRMS"; If NOT(&MyPortal.Save()) Then &ErrorCol = &MySession.PSMessages; For &I = 1 to &ErrorCol.Count &Error = &ErrorCol.Item(&I); /* do error processing */ End-For; &ErrorCol.DeleteAll(); End-If;
To add a ContentProvider:
Get a Session object and a PortalRegistry.
Before you can access a PortalRegistry object, you must get a session object. The session controls access to the registry, provides error tracing, enables you to set the runtime environment, and so on. Because you want to use the existing session, use the %Session system variable (instead of the GetSession function.) In addition, you want to get a PortalRegistry. Using the GetPortalRegistry method returns a reference to an unpopulated PortalRegistry object.
&MyPortal = %Session.GetPortalRegistry();
Open the PortalRegistry.
After you get a PortalRegistry object, you want to open it, that is, populate it with data. Use the Open method to do this. The Open method returns a Boolean value, and this example uses that value to do error checking to make sure that the PortalRegistry is actually opened. In addition, the name of the PortalRegistry is kept in the record MYRECORD, in the field PORTAL_NAME.
If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if;
Access the ContentProvider collection.
You can only add a ContentProvider to a ContentProvider collection. So you must access a ContentProvider collection first, using the ContentProviders property on a PortalRegistry.
&MyCPColl = &MyPortal.ContentProviders;
Add the ContentProvider.
You must use the name of the ContentProvider with the InsertItem method. This example uses HRMS_00. This method does not execute automatically, that is, the ContentProvider isn't actually inserted into the database until the PortalRegistry is saved.
&MyCProvider = &MyCPColl.InsertItem("HRMS_00");
Further define the ContentProvider.
The URI of a ContentProvider is used in conjunction with content references to define the location of content. So you should define the URI. If a template isn't found for any of the content references on a page at runtime, the system next tries to use the DefaultTemplate defined for a ContentProvider, so you should define a default template.
&MyCProvider.URI = "http://MYMACHINE103100/servlets/iclientservlet/HRMS/"; &MyCProvider.DefaultTemplate = "MYPORTAL_HRMS"; &MyCProvider.Description = "Updated Content Provider for HRMS";
Save the PortalRegistry and check for errors.
Because there is no Save method with a ContentProvider, you must save the PortalRegistry to complete your changes.
You can check if there were any errors using the PSMessages property on the session object.
If NOT(&MyPortal.Save()) Then /* save didn’t complete */ &ErrorCol = &MySession.PSMessages; For &I = 1 to &ErrorCol.Count &Error = &ErrorCol.Item(&I); /* do error processing */ End-For; &ErrorCol.DeleteAll(); End-if;
If there are multiple errors, all errors are logged to the PSMessages collection, not just the first occurrence of an error. As you correct each error, delete it from the PSMessages collection.
Note. If you've called the PortalRegistry API an Application Engine program, all errors are also logged in the Application Engine error log tables.
See Error Handling.
The following example checks to see if a folder for a user exists. If it doesn't, it creates one.
The folder hierarchy for this example is as follows. The Users folder is where the portal stores things such as user homepages:
Root folder Users folder UserId1 folder UserId2 folder UserId3 folder . . .
The following is the complete code sample: the steps explain each line.
Local ApiObject &MyPortal; Local ApiObject &UserFldrColl, &UserFldr; &MyPortal = %Session.GetPortalRegistry(); If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if; &UserFldrColl = &MyPortal.RootFolder.Folders.ItemByName("Users").Folders; &UserFldr = &UserFldrColl.ItemByName(%UserId); If &UserFldr = Null Then /* add Folder */ &UserFldr = &UserFldrColl.InsertItem(%UserId, %UserId); &UserFldr.Description = %UserId; /* Set dates */ &UserFldr.ValidFrom = %Date; &ToDate = AddToDate(%Date, 1, 1, 0); &UserFldr.ValidTo = &ToDate; /* Set properties */ &UserFldr.PublicAccess = True; /* save the folder */ &UserFldr.Save(); End-If;
To add a folder:
Get a Session object and a PortalRegistry.
Before you can access a PortalRegistry object, you must get a session object. The session controls access to the registry, provides error tracing, enables you to set the runtime environment, and so on. Because you want to use the existing session, use the %Session system variable (instead of the GetSession function.) In addition, you want to get a PortalRegistry. Using the GetPortalRegistry method returns a reference to an unpopulated PortalRegistry object.
&MyPortal = %Session.GetPortalRegistry();
Open the PortalRegistry.
After you get a PortalRegistry object, you want to open it, that is, populate it with data. Use the Open method to do this. The Open method returns a Boolean value, and this example uses that value to do error checking to make sure that the PortalRegistry is actually opened. In addition, the name of the PortalRegistry is kept in the record MYRECORD, in the field PORTAL_NAME.
If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if;
Access the User folder collection.
One of the strengths of dot notation is being able to string together many methods and properties into a single line of code. The result of this single line of code is to return a reference to the folder collection within the Users folder.
&UserFldrColl = &MyPortal.RootFolder.Folders.ItemByName("Users").Folders;
Note that in this kind of code, you must access the RootFolder for the PortalRegistry before you can access the folders collection.
If there were additional folders in your hierarchy, you could continue in the same way, using ItemByName and Folders.
Check if the user already has a folder.
The system variable %UserId returns the user ID of the current user. Then this example uses the ItemByName method on the folder collection to see if the user already has a folder. This assumes that the user folders are names according to the UserId. The ItemByName method returns a reference to the folder if it exists. If the folder does not exist, ItemByName returns NULL.
&UserFldr = &UserFldrColl.ItemByName(%UserId); If &UserFldr = Null Then
Add a folder if one doesn't exist.
Use the UserId as the name of the folder, as well as for the label and the description.
&UserFldr = &UserFldrColl.InsertItem(%UserId, %UserId); &UserFldr.Description = %UserId;
Set the ValidFrom and ValidTo dates.
For this example, the folder should be accessible from the date it's created, so the example sets the ValidFrom property to be today's date.
When you first create a folder, the ValidTo date, that is, the date that this folder "expires", is set to null, that is an empty string. This means it never expires. In this example, we set the ValidTo date to one year and one day after the current date.
&UserFldr.ValidFrom = %Date; &ToDate = AddToDate(%Date, 1, 1, 0); &UserFldr.ValidTo = &ToDate;
Set permissions for the folder.
There are several properties that work together to determine the access of a folder or content reference. This example sets the PublicAccess property to True, which means that everyone has access to it, and it's included in all collections of folders.
&UserFldr.PublicAccess = True;
This example sets only the permission properties on the folder. It doesn't set all the possible permissions, such as the PermissionValue objects for the folder.
Save the folder.
After you have finished your changes to the folder, save it.
&UserFldr.Save();
You may want to check for errors after you save each folder.
See Using Security.
The following code example adds a content reference that's a target component to the Approve Expenses folder.
The folder hierarchy for this example is:
Root folder Expenses folder Create Expenses folder Review Expenses folder Approve Expenses folder
The following is the complete code sample: the steps explain each line.
Local ApiObject &MyPortal; Local ApiObject &CRef, &CRefColl; Local ApiObject &Fldr; &MyPortal = %Session.GetPortalRegistry(); If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if; &Fldr = &MyPortal.RootFolder.Folders.ItemByName("Expenses").Folders.ItemByName("Approve Expenses"); /* add content reference */ &CRef = &Fldr.ContentRefs.InsertItem(&CRefname, MYCP, MYRECORD.MYURL); &CRef.Description = &CRefname; /* Set dates */ &CRef.ValidFrom = %Date; &ToDate = AddToDate(%Date, 1, 1, 0); &CRef.ValidTo = &ToDate; /* Set content reference types */ &CRef.UsageType = "TARG"; /* Target content reference */ &CRef.URLType = "UPGE"; /* Component type of content reference */ &CRef.StorageType = "RMTE"; /* Template is remote. */ &CRef.Template = "EXPENSES_TEMPLATE"; /* name of template */ &CRef.TemplateType = "HTML"; /* type of Template */ /* Set URL */ &CRef.URL = "ICType=Panel&Menu=MANAGE_EXPENSES&Market=GBL&Component=APPROVE_FINAL" /* Save the content reference */ &CRef.Save();
To add a content reference:
Get a Session object and a PortalRegistry.
Before you can access a PortalRegistry object, you must get a session object. The session controls access to the registry, provides error tracing, enables you to set the runtime environment, and so on. Because you want to use the existing session, use the %Session system variable (instead of the GetSession function.) In addition, you want to get a PortalRegistry. Using the GetPortalRegistry method returns a reference to an unpopulated PortalRegistry object.
&MyPortal = %Session.GetPortalRegistry();
Open the PortalRegistry.
After you get a PortalRegistry object, you want to open it, that is, populate it with data. Use the Open method to do this. The Open method returns a Boolean value, and this example uses that value to do error checking to make sure that the PortalRegistry is actually opened. In addition, the name of the PortalRegistry is kept in the record MYRECORD, in the field PORTAL_NAME.
If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if;
Access the folder collection.
One of the strengths of dot notation is being able to string together many methods and properties into a single line of code. The result of this single line of code is to return a reference to the folder collection within the folder.
&Fldr = &MyPortal.RootFolder.Folders.ItemByName("Expenses").Folders.ItemByName("Approve Expenses");
The Adding a Folder example has more explanation on the break down of this line of code.
Add the content reference.
You can only add content references from the collection of content references for the folder. After you have the content reference collection, use the InsertItem method to add the content reference. The ContentProvider for this content reference is named MYCP. The URL is stored in the record MYRECORD in the field MYURL.
&CRef = &Fldr.ContentRefs.InsertItem(&CRefname, MYCP, MYRECORD.MYURL); &CRef.Description = &CRefname;
Note that the InsertItem method adds the content reference to the database as soon as it's executed. You could check for errors at this point to see if the content reference was added correctly.
Set the ValidFrom and ValidTo dates.
For this example, the content reference should be accessible from the date it's created, so the example sets the ValidFrom property to be today's date.
When you first create a content reference, the ValidTo date, that is, the date that this content reference "expires", is set to null, that is an empty string. This means it never expires. In this example, we set the ValidTo date to one year and one day after the current date.
&CRef.ValidFrom = %Date; &ToDate = AddToDate(%Date, 1, 1, 0); &CRef.ValidTo = &ToDate;
Set the type parameters.
Many content reference properties work together to set the type of content reference.
In this example, the content reference is a target. It's a component type of content reference, which means it's a PeopleSoft definition. The template to be used for displaying this content reference is stored remotely, its name is EXPENSES_TEMPLATE, and it's an HTML template.
&CRef.UsageType = "TARG"; /* Target content reference */ &CRef.URLType = "UPGE"; /* Component type of content reference */ &CRef.StorageType = "RMTE"; /* Template is remote. */ &CRef.Template = "EXPENSES_TEMPLATE"; /* name of template */ &CRef.TemplateType = "HTML"; /* type of Template */
Set the URL.
The URL property of the content reference indicates where the content actually is. As this content reference is referencing a page, the URL has a specific format to indicate which page.
&CRef.URL = "ICType=Panel&Menu=MANAGE_EXPENSES&Market=GBL&Component=APPROVE_FINAL"
Save the content reference.
After you have finished adding the content reference, you should save it.
&CRef.Save();
You may want to check for errors after you save each content reference.
See Adding a Folder.
The following code example adds permissions for a folder through the PermissionValue object.
The following is the complete code sample: the steps explain each line.
Local ApiObject &MyPortal; Local ApiObject &UserFldr; Local ApiObject &PermV, &PermVColl; &MyPortal = %Session.GetPortalRegistry(); If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if; &UserFldr = &MyPortal.RootFolder.Folders.ItemByName("Users"); &CascadedColl = &UserFldr.CascadedPermissions; &PermV = &CascadedColl.ItemByName("VENDOR1"); If NOT &PermV Then &PermVColl = &UserFldr.Permissions; &PermVColl.InsertItem("VENDOR1"); &UserFldr.Save(); End-If;
To set permissions for a folder, using the PermissionValue object:
Get a Session object and a PortalRegistry.
Before you can access a PortalRegistry object, you must get a session object. The session controls access to the registry, provides error tracing, enables you to set the runtime environment, and so on. Because you want to use the existing session, use the %Session system variable (instead of the GetSession function.) In addition, you want to get a PortalRegistry. Using the GetPortalRegistry method returns a reference to an unpopulated PortalRegistry object.
&MyPortal = %Session.GetPortalRegistry();
Open the PortalRegistry.
After you get a PortalRegistry object, you want to open it, that is, populate it with data. Use the Open method to do this. The Open method returns a Boolean value, and this example uses that value to do error checking to make sure that the PortalRegistry is actually opened. In addition, the name of the PortalRegistry is kept in the record MYRECORD, in the field PORTAL_NAME.
If NOT &MyPortal.Open(MYRECORD.PORTAL_NAME) Then /* Do error handling */ End-if;
Access the User folder.
One of the strengths of dot notation is being able to string together many methods and properties into a single line of code. The result of this single line of code is to return a reference to the folder named Users.
&UserFldr = &MyPortal.RootFolder.Folders.ItemByName("Users");
Access the entire, cascaded PermissionValue collection.
There are two types of PermissionValue collections you can access for a folder.
One contains only the permission list values that are set at that folder. This collection is returned with the Permissions property.
The other contains all the permission list values for folder, that is, it contains any permission list values set in any parent folder and cascaded. This collection is returned with the CascadedPermissions property.
Note. You cannot add any PermissionValue objects to a collection returned by the CascadedPermissions property. You can add values only to the collection returned by the Permissions property.
This example uses the CascadedPermissions collection to check if the permission exists, because we don’t want to add a permission if it already exists. Then it uses the Permissions collection to add the value.
&CascadedColl = &UserFldr.CascadedPermissions;
Check to see if the permission list value exits.
Before adding the new PermissionValue object, you want to make sure one by that name doesn't already exist.
&PermV = &CascadedColl.ItemByName("VENDOR1");
If the PermissionValue doesn't exist, add it.
The ItemByName returns a reference to a PermissionValue object if it exists, or NULL if it doesn't. So this example checks for NULL, and adds the PermissionValue if it doesn't exist.
Notice that this example is not changing the Cascaded property with the PermissionValue object. The default value for a new PermissionValue object is False. As this example does not want to cascade the permissions for this permission list, it retains the default value.
In addition, if the PermissionValue object is added, the folder is saved. The InsertItem method executes only after the parent object, the folder, is saved.
If NOT &PermV Then &PermVColl = &UserFldr.Permissions; &PermVColl.InsertItem("VENDOR1"); &UserFldr.Save(); End-If;
You may want to check for errors after you save the folder.
See Folder class: Permissions property, CascadedPermissions property.
See Using PermissionValue, RolePermissionValue, Cascading Permissions and CascadingRolePermissions.
The following example uses attributes for a folder to determine what is displayed to an end-user. The end-user still has access to the content, however, it isn't displayed. This program doesn't discuss how to hide or display content: it just shows the function used to determine if a folder should be displayed.
The following is the complete code sample: the steps explain each line.
Function checkVisible(&FolderId As ApiObject) Returns Boolean &colAttrib = &FolderId.Attributes; If &colAttrib.ItemByName("PORTAL_HIDE_FROM_NAV") <> Null Then If &colAttrib.ItemByName("PORTAL_HIDE_FROM_NAV").value = "TRUE" Then &display = False; End-If; End-If; Return &display; End-Function;
To use attributes for a folder:
Access the folder attribute collection.
A reference to a folder is passed into the function. Then the example uses the Attributes property on the folder to access the attribute collection for the folder.
&colAttrib = &FolderId.Attributes;
Check to see if the folder should be hidden.
This step is actually two checks. The first check is to see if there is an attribute with the folder called PORTAL_HIDE_FROM_NAV. If the folder has such an attribute, the second check determines the value of this attribute. If both are true, the folder should be hidden, so the variable &display is set to True, and returned.
If &colAttrib.ItemByName("PORTAL_HIDE_FROM_NAV") <> Null Then If &colAttrib.ItemByName("PORTAL_HIDE_FROM_NAV").value = "TRUE" Then &display = False; End-If; End-If; Return &display;
The following is an example referencing a PortalRegistry object using Visual Basic.
Dim oCref As ContentRef Dim oCrefColl As ContentRefCollection Set oSession = CreateObject("PeopleSoft.Session") iResult = oSession.Connect(1, AppServStr, OperID, OperPasswd, 0) Set oPortal = oSession.GetPortalRegistry iResult = oPortal.Open("PORTAL") Set oCrefColl = oPortal.RootFolder.ContentRefs Set oCref = oCrefColl.InsertItem("papi012") iResult = oPortal.Close iResult = oPortal.Open("PORTAL") Set oCref = oPortal.FindCRefByName("papi012") oPortal.Close oSession.Disconnect Exit Sub
The following is a C/C++ example.
/*********************************************************************** * * * psportal_test.cpp * * * ************************************************************************ * * * Confidentiality Information: * * * * This module is the confidential and proprietary information of * PeopleSoft, Inc.; it is not to be copied, reproduced, or * transmitted in any form, by any means, in whole or in part, * nor is it to be used for any purpose other than that for which it * is expressly provided without the written * permission of PeopleSoft. * * * Copyright (c) 1988-1999 PeopleSoft, Inc. All Rights Reserved. * * * ************************************************************************ * * * SourceSafe Information: * * * * $Logfile:: $* * $Revision:: $* * $Date:: $* * * ***********************************************************************/ /*********************************************************************** * includes * ***********************************************************************/ #ifdef PS_WIN32 #include "stdafx.h" #endif #include "bcdef.h" #include "apiadapterdef.h" #include "peoplesoft_peoplesoft_i.h" #include <stdio.h> #include <iostream.h> #include <wchar.h> /*********************************************************************** * general defines and macros * ***********************************************************************/ /*********************************************************************** * globals * ***********************************************************************/ HPSAPI_SESSION hSession; /*********************************************************************** * function prototypes * ***********************************************************************/ void DisconnectSession(); void GetFolder(HPSAPI_SESSION hSession, LPTSTR pszPortalName); void OutError(HPSAPI_SESSION hSession); /*********************************************************************** * Function: main * * * * Description: * * * * Returns: * ***********************************************************************/ void main(int argc, char* argv[]) { // Declare variables PSAPIVARBLOB blobExtra; TCHAR szServer[80] = _T("//LCHE0110:900"); TCHAR szUserid[30] = _T("PTMO"); TCHAR szUserPswd[80] = _T("PT"); TCHAR szPortalName[80] = _T("PORTAL"); memset(&blobExtra, 0, sizeof(PSAPIVARBLOB)); // Establish a PeopleSoft Session. HPSAPI_SESSION hSession = PeopleSoft_Session_Create(); if (PeopleSoft_Session_Connect(hSession, 1, szServer, szUserid, szUserPswd, blobExtra)) { GetFolder(hSession, szPortalName); } else { // Connect to AppServer Failed. Error out. if (PeopleSoft_Session_GetErrorPending(hSession)) { wprintf(L"\nConnect to AppServer Failed.\n"); OutError(hSession); } else wprintf(L"No error pending from session.\n"); } DisconnectSession(); } /*********************************************************************** * function implementations * ***********************************************************************/ /*********************************************************************** * Function: DisconnectSession * * * * Description: Disconnects the Session object. * * * * Returns: None * ***********************************************************************/ void DisconnectSession() { // Disconnect current session to free memory and session variables. if (hSession) { if (PeopleSoft_Session_Disconnect(hSession)) { PeopleSoft_Session_Release(hSession); } else { wprintf(L"Disconnect to AppServer Failed.\n"); } } } /*********************************************************************** * Function: GetFolder * * * * Description: Get root folder and display folder name * * * * Returns: None * ***********************************************************************/ void GetFolder(HPSAPI_SESSION hSession, LPTSTR pszPortalName) { LPTSTR szStr; HPSAPI_PORTALREGISTRY hPortal; HPSAPI_FOLDER hRootFolder; hPortal=(HPSAPI_PORTALREGISTRY) PeopleSoft_Session_GetPortalRegistry(hSession); PortalRegistry_PortalRegistry_Open(hPortal, pszPortalName); if (PortalRegistry_PortalRegistry_Open(hPortal, pszPortalName) == false) _tprintf(_T("Open portal failed\n")); else { hRootFolder = PortalRegistry_PortalRegistry_GetRootFolder(hPortal); szStr = PortalRegistry_Folder_GetName(hRootFolder); _tprintf(_T("root folder name = %s\n"), szStr); } } /*********************************************************************** * Function: OutError * * * * Description: Output error message from session psMessage object * * * * Returns: None * ***********************************************************************/ void OutError(HPSAPI_SESSION hSession) { LPTSTR szStr; HPSAPI_PSMESSAGECOLLECTION hMsgColl; HPSAPI_PSMESSAGE hMsg; hMsgColl=(HPSAPI_PSMESSAGECOLLECTION) PeopleSoft_Session_GetPSMessages(hSession); wprintf(L"Get psMessage collection ok.\n"); int i; PSI32 count; count=(PSI32) PeopleSoft_PSMessageCollection_GetCount; wprintf(L"Count= %d\n", count); for (i=0; i<count; i++) { hMsg=(HPSAPI_PSMESSAGE) PeopleSoft_PSMessageCollection_Item(hMsgColl, i); szStr=PeopleSoft_PSMessage_GetText(hMsg); wprintf(L"\nMessage from session: %s\n",szStr); } }