se.kmr.scam.server.impl
Class ContentBean

java.lang.Object
  extended byse.kmr.scam.server.impl.BeanCommon
      extended byse.kmr.scam.server.impl.ContentBean
All Implemented Interfaces:
ContentI, EnterpriseBean, Serializable, SessionBean

public class ContentBean
extends BeanCommon
implements ContentI, SessionBean

See Also:
Serialized Form

Field Summary
 
Fields inherited from class se.kmr.scam.server.impl.BeanCommon
ADMIN_ROLE, GUEST_ROLE
 
Constructor Summary
ContentBean()
           
 
Method Summary
 void copy(String id, String uri, String toId, String toUri)
          Copy file-content of a content-Resource to another Resource.
static int copyStream(InputStream is, OutputStream os)
           
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 InputStream get(String id, String uri)
          Get file-content of a content-Resource.
protected static File getMainFolder(String id)
           
protected  SessionContext getSessionContext()
          Get the sessioncontext
 URI lookup(String webdavUri)
          Lookup a WebDAV-URI on the format ///...
 void move(String id, String uri, String toId, String toUri)
          Move file-content of a content-Resource to another Resource.
 void remove(String id, String uri)
          Remove file-content of a content-Resource.
 long set(String id, String uri, InputStream is)
          Set file-content of a content-Resource.
 void setSessionContext(SessionContext sessionContext)
           
 
Methods inherited from class se.kmr.scam.server.impl.BeanCommon
abort, assertPermission, assertPermission, begin, close, commit, contains, create, filter, filter, getCaller, hasPermission, hasPermission, isCaller, isCallerInRole, list, lookup, open, open, remove, rollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentBean

public ContentBean()
Method Detail

getSessionContext

protected SessionContext getSessionContext()
Description copied from class: BeanCommon
Get the sessioncontext

Specified by:
getSessionContext in class BeanCommon
Returns:
the context

ejbCreate

public void ejbCreate()
               throws CreateException
Throws:
CreateException

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface SessionBean

setSessionContext

public void setSessionContext(SessionContext sessionContext)
Specified by:
setSessionContext in interface SessionBean

get

public InputStream get(String id,
                       String uri)
                throws ArchiveException
Get file-content of a content-Resource.

Specified by:
get in interface ContentI
Parameters:
id - Manifest
uri - content-Resource URI
Returns:
file-content
Throws:
ArchiveException

set

public long set(String id,
                String uri,
                InputStream is)
         throws ArchiveException
Set file-content of a content-Resource.

Specified by:
set in interface ContentI
Parameters:
id - Manifest
uri - content-Resource URI
is - file-content
Returns:
number of bytes written
Throws:
ArchiveException

remove

public void remove(String id,
                   String uri)
            throws ArchiveException
Remove file-content of a content-Resource.

Specified by:
remove in interface ContentI
Parameters:
id - identifies the manifest
uri - identifies the content reosurce.
Throws:
ArchiveException - thrown in case of exception removing the content

move

public void move(String id,
                 String uri,
                 String toId,
                 String toUri)
          throws ArchiveException
Move file-content of a content-Resource to another Resource.

Specified by:
move in interface ContentI
Parameters:
id - identifies the source Manifest
uri - the source content resource
toId - identifies the destination Manifest to move to (can be the same as id)
toUri - the destination content resource
Throws:
ArchiveException - thrown in case of exception while moving content

copy

public void copy(String id,
                 String uri,
                 String toId,
                 String toUri)
          throws ArchiveException
Copy file-content of a content-Resource to another Resource.

Specified by:
copy in interface ContentI
Parameters:
id - the source manifest
uri - the source content resource
toId - the destination manifest
toUri - the destination content resource
Throws:
ArchiveException - thrown in case of exception while coping content

lookup

public URI lookup(String webdavUri)
           throws ArchiveException
Lookup a WebDAV-URI on the format ///...

Specified by:
lookup in interface ContentI
Parameters:
webdavUri - Hierarcical URI
Returns:
"scam"-URI (IMSCP.Item URI)
Throws:
ArchiveException - thrown in case of exception while extracting SCAM uri.

copyStream

public static int copyStream(InputStream is,
                             OutputStream os)
                      throws IOException
Throws:
IOException

getMainFolder

protected static File getMainFolder(String id)


Copyright © 2003 SCAM. All Rights Reserved.