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