@Override public PortletConfiguration addDashBoardItem(final Long portalPageId, final Integer column, final Integer row, final Option<URI> openSocialSpecUri, final Color color, final Map<String, String> userPreferences, final Option<ModuleCompleteKey> moduleKey) { return portletConfigurationStore.addDashboardItem(portalPageId, null, column, row, openSocialSpecUri, color, userPreferences, moduleKey); }
@Override public PortletConfiguration addDashboardItem(final Long pageId, final Long portletConfigurationId, final Integer column, final Integer row, final Option<URI> openSocialSpecUri, final Color color, final Map<String, String> userPreferences, final Option<ModuleCompleteKey> moduleKey) { notNull("pageId", pageId); notNull("column", column); notNull("row", row); notNull("userPreferences", userPreferences); notNull("color", color); PortletConfiguration returnConfig = null; try { returnConfig = delegateStore.addDashboardItem(pageId, portletConfigurationId, column, row, openSocialSpecUri, color, userPreferences, moduleKey); } finally { if (returnConfig != null) { // Remove the cached page as this will now be stale and not contain the new entry. cacheByPageId.remove(returnConfig.getDashboardPageId()); } } return copyConfiguration(returnConfig); }
portletConfigurationStore.addDashboardItem(toAdd.getDashboardPageId(), toAdd.getId(), toAdd.getColumn(), toAdd.getRow(), toAdd.getOpenSocialSpecUri(), toAdd.getColor(), toAdd.getUserPrefs(), toAdd.getCompleteModuleKey());
public void visit(final AddGadgetChange addGadgetChange) { final DashboardState.ColumnIndex column = addGadgetChange.getColumnIndex(); final Iterable<DashboardItemState> dashboardItems = updateDashboardState.getDashboardColumns().getItemsInColumn(column); final DashboardItemState newItemState = addGadgetChange.getDashboardItemState(); final Long portalPageId = toLong(updateDashboardState.getId()); final PortletConfiguration pc = toPortletConfiguration(newItemState, portalPageId, column.index(), addGadgetChange.getRowIndex()); portletConfigurationStore.addDashboardItem(pc.getDashboardPageId(), pc.getId(), pc.getColumn(), pc.getRow(), pc.getOpenSocialSpecUri(), pc.getColor(), pc.getUserPrefs(), pc.getCompleteModuleKey()); moveDashboardItemsOnePositionDown(dashboardItems, addGadgetChange.getRowIndex() + 1, column.index()); }