YOUR FEEDBACK
Adobe Flex 2 - Answering Tough Questions About Enterprise Development
A Correct Person wrote: Denis Roebrt commented on the 21 Aug 2006 "Tough Que...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!

SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


The Portal Scripting Interface
Configure the system via the command line

Digg This!

Page 2 of 3   « previous page   next page »

The Content Bean
Content-nodes in the PSI are referenced by the Content bean. This bean lets you search for a particular content-node, view its settings, update the settings, create a new content-node or delete a content-node.

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
$Content get "wps.myportal.CorpDir" id
$Content current

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
$Content get _6_00KJL57F9D04J770_Dthemename
$Content set _6_00KJL57F9D04J770_Dtheme "Finance"
$Content get _6_00KJL57F9D04J770_Dposition

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):


$Content find label uniquename
wps.myportal.WorkPlace select
$Content search composition

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_
00KJL57F9D04J770_D
$Content create composition
"SubPage" html

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
$Content create label "NewLabel"
html select
$Content create composition
"NewSubPage" html

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
Even though we can't affect portlets directly using the PSI, we can definitely get some good information about the portlets defined in our portal repository. To do so we use the Portlet bean.

$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>
contextroot
$Portlet get webmodule <id> name

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 »

About Chris Lockhart
Chris Lockhart is a senior technical resource at Perficient, a firm recognized for its expertise around IBM technologies. Chris has worked with IBM's WebSphere, Tivoli and Lotus Software platforms for more than 6 years. For more information, please visit www.perficient.com

WEBSPHERE LATEST STORIES . . .
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
IBM Unveils Insurance Operations of the Future Powered By SOA
IBM announced two new advances in the insurance industry - a solution for improving operational efficiency and a framework for process acceleration - that are designed to help insurance providers lower costs and increase customer satisfaction by handling core processes, such as claims
ParAccel Announces OEM Relationship with IBM
ParAccel announced it has entered into an original equipment manufacturer (OEM) agreement with IBM. Under the terms of the agreement, ParAccel will embed IBM InfoSphere Change Data Capture within the ParAccel Analytic Database, providing ParAccel customers with seamless and real-time u
Microsoft To Keynote 4th International Virtualization Conference & Expo
Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec
Micro Focus Upgrades SOA Express for IBM CICS
Micro Focus announced the availability of SOA Express 8.0. The new version adds support for direct deployment into IBM's Customer Information Control System (CICS), enabling users to accelerate the deployment of Web services by reusing their existing CICS TS mainframe infrastructure in
Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
Red Hat is a trusted open source provider. Red Hat offers enterprise customers a long-term plan for building infrastructures on the quality and innovation of open source. Combining open source operating system platform, Red Hat Enterprise Linux, together with applications, management
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING WEBSPHERE NEWS
Company Profile for BrightStar Partners, Inc.
BrightStar Partners, a professional services and implementation-based solutions company,