/** * Access the creator of this object. * * @return The User object representing the creator. */ public String getCreator() { return m_properties.getProperty(ResourceProperties.PROP_CREATOR); }
/** * Access the person of last modificaiton * * @return the User */ public String getAuthorLastModified() { return m_properties.getProperty(ResourceProperties.PROP_MODIFIED_BY); }
/** * Access the creator of this object. * * @return String The creator's user id. */ public String getCreator() { return m_properties.getProperty(ResourceProperties.PROP_CREATOR); }
/** * Access the person of last modificaiton * * @return the User's Id */ public String getAuthorLastModified() { return m_properties.getProperty(ResourceProperties.PROP_MODIFIED_BY); }
/** * {@inheritDoc} */ public int getResubmissionNum() { String numString = StringUtils.trimToNull(m_properties.getProperty(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER)); return numString != null?Integer.valueOf(numString).intValue():0; }
private String getContainingFolderDisplayName(String rootId,String filename) throws IdUnusedException, TypeException, PermissionException { //dont manipulate filename when you are a zip file from a root folder level if(!(rootId.split("/").length > 3) && (filename.split("/").length<2) &&filename.endsWith(".zip")){ return filename; } String filenameArr[] = filename.split(Entity.SEPARATOR); //return rootId when you you zip from sub folder level and gives something like "group-user/site-id/user-id/" when zipping from root folder level by using filenameArr String contentEditStr = (rootId.split("/").length > 3)?rootId:rootId+filenameArr[0]+Entity.SEPARATOR; ContentCollectionEdit collectionEdit = (ContentCollectionEdit) ContentHostingService.getCollection(contentEditStr); ResourcePropertiesEdit props = collectionEdit.getPropertiesEdit(); String displayName = props.getProperty(ResourcePropertiesEdit.PROP_DISPLAY_NAME); //returns displayname along with the filename for zipping from sub folder level if(contentEditStr.equals(rootId)) { return displayName +Entity.SEPARATOR+ filename; } else { // just replaces the user-id with the displayname and returns the filename return filename.replaceFirst(filenameArr[0],displayName); } }
/** * remove the linked Gradebook item related with the assignment * @param pEdit * @param context */ private void removeAssociatedGradebookItem(ResourcePropertiesEdit pEdit, String context) { String associatedGradebookAssignment = pEdit.getProperty(AssignmentService.PROP_ASSIGNMENT_ASSOCIATE_GRADEBOOK_ASSIGNMENT); if (associatedGradebookAssignment != null) { boolean isExternalAssignmentDefined = m_gradebookExternalAssessmentService.isExternalAssignmentDefined(context, associatedGradebookAssignment); if (isExternalAssignmentDefined) { m_gradebookExternalAssessmentService.removeExternalAssessment(context, associatedGradebookAssignment); } } }
/** * Will determine if there is an announcement associated * with this assignment and removes it, if found. * @param channel AnnouncementChannel * @param aEdit AssignmentEdit * @param pEdit ResourcePropertiesEdit */ private void removeAssociatedAnnouncementItem(AnnouncementChannel channel, AssignmentEdit aEdit, ResourcePropertiesEdit pEdit) { if (channel != null) { String openDateAnnounced = StringUtils.trimToNull(pEdit.getProperty("new_assignment_open_date_announced")); String openDateAnnouncementId = StringUtils.trimToNull(pEdit.getProperty(ResourceProperties.PROP_ASSIGNMENT_OPENDATE_ANNOUNCEMENT_MESSAGE_ID)); if (openDateAnnounced != null && openDateAnnouncementId != null) { try { channel.removeMessage(openDateAnnouncementId); } catch (PermissionException e) { M_log.warn(":removeAnnouncement " + e.getMessage()); } } } }
protected Locale setSiteLanguage(Site site) { ResourceLoader rl = new ResourceLoader(); String locale_string = null; if(site != null) { ResourcePropertiesEdit props = site.getPropertiesEdit(); locale_string = props.getProperty("locale_string"); log.debug("setSiteLanguage - locale_string property: {}", locale_string); } Locale loc = null; // if no language was specified when creating the site, set default language to session if(locale_string == null || locale_string == "") { log.debug("setSiteLanguage - no locale, setting null."); } // if you have indicated a language when creating the site, set selected language to session else { loc = getLocaleFromString(locale_string); log.debug("setSiteLanguage - locale: {}", loc); } loc = rl.setContextLocale(loc); return loc; }
protected Locale setSiteLanguage(Site site) { ResourceLoader rl = new ResourceLoader(); String locale_string = null; if(site != null) { ResourcePropertiesEdit props = site.getPropertiesEdit(); locale_string = props.getProperty("locale_string"); log.debug("setSiteLanguage - locale_string property: {}", locale_string); } Locale loc = null; // if no language was specified when creating the site, set default language to session if(locale_string == null || locale_string == "") { log.debug("setSiteLanguage - no locale, setting null."); } // if you have indicated a language when creating the site, set selected language to session else { loc = getLocaleFromString(locale_string); log.debug("setSiteLanguage - locale: {}", loc); } loc = rl.setContextLocale(loc); return loc; }
String now = timeService.newTime().toString(); if (p.getProperty(ResourceProperties.PROP_CREATOR) == null) if (p.getProperty(ResourceProperties.PROP_CREATION_DATE) == null) if (p.getProperty(ResourceProperties.PROP_MODIFIED_BY) == null) if (p.getProperty(ResourceProperties.PROP_MODIFIED_DATE) == null)
resourceProperties = contentCollectionEdit.getPropertiesEdit(); if (!("true".equals(resourceProperties.getProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT)))) { resourceProperties.addProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT, "true"); foldersUpdated++;
public void setPriority() String sortBy = props.getProperty(ResourceProperties.PROP_CONTENT_PRIORITY); if(sortBy == null)
/** * {@inheritDoc} */ public Time getCloseTime() { String closeTimeString = StringUtils.trimToNull(m_properties.getProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME)); if (closeTimeString != null && getResubmissionNum() != 0) { // return the close time if it is set return TimeService.newTime(Long.parseLong(closeTimeString)); } else { // else use the assignment close time setting Assignment a = getAssignment(); return a!=null?a.getCloseTime():null; } }
resourceProperties = contentCollectionEdit.getPropertiesEdit(); if (!("true".equals(resourceProperties.getProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT)))) { resourceProperties.addProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT, "true"); foldersUpdated++;
String siteProperty = siteProperties.getProperty(SITE_PROPERTY_COURSE_SITE_PUBLISHED);
ResourcePropertiesEdit rp = contentCollection.getPropertiesEdit(); if (rp.getProperty(propName) != null) { rp.removeProperty(propName);
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)
if (StringUtils.isBlank(p.getProperty(ResourceProperties.PROP_COPYRIGHT_CHOICE))) { String copyright = m_serverConfigurationService.getString("copyright.type.default", "not_determined");
String sortBy = props.getProperty(ResourceProperties.PROP_CONTENT_PRIORITY); if(sortBy == null)