Sunday, March 1, 2009

For the WebSphere Portal development management JACL script

WebSphere Portal Server is the IBM-oriented integration and an important platform for collaboration. WebSphere Portal Server Web PortletXML Configuration Interface Portal Scripting Interface WebSphere Portal Server to provide users with three types of management methods: Web-based management of Portlet, XML Configuration Interface and Portal Scripting Interface. Web Portlet Web-based management approach requires users to manually Portlet to do a variety of operations, automation management operations should not only apply to simple management operations. XML Configuration Interface XML XML Configuration Interface required the user to prepare XML configuration file, but the documentation is too much trouble and the lack of flow control, is not flexible enough. Portal Scripting Interface 5.1 6.0 JACL Portal Scripting Interface from Version 5.1 are introduced, and version 6.0 has been improved and enhanced, using JACL management approach to the preparation of scripts, pre-relative in two ways, is more flexible. JACL Portal Scripting Interface In this paper, a concrete example JACL script to guide the reader through the preparation of the management of Portal Scripting Interface script.

标读者 Target audience

WebSphere Portal 使用和管理经验,同时还应具备编写JACL 脚本的基本知识。 In this paper, the reader should possess a certain degree of WebSphere Portal use and management experience, at the same time should also be prepared with basic knowledge of JACL script.

Portal Scripting Interface IBM WebSphere Portal 提供基于JACL 的脚本管理接口。 Portal Scripting Interface is based on IBM WebSphere Portal to provide JACL script management interface. 本文以具体JACL 脚本为例,向您介绍如何通过Portal Scripting Interface 编写WebSphere Portal 管理脚本。 In this paper, the specific JACL scripts for example, introduce you to how to prepare Portal Scripting Interface management script WebSphere Portal.


How to run the Portal Scripting Interface

Portal Scripting Interface WebSphere Portal Server 提供的基于JACL 的管理程序。 Portal Scripting Interface is the WebSphere Portal Server to provide the JACL-based management process. WPS_HOME/bin 下有一个脚本程序wpscript.bat(非windows 平台对应于wpscript.sh),它就是WebSphere Portal 的脚本管理接口。 At WPS_HOME / bin has a script under wpscript.bat (corresponding to non-windows platform wpscript.sh), it is the WebSphere Portal script management interface. wpscript.bat 需要在命令行下运行,有两种方式使用Portal Scripting Interface wpscript.bat required to run at the command line, has two ways to use the Portal Scripting Interface:

  • 交互方式 :在命令行下一边输入JACL 脚本一边解释运行,比较适用于一些简单的和一次性的操作; Interactive way: at the command line under the input side of JACL script to explain the side of operation, applicable to a number of relatively simple and one-time operation;
  • 提交脚本方式 :事先编写好JACL 脚本,然后将JACL 脚本文件名作为命令行的参数传入执行,适用于复杂操作和需要重复执行的操作。 Script submitted by: JACL script prepared in advance, and then JACL script file name as command line parameters afferent implementation, applicable to the complexity of the operation and implementation of required repeat operation.

wpscript.bat 调用方式如下所示: wpscript.bat way call as follows:


1 运行Portal Scripting Interface List one run Portal Scripting Interface

wpscript.bat –conntype -port -user wpscript.bat-conntype -port -user

-password -f -password -f

下面我们对以上命令中所使用的参数做出说明: Here we have more than orders of the parameters used in the explanation:

  • -conntype 连接方式,可选参数,默认为SOAP -conntype: connectivity, optional parameters, defaults to SOAP;
  • -port 连接端口,对应于wpconfig.properties 中的WpsSoapPort 属性值; -port: port, corresponding to wpconfig.properties in WpsSoapPort property value;
  • -user -password :用于创建连接的用户名和密码; -user and-password: used to create the connection user name and password;
  • -f JACL 文件的路径名,如果通过交互方式,省略这个参数。 -f: JACL file path name, if the interactive way this parameter is omitted.

打开wpscript.bat,可以看到它的内容很简单,传入一些参数调用wsadmin Open wpscript.bat, can see its content is very simple, some of the parameters of incoming call wsadmin. wsadmin WebSphere Application Server 的脚本管理接口,支持JACL Perl 脚本。 WebSphere Application Server are wsadmin script management interface, support JACL and Perl scripts. wpscript.bat wsadmin 扩展,传入Portal 管理对象,在JACL 脚本里通过对Portal 管理对象的方法调用实现对WebSphere Portal Server 的管理。 wsadmin is wpscript.bat the expansion of imported Portal managed object, in the JACL script through to the Portal Management Object method calls to the WebSphere Portal Server implementation management.

