PortletApplicationDefinition pad = Deploy.prepareArchive(uploadedFile, file, appName);
// Extract portlet application information to be added to
// portlet entity registry
log.info("Adding portlet application to registry: " + appName);
PortletApplicationEntityImpl pae = new PortletApplicationEntityImpl();
pae.setId(appName);
PortletDefinitionList pdl = pad.getPortletDefinitionList();
for (Iterator it = pdl.iterator(); it.hasNext();)
{
PortletDefinition pd = (PortletDefinition) it.next();
log.debug("Adding portlet: " + pd.getName());
PortletEntityImpl pe = new PortletEntityImpl();
pe.setId(pd.getName());
// Copy preferences
ArrayList destPrefs = new ArrayList();
PreferenceSet prefSet = pd.getPreferenceSet();
for (Iterator prefs = prefSet.iterator(); prefs.hasNext();)
{
Preference src = (Preference) prefs.next();
ArrayList destValues = new ArrayList();
for (Iterator values = src.getValues(); values.hasNext();)
{
destValues.add(values.next());
}
destPrefs.add(new PreferenceImpl(src.getName(), destValues));
}
pe.setPreferenceSet(new PreferenceSetImpl(destPrefs));
pae.addPortletEntity(pe);
}
// Create Digital Asset
log.debug("Creating Digital Asset...");
DigitalAssetVO newAsset = new DigitalAssetVO();