WebSphere Portal:更新/删除战争
我需要更新 WebSphere Portal 6.0 上的 portlet。我尝试过使用 xmlaccess.bat。这是我的 DeployPortlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<request
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
type="update"
create-oids="true">
<portal action="locate">
<!-- The uid must match uid attribute of portlet-app in portlet.xml. -->
<web-app action="update" active="true" uid="com.firstlinesoftware.oo.portlet.TestPortlet
<url>file:///$server_root$/installableApps/TestPortlet.war</url>
<!-- The uid must match uid attribute of concrete-portlet-app in portlet.xml. -->
<portlet-app action="update" active="true" uid="TestPortlet">
<!-- The name attribute must match content of portlet-name subtag of concrete-portlet in portlet.xml. -->
<portlet action="update" active="true" objectid="theIbmPortletApiPortlet" name="TestPortlet"/>
</portlet-app>
</web-app>
<!-- Parent element under which the new page is inserted -->
<content-node action="locate" objectid="parentPage" uniquename="ibm.portal.rational.portlets"/>
<!-- The new page.
The contentparentref attribute must match the objectid of the parent.
Change the uniquename attribute to create another page. -->
<content-node action="update" uniquename="ibm.portal.TestPortletPage" ordinal="last" content-parentref="parentPage" active="true" allportletsallowed="false" create-type="explicit" type="page">
<supported-markup markup="html" update="set"/>
<localedata locale="en"><title>TestPortletPage</title></localedata>
<component action="update" ordinal="100" type="container" orientation="H">
<component action="update" ordinal="100" type="control">
<!-- The portletref must match the objectid attribute of the portlet -->
<portletinstance action="update" portletref="theIbmPortletApiPortlet"/>
</component>
</component>
</content-node>
</portal>
当我第一次使用这个脚本时,一切都很好。但是,当我尝试使用此脚本更新 portlet 时(所有 action="update"
),都会发生异常:DuplicateAppException。
然后我尝试通过脚本删除这个 portlet:
<?xml version="1.0" encoding="UTF-8"?>
<request
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
type="update"
create-oids="true">
<!-- sample for uninstalling a web module -->
<portal action="locate">
<!-- uid must match uid attribute of portlet-app in portlet.xml -->
<web-app action="delete" active="true" uid="TestPortlet">
</web-app>
</portal>
</request>
但是出现警告:无法删除该 portlet(没有这样的 Web 模块)也许它之前被删除了。实际上这个战争文件已经部署(用管理控制台检查过)
任何人都可以帮助我吗?
I need to update a portlet on the WebSphere Portal 6.0. I have tried to use xmlaccess.bat. Here is my DeployPortlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<request
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
type="update"
create-oids="true">
<portal action="locate">
<!-- The uid must match uid attribute of portlet-app in portlet.xml. -->
<web-app action="update" active="true" uid="com.firstlinesoftware.oo.portlet.TestPortlet
<url>file:///$server_root$/installableApps/TestPortlet.war</url>
<!-- The uid must match uid attribute of concrete-portlet-app in portlet.xml. -->
<portlet-app action="update" active="true" uid="TestPortlet">
<!-- The name attribute must match content of portlet-name subtag of concrete-portlet in portlet.xml. -->
<portlet action="update" active="true" objectid="theIbmPortletApiPortlet" name="TestPortlet"/>
</portlet-app>
</web-app>
<!-- Parent element under which the new page is inserted -->
<content-node action="locate" objectid="parentPage" uniquename="ibm.portal.rational.portlets"/>
<!-- The new page.
The contentparentref attribute must match the objectid of the parent.
Change the uniquename attribute to create another page. -->
<content-node action="update" uniquename="ibm.portal.TestPortletPage" ordinal="last" content-parentref="parentPage" active="true" allportletsallowed="false" create-type="explicit" type="page">
<supported-markup markup="html" update="set"/>
<localedata locale="en"><title>TestPortletPage</title></localedata>
<component action="update" ordinal="100" type="container" orientation="H">
<component action="update" ordinal="100" type="control">
<!-- The portletref must match the objectid attribute of the portlet -->
<portletinstance action="update" portletref="theIbmPortletApiPortlet"/>
</component>
</component>
</content-node>
</portal>
When I use this script for the first time everything is ok. But when I try to update the portlet with this script (everywhere action="update"
) the exception occure: DuplicateAppException.
Then I have tried to delete this portlet via the script:
<?xml version="1.0" encoding="UTF-8"?>
<request
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
type="update"
create-oids="true">
<!-- sample for uninstalling a web module -->
<portal action="locate">
<!-- uid must match uid attribute of portlet-app in portlet.xml -->
<web-app action="delete" active="true" uid="TestPortlet">
</web-app>
</portal>
</request>
but the warning occure: Can't delete the portlet(there is no such a web module) maybe it was deleted earlier. Actually this war file is deployed (checked this with an administration console)
Can anybody, please, help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通常不使用 xmlaccess 执行此操作(无法告诉您如何操作)。我像部署 WAS 中的任何应用程序一样重新部署 portlet 应用程序(war 或ear,具体取决于您打包的方式)。通过管理控制台或使用 wsadmin。这样做对您来说应该不成问题,因为 portlet 注册是通过重新部署来维护的。以下是使用 wsadmin 部署应用程序的示例 jython 脚本。它既可以独立运行,也可以集群运行(连接到主节点)。
I typically don't do this using xmlaccess (couldn't tell you how). I redeploy the portlet application (war or ear depending on how you package it) as I would any application in WAS. Either through the admin console, or using wsadmin. It shouldn't be a problem for you to do it that way since portlet registrations are maintained over redeploys. Here is a sample jython script for deploying an app using wsadmin. It works both standalone and clustered (connect to the primary node).
让我们从最后开始:您的
action=delete
不起作用的原因是您引用的webapp
的 uid 不正确。在安装过程中,您为其分配 uidcom.firstlinesoftware.oo.portlet.TestPortlet
,在删除过程中,您指的是TestPortlet
。那是行不通的。我编写了一个重新部署 portlet 应用程序的自动化系统,并且它已经使用了很多年,没有出现任何问题,因此您的 XMLAccess 文件中一定有问题。让我们来解决它。您可以首先从
web-app
元素中完全删除portlet-app
子元素吗?你有什么理由需要它吗?Lets start from the end: the reason that your
action=delete
doesn't work is because you're referring to thewebapp
with an incorrect uid. During installation, you assign it the uidcom.firstlinesoftware.oo.portlet.TestPortlet
, and during deletion, you're referring toTestPortlet
. That's not going to work out.I programmed an automated system that redeploys portlet applications and it's been used for years with no issues, so something must be wrong in your XMLAccess file. Lets work through it. Can you start by removing the
portlet-app
child element altogether from theweb-app
element? is there a reason why you need it there?