⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 portletlayoutdescriptor.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
/* * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a> * @author <a href="mailto:oliver@wehrens.de">Oliver Wehrens</a> * @version $Id: PortletLayoutDescriptor.java 5032 2006-08-17 18:15:06Z novotny $ */package org.gridsphere.layout;import org.gridsphere.portletcontainer.impl.JavaXMLBindingFactory;import org.gridsphere.services.core.persistence.PersistenceManagerException;import org.gridsphere.services.core.persistence.PersistenceManagerXml;import java.net.URL;/** * The <code>PortletLayoutDescriptor</code> is responsible for marshalling and * unmarshalling a container of portlet components into/from an XML descriptor * using Castor XML data binding capabilities. */public class PortletLayoutDescriptor {    /**     * Constructs an instance of PortletLayoutDescriptor     */    private PortletLayoutDescriptor() {    }    /**     * Loads the portlet container associated with this descriptor     *     * @param layoutDescriptorPath location of the layout.xml     * @param layoutMappingPath    location of the mapping file     * @return the portlet container     * @throws PersistenceManagerException if a descriptor error occurs     */    public static PortletPage loadPortletPage(String layoutDescriptorPath, URL layoutMappingPath) throws PersistenceManagerException {        PersistenceManagerXml pmXML = JavaXMLBindingFactory.createPersistenceManagerXml(layoutDescriptorPath, layoutMappingPath);        PortletPage page = (PortletPage) pmXML.load();        page.setLayoutDescriptor(layoutDescriptorPath);        return page;    }    /**     * Loads the portlet tab associated with this descriptor     *     * @param descriptorPath location of the layout.xml     * @param mappingPath    location of the mapping file     * @return the portlet tab     * @throws PersistenceManagerException if a descriptor error occurs     */    public static PortletTabbedPane loadPortletTabs(String descriptorPath, URL mappingPath) throws PersistenceManagerException {        PersistenceManagerXml pmXML = JavaXMLBindingFactory.createPersistenceManagerXml(descriptorPath, mappingPath);        return (PortletTabbedPane) pmXML.load();    }    /**     * Saves the portlet page associated with this descriptor     *     * @param pc             the portlet container to load     * @param descriptorPath location of the layout.xml     * @param mappingPath    location of the mapping file     * @throws PersistenceManagerException if a descriptor error occurs     */    public static void saveLayoutComponent(Object pc, String descriptorPath, URL mappingPath) throws PersistenceManagerException {        PersistenceManagerXml pmXML = JavaXMLBindingFactory.createPersistenceManagerXml(descriptorPath, mappingPath);        pmXML.save(pc);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -