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...");