PSI 为用户提供了如下几个Portal 管理对象: PSI offers the following managed object Portal:

  • Portal Portal 录接口 Portal: Portal Login Interface
  • Content :内容组织管理接口 Content: the content management interface
  • Layout 页面布局接口 Layout: Page Layout Interface
  • Portlet Portlet 管理接口 Portlet: Portlet Management Interface
  • Look Portal 观主题管理接口 Look: Portal appearance of subject Management Interface
  • Access PacList 这两个对象一起实现对Portal ACL 控制 Access and PacList: these two objects together on the implementation of the ACL Control Portal

本文不是Portal Scripting Interface 的参考手册,因此只对示例中用到的对象和方法进行介绍。 This is not the Portal Scripting Interface reference manual, so only the sample used in the objects and methods of introduction. 其他对象和方法可参WebSphere Portal 信息中心 ,或者在wpscript.bat 中使用help 方法。 And methods of other objects can refer to WebSphere Portal Information Center, or at wpscript.bat Ways to use help.

获取帮助 Getting Help

Portal Scripting Interface 提供了强大的帮助功能,通wpscript.bat 录后,调用对象的help 方法可以快速获取帮助,如$Content help,将返回Content 对象的说明以及它所支持的所有方法,如果带方法名作为参数,将返回该方法的详细说明,如$Content help search Portal Scripting Interface provides a powerful assist feature wpscript.bat sign, the call object methods can quickly help get help, such as $ Content help, will return Content object, as well as it supports all the methods, if the method name with as a parameter, will return a detailed description of the method, such as $ Content help search.

脚本示例介 Script sample introduction

本文将指导用户编写一个JACL 脚本。 This article will guide the user to prepare a JACL script. Home Stock WebSphere Portal My Stock Portlet At Home Under Stock entitled to create a page, WebSphere Portal will then own the My Stock Portlet deployed to this page, and finally on the page to set up permissions so that ordinary users should not visit the page.

Portal Bean-在JACL 中登Portal Portal Bean-sign at JACL in Portal

Portal Portal Portal Objects Portal provides a log-certified interface. WebSphere Portal 需要提供用户名和密码,通过JACL 脚本访问Portal 也同样需要提供登录认证信息,只有先登录成功之后才能对Portal 中的各种对象进行操作,这是每个实现Portal 管理的JACL 脚本首先必须要做的事情。 WebSphere Portal log necessary to provide a user name and password, visit the Portal through the JACL script is also required to provide certification information sign, only the first sign after the success of the Portal of the various objects, which is managed by each Portal implementation JACL script must first be to do.

用文本编辑工具新建一个文件stock.jacl 输入如下内容: Text editing tools used to create a new document stock.jacl and enter the following:


2 实现登录和退出Portal Log in and achieve a list of 2 Exit Portal

$Portal login $ Portal login

$Portal logout $ Portal logout

这已经是一个可以被wpscript.sh 调用的JACL 脚本了,只是简单的登录Portal 然后再退出。 This is already a wpscript.sh can be called the JACL script, simply log in Portal and then quit. JACL 支持命令行参数,我们可以把Portal 录信息通过命令行传入,这样Portal 的用户名或密码变化后不用修改JACL 脚本。 JACL to support command-line parameters, we can put Portal Login afferent information through the command line, so Portal username or password changes need not be amended after the JACL script. 修改后的脚本如下所示: The revised script is as follows:


3 从命令行接收登Portal 的用户名和密码 3 list log Portal from a command line to receive the user name and password

if { $argc != 2 } { if ($ argc! = 2) (

puts "Syntax: wpscript sample.jacl ." puts "Syntax: wpscript sample.jacl ."

exit exit

} )

set user [lindex $argv 0] set user [lindex $ argv 0]

set pwd [lindex $argv 1] set pwd [lindex $ argv 1]

$Portal login $user $pwd $ Portal login $ user $ pwd

$Portal logout $ Portal logout

在后面的介绍中,将逐步扩充这个脚本,使它完成管理功能。 At the back of the presentation, will gradually expand this script to make it complete management capabilities.

除了登录验证的接口外,Portal 对象还提供了Virtual Portal 选择的接口,如下所示: Apart from the log to verify interfaces, Portal Object Virtual Portal also provides a selection interface, as follows:

$Portal setvp $ Portal setvp

过这个方法用户可以指定要登录哪个Virtual Portal Through this method the user can specify which log in Virtual Portal.

