public int compareTo(final PortletConfiguration that) { return getRow().compareTo(that.getRow()); }
@Override public PortletConfiguration visit(final GadgetState state) { return new PortletConfigurationImpl(itemId, page, column, row, Option.some(state.getGadgetSpecUri()), state.getColor(), state.getUserPrefs(), Option.<ModuleCompleteKey>none()); }
@Override public PortletConfiguration visit(final LocalDashboardItemState state) { final Option<URI> openSocialSpecUri = state.getDashboardItemModuleId().getReplacedGadgetId().map(new Function<OpenSocialDashboardItemModuleId, URI>() { @Override public URI apply(final OpenSocialDashboardItemModuleId input) { return input.getSpecUri(); } }); final Option<ModuleCompleteKey> moduleKey = Option.some(state.getDashboardItemModuleId().getFullModuleKey()); return new PortletConfigurationImpl(itemId, page, column, row, openSocialSpecUri, state.getColor(), Collections.<String, String>emptyMap(), moduleKey); } });
private PortletConfiguration createConfigurationFromGv(final GenericValue portletConfigGV) { final Long id = portletConfigGV.getLong(Columns.ID); final PropertySet portletConfiguration = propertySetFactory.buildMemoryPropertySet(portletConfigGV.getEntityName(), id); final String portletKey = portletConfigGV.getString(Columns.PORTLETKEY); final Portlet portlet = StringUtils.isNotEmpty(portletKey) ? portletAccessManager.getPortlet(portletKey) : null; return new PortletConfigurationImpl(id, portletConfigGV.getLong(Columns.PORTALPAGE), portletConfigGV.getString(Columns.PORTLETKEY), portlet, portletConfigGV.getInteger(Columns.COLUMN), portletConfigGV.getInteger(Columns.ROW), portletConfiguration); }
PortletConfiguration newConfig = new PortletConfigurationImpl( pc.getId(), pc.getDashboardPageId(),
/** * Copy the passed portlet configuration. * * @param portletConfiguration the portlet configuration to copy. * @return the new deeply copied portlet configuration. The underlying property set is cloned into a new memory * property set. */ private PortletConfiguration copyConfiguration(final PortletConfiguration portletConfiguration) { if (portletConfiguration != null) { return new PortletConfigurationImpl(portletConfiguration.getId(), portletConfiguration.getDashboardPageId(), portletConfiguration.getColumn(), portletConfiguration.getRow(), portletConfiguration.getOpenSocialSpecUri(), portletConfiguration.getColor(), portletConfiguration.getUserPrefs(), portletConfiguration.getCompleteModuleKey()); } else { return null; } }
private PortletConfiguration createConfigurationFromGv(final GenericValue portletConfigGV) { if (portletConfigGV == null) { return null; } final Long id = portletConfigGV.getLong(Columns.ID); final Option<URI> openSocialSpecUri = Option.option(getGadgetXmlURI(portletConfigGV.getString(Columns.GADGET_XML), id)); final String colorString = portletConfigGV.getString(Columns.COLOR); //legacy portlets may not have a value for these fields final Color gadgetColor = StringUtils.isEmpty(colorString) ? null : Color.valueOf(colorString); final Option<ModuleCompleteKey> completeModuleKey = Option.option(portletConfigGV.getString(Columns.MODULE_KEY)).map(new Function<String, ModuleCompleteKey>() { @Override public ModuleCompleteKey apply(final String input) { return new ModuleCompleteKey(input); } }); final Map<String, String> userPrefs = getUserPreferences(id, openSocialSpecUri, completeModuleKey); return new PortletConfigurationImpl(id, portletConfigGV.getLong(Columns.PORTALPAGE), portletConfigGV.getInteger(Columns.COLUMN), portletConfigGV.getInteger(Columns.ROW), openSocialSpecUri, gadgetColor, userPrefs, completeModuleKey); }