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.forum.ejb;
034:
035: import org.libresource.LibresourceResourceBase;
036:
037: import org.libresource.forum.util.ForumResourceUtil;
038:
039: import javax.ejb.CreateException;
040:
041: /**
042: * A libresource Forum
043: *
044: * @libresource.resource name="Forum" service="LibresourceForum"
045: */
046: public abstract class ForumResourceBean extends LibresourceResourceBase {
047: /**
048: * @ejb.create-method
049: */
050: public String ejbCreate(String name, String description)
051: throws CreateException {
052: setId(ForumResourceUtil.generateGUID(this ));
053: setName(name);
054: setDescription(description);
055:
056: return null;
057: }
058:
059: // persistents fields
060:
061: /**
062: * @ejb.persistent-field
063: * @ejb.interface-method
064: * @ejb.value-object match="libresource"
065: * @ejb.transaction type="Supports"
066: */
067: public abstract String getId();
068:
069: /**
070: * @ejb.persistent-field
071: * @ejb.interface-method
072: * @ejb.transaction type="Mandatory"
073: */
074: public abstract void setId(String id);
075:
076: /**
077: * @ejb.interface-method
078: * @ejb.value-object match="libresource"
079: * @ejb.transaction type="Supports"
080: */
081: public String getShortResourceName() {
082: return getName();
083: }
084:
085: /**
086: * @ejb.persistent-field
087: * @ejb.interface-method
088: * @ejb.value-object match="libresource"
089: * @ejb.transaction type="Supports"
090: */
091: public abstract String getName();
092:
093: /**
094: * @ejb.persistent-field
095: * @ejb.interface-method
096: * @ejb.transaction type="Mandatory"
097: */
098: public abstract void setName(String name);
099:
100: /**
101: * @ejb.persistent-field
102: * @ejb.interface-method
103: * @ejb.value-object match="libresource"
104: * @ejb.transaction type="Supports"
105: */
106: public abstract String getDescription();
107:
108: /**
109: * @ejb.persistent-field
110: * @ejb.interface-method
111: * @ejb.transaction type="Mandatory"
112: */
113: public abstract void setDescription(String description);
114: }
|