Content Bean-管理Portal 内容(页面,标签和URL Content Bean-Management Portal content (pages, tags and URL)

Content 对象负责Portal 内容的管理,这里的内容指页面、标签和URL Content object is responsible for Portal content management, content here refers to the page tags and URL. Content 对象我们可以遍历Portal 中的所有页面、标签和URL Through the Content object we can traverse all Portal pages, tags and URL. 定位到操作的页面后,还可以通过Content对象对页面进行创建、删除和修改等操作。 Navigate to the page after the operation, you can page through the Content object to create, delete and modify such operation. 比如,要在实现在某个页面上部署一个Portlet,就必须先通过这个接口定位要部署Portlet 页面。 For instance, it is necessary to achieve at a certain page to deploy a Portlet, it must first pass the interface location to deploy Portlet page.

在使用这个对象前,我们必须先弄清楚Portal 中的内容是如何的管理的。 In the use of this object, we must first clarify the Portal content management is how. WebSphere Portal 中,内容被组织成树状结构,并以一个不存在的虚节点root 为根。 In WebSphere Portal, the content is organized into a tree structure, and a non-existent virtual root for the root node. 每一个页面、标签和URL 都是树中的一个节点。 Every page, tag and URL is a node tree. 每个节点都有一个全局唯一的标志,通过遍历和查找,可以访问内容树中的每一个节点。 Each node has a globally unique signs, through the traverse and search, you can access the content of each tree node. Portal 的内容组织可以通过Web 方式进行浏览,如下图所示 Portal content can be organized manner through the Web browser, as follows:


1 WebSphere Portal 内容组织结构 Figure 1 WebSphere Portal content structure
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0902_zhengcq/images/1.jpg

Content 对象提供的方法可分为以下几类: Content provided Ways objects can be divided into the following categories:

  • 历和搜索 :快速准确的定位到要指定的节点; Traverse and search: fast and accurate positioning to be specified by node;
  • 属性 获取和设置节点的属性,如uniquenamecommonnamelanguage等; Property: to get and set property nodes, such as uniquename, commonname, language, etc.;
  • 生命周期 节点的创建,删除等; Life cycle: the node to create, delete, etc.;
  • 组织结构 节点在整个组织树中的位置变更。 Organizational structure: nodes in the entire organization to change the location of tree.

本文将结合例子只讲述搜索和生命周期管理的方法,其他可参WebSphere Portal 信息中心 This paper will combine the examples are just about english and life cycle management approach, and other reference WebSphere Portal Information Center.

搜索 Search

在脚本中通常要对某些指定的节点进行操作,之前必须找到并选定这个节点。 Usually in the script on certain designated nodes to operate, must be found before and selected this node. 每个节点都由全局唯一的uniquename 标志的。 Each node by the overall situation of only uniquename signs. 脚本接口提供了如下两类查询方式: Scripting interface provided the following two types of query method:

$Content search $ Content search

search方法是返回所有符合条件的节点列表。 search methods are all eligible to return to the list of nodes.

$Content find $ Content find

find 是返回唯一一个符合条件的节点,如果符合条件的节点多于一个或者不存在,find 调用将失败。 find back are the only one eligible node, if eligible, or more than one node does not exist, find call will fail.

type 查询类型,可以是pagelabelurl 等,或者不type 参数,返回符合条件的任意类型的节点。 type is the query type, it can be page, label, url, etc., or non-type parameters back in line with the conditions of any type of node.

By 查询标准,下面是一些常用的查询标准。 By inquiries are standard, the following are some commonly used search criteria.

  • id :全局唯一标志; id: globally unique identification;
  • uniquename :全局唯一名称; uniquename: globally unique name;
  • commonnameis 节点的通用名称; commonnameis: Node generic name;
  • commonnamehas 节点通用名称中含有特定字符串。 commonnamehas: node common name contains a specific string.

过调用$Content help search-types可以获取查询标准列表。 By calling the $ Content help search-types can get a list of search criteria.

此示例中我们要在My Work 录下创建页面,因此必须先找到My Work 节点,如下所示: This example we want to at My Work directory to create the page, it must first find the My Work node, as follows:

$Content find label uniquenane "wps.My Portal.My Work" select $ Content find label uniquenane "wps.My Portal.My Work" select

在最后加上select 方法表示查找到这个节点后并选中这个节点,以后所有的操作都是针对这个节点。 Ways to add the final select express to the search node and select the node, after all the operations are directed at this node.

Content 提供的搜索是针对事先指定的节点以及它的子节点树的,如果事先没有选中哪个节点,将从虚节点root 开始搜索。 Content provided by the search for pre-designated node and its child nodes of the tree, if not selected in advance which node, virtual node from root to start the search.

生命周期管理 Lifecycle Management

Content 提供了创建和删除节点的方法。 Content provided to create and delete the node method.

创建节点: Create a node:

$Content create $ Content create

type 可以是pagelabelexternalurl,分别表示创建页面、标签和url type can be a page, label, externalurl, express separately to create the page, label and url. create 调用中还可以加上publicprivate 标志,表示创建的页面是公共的还是私有等。 At create call can also be combined with public, private and other signs that the pages are created by public or private, such as.

以父节点页面为模板创建新页面: To the parent node as a template page to create a new page:

$Content derive from $ Content derive from

name 是新页面的名称,id 是父节点的ID 值,只有父节点是共享的页面时才可以调用。 name is the name of a new page, id is the ID value of the parent node, only the parent node is shared only when they can call the page.

删除节点: Delete node:

$Content delect $ Content delect

继续扩充stock.jacl,在Home 创建一个标题为Stock 的新页面。 Continue to expand stock.jacl, At Home, under the heading for the Stock to create a new page.


4 Home 创建名为Stock 的新页面并选定 At Home Under the list of 4 to create a new page called Stock and selected

# 找到并选中Home,新页面的父节点将是Home # Find and select the Home, a new page of the parent node will be the Home.

$Content find label uniquename " ibm.portal.Home " select $ Content find label uniquename "ibm.portal.Home" select

# 创建标题为Stock页面并选中set thePage [$Content create page "Stock" html public] Stock # Create a header for the page and select set thePage [$ Content create page "Stock" html public]

$Content select $thePage $ Content select $ thePage

Portlet Bean-操作Portlet Portlet Bean-operation Portlet

Portlet 对象提供了对WebSphere Portal 中部署的Portlet 的控制,它提供了Portlet 部署的层次结构的访问。 Portlet object WebSphere Portal provides a Medium Portlet deployment of control, it provides a hierarchical structure Portlet deployment visit. JACL 脚本访问某个Portlet,必须先通过Portlet 对象进行定位,然后才能进行相应的操作。 JACL script through access to a Portlet, must first pass Portlet object positioning, then the operation can be carried out accordingly.

Portal Scripting Interface 中所有的Portlet 也是以树状结构组织的,但与Content 不同,Portlet 组织树有特定的结构 Portal Scripting Interface in all of the Portlet is also organized by tree structure, but with the Content different, Portlet organizations have a particular tree structure.

  • Portlet 组织树也以一个不存在的root 节点为根; Portlet organization tree with a root node does not exist for the root;
  • 它的所有子节点是web module对应于Portlet 所在的war 包; All of its child nodes are web module, corresponds to the Portlet's war package;
  • 第二层是application对应于war 中所包含的portlet application The second is application, corresponds to the war contained in the portlet application;
  • 第三层是portlet对应于application中所包含的所有portlet The third tier is portlet, corresponds to the application contains all the portlet.
  • 每个web module 节点的结构同portlet.xml 中的组织结构一致。 Each web module node structure with the portlet.xml in the organizational structure in line.

对于Portlet 组织树结构,是在Portlet 打包时决定的,不能通过Portlet 对象进行修改。 Organizational tree structure for the Portlet, Portlet are packaged at the time decided by the Portlet object can not be modified.

Portlet 对象提供了两类方法,搜索遍历和属性操作,具体的方法调用同content 对象类似。 Portlet object provides two types of methods, search traversal and operation of property, the specific method calls similar to the same content object. Portlet 查询支持这些类型:webmoduleapplicationportletconcreteportletapplication),abstractall any Portlet support these types of inquiries: webmodule, application, portlet, concrete (portlet or application), abstract, all or any. 具体的查询标准可以参考$Portlet help search-criteria输出。 Specific search criteria can refer to $ Portlet help search-criteria output.

