int profileId = editedUserProfile.getProfileId();
ulStore.setStructureStylesheetUserPreferences(staticData.getPerson(), profileId, ssup);
}
private final void renameTab(String tabId, String tabName, String tabExternalId) throws PortalException {
IUserLayoutFolderDescription tab=(IUserLayoutFolderDescription)ulm.getNode(tabId);
if(ulm.canUpdateNode(ulm.getNode(tabId))) {
if (tabName == null || tabName.trim().length() == 0) {
tab.setName(BLANK_TAB_NAME);
} else {
tab.setName(tabName);
}
ulm.updateNode(tab);
// Update the externalId...
StructureStylesheetUserPreferences ssup = userPrefs.getStructureStylesheetUserPreferences();
if (tabExternalId != null && tabExternalId.trim().length() != 0) {
try {
ssup.setFolderAttributeValue(tab.getId(), "externalId", tabExternalId);
ulStore.setStructureStylesheetUserPreferences(staticData.getPerson(),
editedUserProfile.getProfileId(), ssup);
} catch (Exception e) {
throw new PortalException("Failed to set the 'externalId' attribute of tab '" +
tabId + "' in StructureStylesheetUserPreferences", e);
}
} else {
// tabExternalId is not specified... need to remove it if present...
if (ssup.getDefinedFolderAttributeValue(tab.getId(), "externalId") != null) {
// It *is* previously specified, and being removed...
try {
// Setting to null and saving will remove it from DB.
ssup.setFolderAttributeValue(tab.getId(), "externalId", null);
ulStore.setStructureStylesheetUserPreferences(staticData.getPerson(),
editedUserProfile.getProfileId(), ssup);
} catch (Exception e) {
throw new PortalException("Failed to remove the 'externalId' attribute of tab '" +
tabId + "' in StructureStylesheetUserPreferences", e);