{
CustomPortletMode jcpm = jpa.addCustomPortletMode(cpm.getPortletMode());
jcpm.setPortalManaged(cpm.isPortalManaged());
for (org.apache.pluto.container.om.portlet.Description desc : cpm.getDescriptions())
{
Description jdesc = jcpm.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
}
for (org.apache.pluto.container.om.portlet.CustomWindowState cws : pa.getCustomWindowStates())
{
CustomWindowState jcws = jpa.addCustomWindowState(cws.getWindowState());
for (org.apache.pluto.container.om.portlet.Description desc : cws.getDescriptions())
{
Description jdesc = jcws.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
}
for (org.apache.pluto.container.om.portlet.EventDefinition ed : pa.getEventDefinitions())
{
EventDefinition jed = null;
if (ed.getQName() != null)
{
jed = jpa.addEventDefinition(ed.getQName());
}
else
{
jed =jpa.addEventDefinition(ed.getName());
}
jed.setValueType(ed.getValueType());
for (QName alias : ed.getAliases())
{
jed.addAlias(alias);
}
for (org.apache.pluto.container.om.portlet.Description desc : ed.getDescriptions())
{
Description jdesc = jed.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
}
for (org.apache.pluto.container.om.portlet.FilterMapping fm : pa.getFilterMappings())
{
FilterMapping jfm = jpa.addFilterMapping(fm.getFilterName());
for (String portletName : fm.getPortletNames())
{
jfm.addPortletName(portletName);
}
}
for (org.apache.pluto.container.om.portlet.Filter f : pa.getFilters())
{
Filter jf = jpa.addFilter(f.getFilterName());
jf.setFilterClass(f.getFilterClass());
for (org.apache.pluto.container.om.portlet.Description desc : f.getDescriptions())
{
Description jdesc = jf.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
for (org.apache.pluto.container.om.portlet.DisplayName dn : f.getDisplayNames())
{
DisplayName jdn = jf.addDisplayName(dn.getLang());
jdn.setDisplayName(dn.getDisplayName());
}
for (org.apache.pluto.container.om.portlet.InitParam ip : f.getInitParams())
{
InitParam jip = jf.addInitParam(ip.getParamName());
jip.setParamValue(ip.getParamValue());
for (org.apache.pluto.container.om.portlet.Description desc : ip.getDescriptions())
{
Description jdesc = jip.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
}
for (String lc : f.getLifecycles())
{
jf.addLifecycle(lc);
}
}
for (org.apache.pluto.container.om.portlet.Listener l : pa.getListeners())
{
Listener jl = jpa.addListener(l.getListenerClass());
for (org.apache.pluto.container.om.portlet.Description desc : l.getDescriptions())
{
Description jdesc = jl.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
for (org.apache.pluto.container.om.portlet.DisplayName dn : l.getDisplayNames())
{
DisplayName jdn = jl.addDisplayName(dn.getLang());
jdn.setDisplayName(dn.getDisplayName());
}
}
for (org.apache.pluto.container.om.portlet.PublicRenderParameter prd : pa.getPublicRenderParameters())
{
PublicRenderParameter jprp = null;
if (prd.getQName() != null)
{
jprp = jpa.addPublicRenderParameter(prd.getQName(), prd.getIdentifier());
}
else
{
jprp = jpa.addPublicRenderParameter(prd.getName(), prd.getIdentifier());
}
for (QName alias : prd.getAliases())
{
jprp.addAlias(alias);
}
for (org.apache.pluto.container.om.portlet.Description desc : prd.getDescriptions())
{
Description jdesc = jprp.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
}
for (org.apache.pluto.container.om.portlet.SecurityConstraint sc : pa.getSecurityConstraints())
{
SecurityConstraint jsc = jpa.addSecurityConstraint(sc.getUserDataConstraint().getTransportGuarantee());
for (org.apache.pluto.container.om.portlet.DisplayName dn : sc.getDisplayNames())
{
DisplayName jdn = jsc.addDisplayName(dn.getLang());
jdn.setDisplayName(dn.getDisplayName());
}
for (String portletName : sc.getPortletNames())
{
jsc.addPortletName(portletName);
}
}
for (org.apache.pluto.container.om.portlet.UserAttribute ua : pa.getUserAttributes())
{
UserAttribute jua = jpa.addUserAttribute(ua.getName());
for (org.apache.pluto.container.om.portlet.Description desc : ua.getDescriptions())
{
Description jdesc = jua.addDescription(desc.getLang());
jdesc.setDescription(desc.getDescription());
}
}
return jpa;
}