继续扩充我们的例子,我们要通过Portlet 对象搜索到My Stock Portlet Continue to expand our example, we have to search through the Portlet object to My Stock Portlet.


5 查找My Stock Portlet 5 search list My Stock Portlet

# 找到My Stock Portlet # Find the My Stock Portlet

set pid [$Portlet find portlet cn "My_Stock"] set pid [$ Portlet find portlet cn "My_Stock"]

Layout Bean实现Portal 页面布 Layout Bean-achieve Portal Page Layout

Layout 对象提供了页面布局管理的接口。 Layout Page Layout object provides the management interface. 们知道Portal 里的页面是用来放置Portlet 的,页面可以划分成多个区域,每个区域上放置一个PortletLayout 对象正是提供了对应的管理接口,允许用户控制页面的区域划分和每个区域中部署的Portlet We know that Portal's Portlet page is used to place the page can be divided into multiple regions, each placed on a Portlet, Layout object is to provide the corresponding management interface that allows users to control the page and each region Regional deployed Portlet.

要使用Layout 对象,必须先通过Content 对象选中某个页面,然后Layout对象才能生效并指向该页面,当dselect 该节点后Layout 对象就不可用了。 To use the Layout object, you must first select an object through the Content page, then Layout object to take effect and point to the page, when dselect after the Layout of the node object is not available.

