To modify settings for a portlet or portlet template object from a remote application, use the IPortlet and IPortletTemplate interfaces in the IDK.
Java
public static void editPortletTemplate(IPortletTemplate portletTemplate) throws PortalException, MalformedURLException, RemoteException { portletTemplate.setAlignment(Alignment.Narrow); portletTemplate.setName("IDK Test Document EDITED"); portletTemplate.setDescription("Edited by IDK example"); portletTemplate.save(); } public static void addAdminSetting(IPortletTemplate portletTemplate, String settingName, String settingValue) throws PortalException, MalformedURLException, RemoteException { portletTemplate.addAdminSetting(settingName, settingValue); portletTemplate.save(); }
.NET (C#)
public static void EditPortletTemplate(IPortletTemplate portletTemplate) throws PortalException, MalformedURLException, RemoteException { portletTemplate.SetAlignment(Alignment.Narrow); portletTemplate.SetName("IDK Test Document EDITED"); portletTemplate.SetDescription("Edited by IDK example"); portletTemplate.Save(); } public static void AddAdminSetting(IPortletTemplate portletTemplate, string settingName, string settingValue) { portletTemplate.AddAdminSetting(settingName, settingValue); portletTemplate.Save(); }
.NET (VB)
Public Shared Sub EditWebLinkDocument(ByVal portletTemplateManager As IPortletTemplate) portletTemplate.SetAlignment(Alignment.Narrow) portletTemplate.SetName("IDK Test Document EDITED") portletTemplate.SetDescription("Edited by IDK example") portletTemplate.Save() EndSub Public Shared Sub AddAdminSetting(ByRef portletTemplateManager As IPortletTemplate, ByVal settingName As String, ByVal settingValue As String) portletTemplate.AddAdminSetting(settingName, settingValue) portletTemplate.Save() EndSub