|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON Perficient
The Portal Scripting Interface
Configure the system via the command line
By: Chris Lockhart
Jun. 7, 2005 03:00 PM
Digg This!
Page 2 of 3
« previous page
next page »
The Content Bean If I was curious to know some details about the Corporate Directory content-node, I could invoke the Content bean to tell me about it. The Content bean uses the following syntax for a search: $Content find <type> <by> <value> So to find and display some info about the Corporate Directory node with uniquename wps.myportal.CorpDir, I would use: $Content find any uniquename "wps.myportal.CorpDir" More specifically, since I know the CorpDir is of type 'page,' I could execute a more concise search: $Content find page uniquename "wps.myportal.CorpDir" There are several different kinds of searches you can do. Executing $Content help search-types will show you these different searches. Keep in mind the help function for the Content bean is always available using: $Content help Okay, so big deal, you found the content-node. It's far more interesting if you were to display some other info about this node. Before you can display other attributes of the node, you have to "select" the node. Finding it isn't enough, you have to "select" it before running an additional command against it: $Content find any uniquename "wps.myportal.CorpDir" select Now that you've got it selected, try any of the following:
$Content get type The ID of the content-node (or any portal object for that matter) is the UID or Unique ID of the object. With this interface, most of the actions (get or set) are invoked against the UID of an object. Once you have this id, some of the operations become easier. There are a few special id values that we can use. The most useful is called 'the root.' $Content select the root This command will select the root content node. Second in usefulness is the 'the parent' special id: $Content select the parent This command will select the immediate parent of the currently selected content node. Let's say for example that the unique ID of our CorpDir node (the UID that was auto-generated by the Portal when we created the page) was found using one of the commands above. Let's say for argument's sake that this id is _6_00KJL57F9D04J770_D. We could then issue some other commands such as:
$Content get "wps.myportal.CorpDir" id If we were interested in what was underneath our WorkPlace content-node, we could select it and then search on that content-node for objects called compositions (or pages to you and me):
This will return a list of all the pages (or compositions) contained under the WorkPlace label. But surely this isn't the exciting part. No, we're much more interested in creating some content-nodes instead of merely displaying information about them. Luckily for us, the Content bean has a method called 'create.' Let's use our CorpDir content-node as an example (we retrieved its uid in one of the above examples):
$Content select _6_ This will select the CorpDir content-node and then create a page underneath it called SubPage with html as the supported markup.
$Content select the root This sequence first selects the content root, then creates a new label underneath it and selects this new label, then creates a page underneath it. By contrast, we could also delete the content-nodes: $Content delete <id> This command would delete the content-node with the id specified. For safety, the system doesn't let you delete a content-node with children. Gotta make sure those kids have parents!
Lens on Portlets $Portlet search webmodule namehas "News" Seems pretty straightforward. This command will execute the Portlet bean with the search method against objects of the webmodule type whose names contain the word "News." Once we have those objects returned, we could take the uid of one of them and gather more info:
$Portlet get webmodule <id> Of course, the Portlet bean also has a help function (as do its methods) in case you get stuck. Sadly, there's no "set" capability with the Portlet bean. Perhaps we should start a campaign to get that functionality added... Page 2 of 3 « previous page next page » WEBSPHERE LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING WEBSPHERE NEWS
|
|||||||||||||||||||||||||||||||||