们先来看看portal 对页面布局的管理,页面的布局中只允许两种类型的组件存在,container control Let us take a look on the portal page layout management, page layout to allow only two types of components exist, container and control.

  • Container 里可以包含container control,与html 中的table 概念类似,相当于行和列,在$Layout 中可以创建水平或垂直container Container can be included in container and control, with the html of the table concept is similar to the equivalent of rows and columns, at $ Layout can create horizontal or vertical container.
  • Control 是叶子节点,对应于portlet Control nodes are the leaves, corresponding to the portlet.

下面是一个含有两个portlet 页面的布局结构。 Here is a portlet contains two pages of the layout of the structure.


2. 页面布局结构 Figure 2. Page Layout Structure
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0902_zhengcq/images/2.jpg

Layout 对象提供了三类方法调用, Layout object provides three types of method calls,

  • 搜索和遍 ,同Content 类似,支持containercontrol all or any 查询标准; Search and traversal, with a similar Content to support the container, control, and all or any query criteria;
  • 属性操作 ,具体参考Info Center Property operations, the specific reference Info Center;
  • 生命周期管理 container control 创建和删除。 Lifecycle management, container or control the creation and deletion.

创建一个container Create a container:

$Layout create container $ Layout create container

创建一个control Create a control:

$Layout create control $ Layout create control

回到本文的例子,我们在页面上部署一个Portlet Back to the examples in this article, we are on the page to deploy a Portlet. 参照上面的例子,只需要在页面中创建一个container,并在container 创建一个control结构如下图所示: The light of the above example, only required the page to create a container, and in the container to create a control, the structure as follows:


3. 页面Stock 布局结构 Figure 3. Page layout Stock
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0902_zhengcq/images/3.jpg

6 页面Stock 上部署My Stock Portlet Stock list on page 6 at My Stock Portlet deployment

$Layout create container horizontal select $ Layout create container horizontal select

$Layout create control $pid $ Layout create control $ pid

其中,$pid My Stock Portlet id One of, $ pid Yes My Stock Portlet's id.

Access Bean PacList Bean-控制Portal 对象ACL Access Bean and PacList Bean-controlled Portal Object ACL

WebSphere Portal 提供了完备的权限管理,其中的每个对象(页面、Portlet 等)都有自己的访问控制列表,可以对每个对象单独设置哪些用户进行访问。 WebSphere Portal provides a comprehensive rights management, one of each object (page, Portlet, etc.) has its own access control list can be set individually for each object which users visit. Access PacList 这两个对象提供了对Portal 这套完备的权限管理体系的访问接口。 Access and PacList these two objects in the Portal provides a complete set of access rights management system interface. 过这两个对象提供的接口,用户在JACL 脚本中,可以对任何一个可以被访问到的Portal 对象(页面、Portlet 等)进行访问控制列表的设置。 Clients through these two interfaces, the user at JACL script, can any one can be access to the Portal objects (pages, Portlet, etc.) access control list settings.

访问权限控制对Content Portlet 有效,在做相应操作前必须先选中Content 节点或者Portlet Access Control for Content and Portlet effective, to do the corresponding operation at the former must first select the Content node or Portlet.

Access 对象用于读写控制对象,在读出控制对象后由PacList 对象进行操作,最后再由Access 对象写入。 Object Access control for reading and writing objects, read at the control object by object PacList operation,最后by the Access object to write. 基本步骤如下所示: Basic steps as follows:

1. Access 对象获取指定对象的访问权限对象并载入PacList 对象。 1. Through the Access object to obtain access to the designated target object and loading PacList object.

set acl [$Access getacl Content [$Content current]] set acl [$ Access getacl Content [$ Content current]]

