001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package org.libresource.core.ejb;
034:
035: import org.libresource.LibresourceResourceBase;
036:
037: import org.libresource.core.util.ProjectResourceUtil;
038:
039: import java.util.Date;
040:
041: import javax.ejb.CreateException;
042:
043: /**
044: * A libresource Project
045: *
046: * @libresource.resource name="Project" service="LibresourceCore"
047: *
048: * @ejb.finder signature= "java.util.Collection findAll()"
049: * query ="SELECT OBJECT(p) FROM ProjectResource p"
050: * transaction-type="Supports"
051: */
052: public abstract class ProjectResourceBean extends
053: LibresourceResourceBase {
054: /**
055: * @ejb.create-method
056: */
057: public String ejbCreate(String name, String description,
058: String creator) throws CreateException {
059: setId(ProjectResourceUtil.generateGUID(this ));
060: setName(name);
061: setDescription(description);
062: setLastEditedSummary(new Date());
063: setLastEditor(creator);
064:
065: return null;
066: }
067:
068: // persistents fields
069:
070: /**
071: * @ejb.persistent-field
072: * @ejb.interface-method
073: * @ejb.value-object match="libresource"
074: * @ejb.transaction type="Supports"
075: */
076: public abstract String getId();
077:
078: /**
079: * @ejb.persistent-field
080: * @ejb.interface-method
081: * @ejb.transaction type="Mandatory"
082: */
083: public abstract void setId(String id);
084:
085: /**
086: * @ejb.interface-method
087: * @ejb.value-object match="libresource"
088: * @ejb.transaction type="Supports"
089: */
090: public String getShortResourceName() {
091: return getName();
092: }
093:
094: /**
095: * @ejb.persistent-field
096: * @ejb.interface-method
097: * @ejb.value-object match="libresource"
098: * @ejb.transaction type="Supports"
099: */
100: public abstract String getName();
101:
102: /**
103: * @ejb.persistent-field
104: * @ejb.interface-method
105: * @ejb.transaction type="Mandatory"
106: */
107: public abstract void setName(String name);
108:
109: /**
110: * @ejb.persistent-field
111: * @ejb.interface-method
112: * @ejb.value-object match="libresource"
113: * @ejb.transaction type="Supports"
114: */
115: public abstract String getDescription();
116:
117: /**
118: * @ejb.persistent-field
119: * @ejb.interface-method
120: * @ejb.transaction type="Mandatory"
121: */
122: public abstract void setDescription(String description);
123:
124: /**
125: * @ejb.persistent-field
126: * @ejb.interface-method
127: * @ejb.value-object match="libresource"
128: * @ejb.transaction type="Supports"
129: */
130: public abstract String getSummary();
131:
132: /**
133: * @ejb.persistent-field
134: * @ejb.interface-method
135: * @ejb.transaction type="Mandatory"
136: */
137: public abstract void setSummary(String summary);
138:
139: /**
140: * @ejb.persistent-field
141: * @ejb.interface-method
142: * @ejb.value-object match="libresource"
143: * @ejb.transaction type="Supports"
144: */
145: public abstract Date getLastEditedSummary();
146:
147: /**
148: * @ejb.persistent-field
149: * @ejb.interface-method
150: * @ejb.transaction type="Mandatory"
151: */
152: public abstract void setLastEditedSummary(Date lastEdited);
153:
154: /**
155: * @ejb.persistent-field
156: * @ejb.interface-method
157: * @ejb.value-object match="libresource"
158: * @ejb.transaction type="Supports"
159: */
160: public abstract String getLastEditor();
161:
162: /**
163: * @ejb.persistent-field
164: * @ejb.interface-method
165: * @ejb.transaction type="Mandatory"
166: */
167: public abstract void setLastEditor(String lastEditor);
168: }
|