001: /**********************************************************************************
002: * $URL:https://source.sakaiproject.org/svn/osp/trunk/common/api/src/java/org/theospi/portfolio/guidance/model/GuidanceItem.java $
003: * $Id:GuidanceItem.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.guidance.model;
021:
022: import java.util.ArrayList;
023: import java.util.List;
024:
025: import org.sakaiproject.metaobj.shared.model.IdentifiableObject;
026:
027: /**
028: * Created by IntelliJ IDEA.
029: * User: John Ellis
030: * Date: Nov 11, 2005
031: * Time: 12:06:34 PM
032: * To change this template use File | Settings | File Templates.
033: */
034: public class GuidanceItem extends IdentifiableObject {
035:
036: private String type;
037: private String text = "";
038: private Guidance guidance;
039: private List attachments;
040:
041: public GuidanceItem() {
042: }
043:
044: public GuidanceItem(Guidance guidance, String type) {
045: this .type = type;
046: this .guidance = guidance;
047: attachments = new ArrayList();
048: }
049:
050: public String getType() {
051: return type;
052: }
053:
054: public void setType(String type) {
055: this .type = type;
056: }
057:
058: public String getText() {
059: return text;
060: }
061:
062: public boolean isActiveContent() {
063: if ((text != null && text.trim().length() > 0)
064: || (attachments != null && attachments.size() > 0)) {
065: return true;
066: }
067: return false;
068: }
069:
070: /**
071: * This can't be concat-ed because it is in html
072: * @return String
073: */
074: public String getLimitedText() {
075: String t = text;
076: //if(t != null && t.length() > 100)
077: // t = t.substring(0, 100) + "...";
078: return t;
079: }
080:
081: public void setText(String text) {
082: this .text = text;
083: }
084:
085: public Guidance getGuidance() {
086: return guidance;
087: }
088:
089: public void setGuidance(Guidance guidance) {
090: this .guidance = guidance;
091: }
092:
093: /**
094: * @return List of GuidanceItemAttachment
095: */
096: public List getAttachments() {
097: return attachments;
098: }
099:
100: /**
101: * @param attachments List of GuidanceItemAttachment
102: */
103: public void setAttachments(List attachments) {
104: this.attachments = attachments;
105: }
106: }
|