$PacList view acl $PacList edit acl $ PacList view acl or $ PacList edit acl

2. PacList 提供的方法对访问权限对象进行操作,如grantblockunblock 等。 2. PacList provided through the method of operation of access to objects, such as grant, block, unblock and so on.

3. Access 对象将访问权限对象写回。 3. Through the Access object to access the object to write back.

$Access setacl $acl $ Access setacl $ acl

在本文的例子,普通用户不能访问页面Stock,如下所示: In this example, ordinary users should not visit the page Stock, as follows:


7 设置页面Stock 访问控制 Stock list of 7 settings page access control

set acl [$Access getacl Content [$Content current]] set acl [$ Access getacl Content [$ Content current]]

$PacList block User propagation $ PacList block User propagation

$PacList block User inheritance $ PacList block User inheritance

$PacList block PrivilegedUser propagation $ PacList block PrivilegedUser propagation

$PacList block PrivilegedUser inheritance $ PacList block PrivilegedUser inheritance

$Access setacl $acl $ Access setacl $ acl

完整的脚本代 Complete script code

至此Portal Scripting Interface 提供的管理对象介绍完毕,下面是本文例子的完整脚本,在WebSphere Portal Server V6.0 调试通过。 So far on the Portal Scripting Interface provides the managed object introduction completed, the following are examples of this paper, a complete script, in the WebSphere Portal Server V6.0 debug through.


8 完整的stock.jacl Eight complete list stock.jacl

# stock.jacl # Stock.jacl

if { $argc != 2 } { if ($ argc! = 2) (

puts "Syntax: wpscript stock.jacl ." puts "Syntax: wpscript stock.jacl ."

exit exit

} )

set user [lindex $argv 0] set user [lindex $ argv 0]

set pwd [lindex $argv 1] set pwd [lindex $ argv 1]

$Portal login $user $pwd $ Portal login $ user $ pwd

# 找到并选中Home,新页面的父节点将是Home # Find and select the Home, a new page of the parent node will be the Home.

$Content find label uniquename "ibm.portal.Home" select $ Content find label uniquename "ibm.portal.Home" select

# 创建标题为Stock页面并选中set thePage [$Content create page "Stock" html public] Stock # Create a header for the page and select set thePage [$ Content create page "Stock" html public]

$Content select $thePage $ Content select $ thePage

# 找到My Stock Portlet # Find the My Stock Portlet

set pid [$Portlet find portlet cn "My_Stock"] set pid [$ Portlet find portlet cn "My_Stock"]

# 页面上部署My Stock Portlet # On the page My Stock Portlet deployment

$Layout create container horizontal select $ Layout create container horizontal select

$Layout create control $pid $ Layout create control $ pid

# 设置访问权限,普通用户不能访问该页set acl [$Access getacl Content [$Content current]] # Set access permissions, ordinary users should not visit the page set acl [$ Access getacl Content [$ Content current]]

$PacList block User propagation $ PacList block User propagation

$PacList block User inheritance $ PacList block User inheritance

$PacList block PrivilegedUser propagation $ PacList block PrivilegedUser propagation

$PacList block PrivilegedUser inheritance $ PacList block PrivilegedUser inheritance

$Access setacl $acl $ Access setacl $ acl

puts "The deployment of My Stock portlet succeeded." puts "The deployment of My Stock portlet succeeded."

$Portal logout $ Portal logout

运行和结果 Operation and results

在命令行下运行wpscript.sh,如下图所示: At the command line run wpscript.sh, as follows:


4. 脚本运行结果 Figure 4. Script run results
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0902_zhengcq/images/4.jpg

成功运行后,用管理员登录,结果如下所示: After a successful run with the administrator log in, the result is as follows:


5. 管理员登录后的Portal页面 Figure 5. The administrator of the Portal page after log in
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0902_zhengcq/images/5.jpg

用普通用户登录访问,在Home 下看不到Stock 页面,如下所示: Sign in with normal user access, at Home can not see under the Stock page as follows:


6. 普通用户登录后的Portal页面 Figure 6. The ordinary user of the Portal page after log in
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0902_zhengcq/images/6.jpg

结束语 Concluding remarks

本文Portal Scripting Interface 进行了简要的介绍,WebSphere Portal Server 过这些对象提供了强大的管理接口,用户可以通过这些接口编写出功能强大的管理脚本。 Portal Scripting Interface In this paper, a brief introduction, WebSphere Portal Server through these objects provides a powerful management interface, the user can interface through which the preparation of a powerful management scripts.