private JSApplication exportPA(MutablePortletApplication pa)
throws SerializerException
{
JSApplication app = new JSApplication();
System.out.println("--processed PA " + pa.getName() + " with id="
+ pa.getId());
app.setID(pa.getId().toString());
app.setName(pa.getName());
/**
* while more PAs for each portletDef
* list:entityMan:getPortletEntity(pd)
*/
PortletDefinitionList portletList = pa.getPortletDefinitionList(); // .get(JetspeedObjectID.createFromString(TEST_PORTLET));
Iterator pi = portletList.iterator();
PortletDefinition pd = null;
JSPortlets portlets = new JSPortlets();
while (pi.hasNext())
{
try
{
pd = (PortletDefinition) pi.next();
JSPortlet p = exportPD(pd);
if (p != null)
{
System.out.println("--processed PA " + pa.getName()
+ " with pd=" + pd.getName());
portlets.add(p);
} else
System.out.println("--processed PA " + pa.getName()
+ " with NULL pd=" + pd.getName());
} catch (Exception e)
{
throw new SerializerException(
SerializerException.CREATE_SERIALIZED_OBJECT_FAILED
.create(new String[]
{"PortletDefinition", e.getMessage()}));
}
}
app.setPortlets(portlets);
return app;
}