public void setReplyToList(boolean replyToList) { if (replyToList) { getPropertiesEdit().addProperty(PROP_MAIL_CHANNEL_REPLY_LIST, "true"); } else { getPropertiesEdit().removeProperty(PROP_MAIL_CHANNEL_REPLY_LIST); } }
String now = timeService.newTime().toString(); if (p.getProperty(ResourceProperties.PROP_CREATOR) == null) p.addProperty(ResourceProperties.PROP_CREATOR, current); if (p.getProperty(ResourceProperties.PROP_CREATION_DATE) == null) p.addProperty(ResourceProperties.PROP_CREATION_DATE, now); if (p.getProperty(ResourceProperties.PROP_MODIFIED_BY) == null) p.addProperty(ResourceProperties.PROP_MODIFIED_BY, current); if (p.getProperty(ResourceProperties.PROP_MODIFIED_DATE) == null) p.addProperty(ResourceProperties.PROP_MODIFIED_DATE, now); p.addProperty(ResourceProperties.PROP_CONTENT_LENGTH, Long.toString(r.getContentLength())); p.addProperty(ResourceProperties.PROP_CONTENT_TYPE, r.getContentType()); p.addProperty(ResourceProperties.PROP_IS_COLLECTION, "false");
/** * @inheritDoc */ protected void setAll(Notification other) { BaseNotification bOther = (BaseNotification) other; m_id = bOther.m_id; m_filter = bOther.m_filter; m_properties = new BaseResourcePropertiesEdit(); m_properties.addAll(bOther.m_properties); m_functions = new Vector(); m_functions.addAll(bOther.m_functions); if (bOther.m_action != null) { m_action = bOther.m_action.getClone(); } }
public void setConditionallyReleased(boolean isConditionallyReleased) { try { Boolean oldValue = this.m_properties.getBooleanProperty(ConditionService.PROP_CONDITIONAL_RELEASE); if(oldValue.booleanValue() != isConditionallyReleased) { this.m_visibilityUpdated = true; } } catch (EntityPropertyNotDefinedException e) { // oldValue is false if(isConditionallyReleased) { this.m_visibilityUpdated = true; } } catch (EntityPropertyTypeException e) { // assume oldValue is false if(isConditionallyReleased) { this.m_visibilityUpdated = true; } } m_properties.addProperty(ConditionService.PROP_CONDITIONAL_RELEASE, Boolean.toString(isConditionallyReleased)); }
private void saveUserFavorites(String userId, UserFavorites favorites) throws PermissionException, InUseException, IdUnusedException, PortalHandlerException { if (userId == null) { return; } PreferencesEdit edit = PreferencesService.edit(userId); ResourcePropertiesEdit props = edit.getPropertiesEdit(org.sakaiproject.user.api.PreferencesService.SITENAV_PREFS_KEY); // Replace all existing values props.removeProperty(FAVORITES_PROPERTY); for (String siteId : favorites.favoriteSiteIds) { props.addPropertyToList(FAVORITES_PROPERTY, siteId); } props.removeProperty(AUTO_FAVORITE_ENABLED_PROPERTY); props.addProperty(AUTO_FAVORITE_ENABLED_PROPERTY, String.valueOf(favorites.autoFavoritesEnabled)); PreferencesService.commit(edit); }
/** * Create the live properties for the object. */ protected void addLiveProperties(ResourcePropertiesEdit props) { String current = SessionManager.getCurrentSessionUserId(); props.addProperty(ResourceProperties.PROP_CREATOR, current); props.addProperty(ResourceProperties.PROP_MODIFIED_BY, current); String now = TimeService.newTime().toString(); props.addProperty(ResourceProperties.PROP_CREATION_DATE, now); props.addProperty(ResourceProperties.PROP_MODIFIED_DATE, now); } // addLiveProperties
ResourcePropertiesEdit rp = contentCollection.getPropertiesEdit(); if (rp.getProperty(propName) != null) { rp.removeProperty(propName); rp.addProperty(propName, propValue);
p.clear(); p.addAll(oContent.getProperties()); p.clear(); p.addAll(oAssignment.getProperties()); String associatedGradebookAssignment = StringUtils.trimToNull(p.getProperty(PROP_ASSIGNMENT_ASSOCIATE_GRADEBOOK_ASSIGNMENT)); if (associatedGradebookAssignment != null) { p.removeProperty(PROP_ASSIGNMENT_ASSOCIATE_GRADEBOOK_ASSIGNMENT); p.addProperty(NEW_ASSIGNMENT_ADD_TO_GRADEBOOK, GRADEBOOK_INTEGRATION_ADD); p.removeProperty(ResourceProperties.NEW_ASSIGNMENT_CHECK_AUTO_ANNOUNCE); p.removeProperty("new_assignment_open_date_announced"); p.removeProperty(ResourceProperties.PROP_ASSIGNMENT_OPENDATE_ANNOUNCEMENT_MESSAGE_ID); p.removeProperty(ResourceProperties.NEW_ASSIGNMENT_CHECK_ADD_DUE_DATE); p.removeProperty("new_assignment_due_date_scheduled"); p.removeProperty(ResourceProperties.PROP_ASSIGNMENT_DUEDATE_CALENDAR_EVENT_ID);
m_properties.addAll(pOther); m_properties.addProperty(pOtherName, pOther.getProperty(pOtherName) .replaceAll(bOther.getSiteId(), getSiteId()));
m_createdUserId = m_properties.getProperty("CHEF:creator"); m_lastModifiedUserId = m_properties.getProperty("CHEF:modifiedby"); m_createdTime = m_properties.getTimeProperty("DAV:creationdate"); m_lastModifiedTime = m_properties.getTimeProperty("DAV:getlastmodified"); m_properties.removeProperty("CHEF:creator"); m_properties.removeProperty("CHEF:modifiedby"); m_properties.removeProperty("DAV:creationdate"); m_properties.removeProperty("DAV:getlastmodified");
/** * Access the creator of this object. * * @return String The creator's user id. */ public String getCreator() { return m_properties.getProperty(ResourceProperties.PROP_CREATOR); }
public Element toXml(Document doc, Stack stack) { Element syllabus = doc.createElement("syllabus"); if (stack.isEmpty()) { doc.appendChild(syllabus); } else { ((Element) stack.peek()).appendChild(syllabus); } stack.push(syllabus); syllabus.setAttribute("id", m_id); syllabus.setAttribute("subject", m_data.getTitle()); syllabus.setAttribute("body", m_data.getAsset()); m_properties.toXml(doc, stack); stack.pop(); return syllabus; }
m_createdUserId = m_properties.getProperty("CHEF:creator"); m_lastModifiedUserId = m_properties.getProperty("CHEF:modifiedby"); m_createdInstant = m_properties.getInstantProperty("DAV:creationdate"); m_lastModifiedInstant = m_properties.getInstantProperty("DAV:getlastmodified"); m_properties.removeProperty("CHEF:creator"); m_properties.removeProperty("CHEF:modifiedby"); m_properties.removeProperty("DAV:creationdate"); m_properties.removeProperty("DAV:getlastmodified");
String isThereEvent = pEdit.getProperty(NEW_ASSIGNMENT_DUE_DATE_SCHEDULED); if (isThereEvent != null && isThereEvent.equals(Boolean.TRUE.toString())) String oldEventId = pEdit.getProperty(ResourceProperties.PROP_ASSIGNMENT_DUEDATE_CALENDAR_EVENT_ID); if (oldEventId != null) pEdit.removeProperty(NEW_ASSIGNMENT_DUE_DATE_SCHEDULED); pEdit.removeProperty(ResourceProperties.PROP_ASSIGNMENT_DUEDATE_CALENDAR_EVENT_ID);
if (props.isLiveProperty(name)) throw new TypeException(name); props.removeProperty(name);
edit.getPropertiesEdit().removeProperty(ResourceProperties.PROP_CHANNEL_ENABLED); commitChannel(edit); channel = edit;
protected void addLiveSyllabusProperties(BaseResourceEdit r) { ResourcePropertiesEdit p = r.getPropertiesEdit(); String current = SessionManager.getCurrentSessionUserId(); p.addProperty(ResourceProperties.PROP_CREATOR, current); p.addProperty(ResourceProperties.PROP_MODIFIED_BY, current); String now = TimeService.newTime().toString(); p.addProperty(ResourceProperties.PROP_CREATION_DATE, now); p.addProperty(ResourceProperties.PROP_MODIFIED_DATE, now); p.addProperty(ResourceProperties.PROP_IS_COLLECTION, "false"); }
private void saveUserFavorites(String userId, UserFavorites favorites) throws PortalHandlerException { if (userId == null) { return; } PreferencesEdit edit = null; try { edit = PreferencesService.edit(userId); ResourcePropertiesEdit props = edit.getPropertiesEdit(org.sakaiproject.user.api.PreferencesService.SITENAV_PREFS_KEY); // Replace all existing values props.removeProperty(FAVORITES_PROPERTY); for (String siteId : favorites.favoriteSiteIds) { props.addPropertyToList(FAVORITES_PROPERTY, siteId); } props.removeProperty(AUTO_FAVORITE_ENABLED_PROPERTY); props.addProperty(AUTO_FAVORITE_ENABLED_PROPERTY, String.valueOf(favorites.autoFavoritesEnabled)); PreferencesService.commit(edit); } catch (PermissionException | InUseException | IdUnusedException e) { log.info("Exception editing user preferences", e); PreferencesService.cancel(edit); } }
.getProperty(ResourceProperties.PROP_DISPLAY_NAME))) { .removeProperty(ResourceProperties.PROP_DISPLAY_NAME); podcastResourceEditable.addProperty( ResourceProperties.PROP_DISPLAY_NAME, title); .getProperty(ResourceProperties.PROP_DESCRIPTION))) { .removeProperty(ResourceProperties.PROP_DESCRIPTION); podcastResourceEditable.addProperty( ResourceProperties.PROP_DESCRIPTION, description); podcastResourceEditable.removeProperty(DISPLAY_DATE); podcastResourceEditable.addProperty(DISPLAY_DATE, formatter.format(date));