Skip to content

Commit

Permalink
SAK-28008 Add attachments, descriptions & short descriptions to Forum…
Browse files Browse the repository at this point in the history
…s entity broker feed

git-svn-id: https://source.sakaiproject.org/svn/msgcntr/trunk@315370 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
bethkirschner committed Nov 12, 2014
1 parent 9f4dc24 commit ecef198
Show file tree
Hide file tree
Showing 5 changed files with 298 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/**********************************************************************************
*
* Copyright (c) 2014 The Sakai Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ECL-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**********************************************************************************/
package org.sakaiproject.api.app.messageforums.entity;

/**
* Class used to return information about attachments.
*
*/
public class DecoratedAttachment {
private String id;
private String name;
private String type;
private String url;
private String ref;

public DecoratedAttachment() {
}

public DecoratedAttachment(String id, String name, String type, String url,
String ref) {
this.id = id;
this.name = name;
this.type = type;
this.url = url;
this.ref = ref;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public void setUrl(String url) {
this.url = url;
}

public String getUrl() {
return url;
}

public void setRef(String ref) {
this.ref = ref;
}

public String getRef() {
return ref;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,122 +3,142 @@
import java.util.ArrayList;
import java.util.List;

public class DecoratedForumInfo{
public class DecoratedForumInfo {

private Long forumId;
private String forumTitle;
private List<DecoratedTopicInfo> topics = new ArrayList<DecoratedTopicInfo>();
private String shortDescription;
private String description;
private List<DecoratedAttachment> attachments;
private Boolean isLocked;
private Boolean isPostFirst;
private Boolean isAvailabilityRestricted;
/**
* An epoch date in seconds. NOT milliseconds.
*/
private Long openDate;
/**
* An epoch date in seconds. NOT milliseconds.
*/
private Long closeDate;
private String gradebookItemName;

public DecoratedForumInfo(Long forumId, String forumTitle){
this.forumId = forumId;
this.forumTitle = forumTitle;
}

public DecoratedForumInfo(Long forumId, String forumTitle, Boolean isLocked,
Boolean isPostFirst, Boolean isAvailabilityRestricted, Long openDate,
Long closeDate, String gradebookItemName) {
this(forumId, forumTitle);
this.isLocked = isLocked;
this.isPostFirst = isPostFirst;
this.isAvailabilityRestricted = isAvailabilityRestricted;
this.openDate = openDate;
this.closeDate = closeDate;
this.gradebookItemName = gradebookItemName;
}
private Boolean isPostFirst;
private Boolean isAvailabilityRestricted;
private Long openDate; // An epoch date in seconds. NOT milliseconds.
private Long closeDate; // An epoch date in seconds. NOT milliseconds.
private String gradebookItemName;

public DecoratedForumInfo(Long forumId, String forumTitle,
List<DecoratedAttachment> attachments, String shortDescription,
String description) {
this.forumId = forumId;
this.forumTitle = forumTitle;
this.attachments = attachments;
this.shortDescription = shortDescription;
this.description = description;
}

public DecoratedForumInfo(Long forumId, String forumTitle,
List<DecoratedAttachment> attachments, String shortDescription,
String description, Boolean isLocked, Boolean isPostFirst,
Boolean isAvailabilityRestricted, Long openDate, Long closeDate,
String gradebookItemName) {
this(forumId, forumTitle, attachments, shortDescription, description);
this.isLocked = isLocked;
this.isPostFirst = isPostFirst;
this.isAvailabilityRestricted = isAvailabilityRestricted;
this.openDate = openDate;
this.closeDate = closeDate;
this.gradebookItemName = gradebookItemName;
}

public Long getForumId() {
return forumId;
}


public void setForumId(Long forumId) {
this.forumId = forumId;
}


public String getForumTitle() {
return forumTitle;
}


public void setForumTitle(String forumTitle) {
this.forumTitle = forumTitle;
}


public List<DecoratedTopicInfo> getTopics() {
return topics;
}


public void setTopics(List<DecoratedTopicInfo> topics) {
this.topics = topics;
}




public void addTopic(DecoratedTopicInfo topic){
public void addTopic(DecoratedTopicInfo topic) {
this.topics.add(topic);
}

public Boolean getIsLocked() {
return isLocked;
return isLocked;
}

public void setIsLocked(Boolean isLocked) {
this.isLocked = isLocked;
this.isLocked = isLocked;
}

public Boolean getIsPostFirst() {
return isPostFirst;
return isPostFirst;
}

public void setIsPostFirst(Boolean isPostFirst) {
this.isPostFirst = isPostFirst;
this.isPostFirst = isPostFirst;
}

public Boolean getIsAvailabilityRestricted() {
return isAvailabilityRestricted;
return isAvailabilityRestricted;
}

public void setIsAvailabilityRestricted(Boolean isAvailabilityRestricted) {
this.isAvailabilityRestricted = isAvailabilityRestricted;
this.isAvailabilityRestricted = isAvailabilityRestricted;
}

public Long getOpenDate() {
return openDate;
return openDate;
}

public void setOpenDate(Long openDate) {
this.openDate = openDate;
this.openDate = openDate;
}

public Long getCloseDate() {
return closeDate;
return closeDate;
}

public void setCloseDate(Long closeDate) {
this.closeDate = closeDate;
this.closeDate = closeDate;
}

public String getGradebookItemName() {
return gradebookItemName;
return gradebookItemName;
}

public void setGradebookItemName(String gradebookItemName) {
this.gradebookItemName = gradebookItemName;
this.gradebookItemName = gradebookItemName;
}

public String getShortDescription() {
return shortDescription;
}

public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public List<DecoratedAttachment> getAttachments() {
return attachments;
}

public void setAttachments(List<DecoratedAttachment> attachments) {
this.attachments = attachments;
}
}
Loading

0 comments on commit ecef198

Please sign in to comment.