org.activemath.webapp.user
Class UserManagerService

java.lang.Object
  extended by org.activemath.webapp.user.UserManagerService

public class UserManagerService
extends Object

Remote interface for UserManager (and other stuff) Provides selected functionality to remote components.


Constructor Summary
UserManagerService(UserManager manager)
           
 
Method Summary
 int deleteNote(String userId, int noteId)
           
 String getBook(String userId, String bookId)
          Get a user book.
 Hashtable getNote(String userId, int noteId)
           
 Vector getNotes(String userId, String itemId)
           
 int getNumNotes(String userId, String itemId)
           
 String getTocSection(String userId, String bookId, String tocId)
          Return the defining a toc section.
 Hashtable getUserData(String userId)
           
 int saveNote(String userId, Hashtable props)
           
 int uploadUserBook(String userId, String bookTitle, String bookDescription, String omdocXml)
          Create a user book.
 int uploadUserBook(String userId, String bookTitle, String bookDescription, String omdocXml, String bookId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManagerService

public UserManagerService(UserManager manager)
Method Detail

getUserData

public Hashtable getUserData(String userId)
Parameters:
userId -
Returns:
the user data in form of a Map (@see UserData)

uploadUserBook

public int uploadUserBook(String userId,
                          String bookTitle,
                          String bookDescription,
                          String omdocXml)
                   throws Exception
Create a user book. Takes the provided XLM string and creates a user book from that. The book is attached to the user, so it is persistant and appears in the personal book list.

Parameters:
userId - - id of user to create book for
bookTitle - - title of the book
bookDescription - - short summary of the book
omdocXml - - the XLM defining the book.
Returns:
1 if everything was okay, 0 else.
Throws:
Exception - - any occuring exceptions are forwarded to the caller

uploadUserBook

public int uploadUserBook(String userId,
                          String bookTitle,
                          String bookDescription,
                          String omdocXml,
                          String bookId)
                   throws Exception
Throws:
Exception

getBook

public String getBook(String userId,
                      String bookId)
               throws Exception
Get a user book.

Parameters:
userId -
bookId -
Returns:
XML String with the book definition
Throws:
Exception

getTocSection

public String getTocSection(String userId,
                            String bookId,
                            String tocId)
                     throws Exception
Return the defining a toc section. Assumptions:
  • only sections *or* pages on the same level of the toc
  • grouping contains no empty sections (which are thrown out in toc)

Parameters:
userId -
bookId -
tocId - - toc id of section (eg. "5-2" for subsection 2 of section 5)
Returns:
XML String with the , or empty string
Throws:
Exception

getNumNotes

public int getNumNotes(String userId,
                       String itemId)

getNotes

public Vector getNotes(String userId,
                       String itemId)

getNote

public Hashtable getNote(String userId,
                         int noteId)

deleteNote

public int deleteNote(String userId,
                      int noteId)

saveNote

public int saveNote(String userId,
                    Hashtable props)
Returns:
id of node, or -1.