org.opensubsystems.blog.logic.impl
Class BlogControllerImpl

java.lang.Object
  extended by org.opensubsystems.core.logic.impl.StatelessControllerImpl
      extended by org.opensubsystems.core.logic.impl.DataControllerImpl
          extended by org.opensubsystems.core.logic.impl.BasicDataControllerImpl
              extended by org.opensubsystems.core.logic.impl.ModifiableDataControllerImpl
                  extended by org.opensubsystems.blog.logic.impl.BlogControllerImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean, BlogController, org.opensubsystems.core.logic.BasicDataController, org.opensubsystems.core.logic.DataController, org.opensubsystems.core.logic.ModifiableDataController, org.opensubsystems.core.logic.StatelessController

public class BlogControllerImpl
extends org.opensubsystems.core.logic.impl.ModifiableDataControllerImpl
implements BlogController

The main entry point to all business functionality connected with blogs. View-type has to be set to local due to bug XDT-867 affecting WebSphere Refs has to be set to local JNDI name since we do not want to use remote objects.

Version:
$Id: BlogControllerImpl.java,v 1.6 2007/02/01 07:34:37 bastafidli Exp $
Author:
Miro Halas
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
Initial revision
XDoclet tag:
type="Stateless" name="BlogController" view-type="local" jndi-name="org.opensubsystems.blog.logic.BlogControllerRemote" local-jndi-name="org.opensubsystems.blog.logic.BlogController"
XDoclet tag:
local-extends="javax.ejb.EJBLocalObject, org.opensubsystems.blog.logic.BlogController" extends="javax.ejb.EJBObject, org.opensubsystems.blog.logic.BlogController"
XDoclet tag:
ejb-name="BlogController" jndi-name="org.opensubsystems.blog.logic.BlogControllerRemote"

Field Summary
protected  BlogFactory m_blogFactory
          Factory to use to execute persistence operations.
protected  EntryFactory m_entryFactory
          Factory to use to execute persistence operations.
 
Constructor Summary
BlogControllerImpl()
          Default constructor.
 
Method Summary
 void constructor()
          
 org.opensubsystems.core.data.DataObject create(org.opensubsystems.core.data.DataObject data)
          
 void delete(int iId)
          
 void deleteEntry(int iBlogEntryId)
          Delete entry.
 org.opensubsystems.core.data.DataObject get(int iId)
          
 Blog get(java.lang.String strFolder)
          Get blog knowing just the folder where it's entries are displayed.
 java.util.List getAll()
          Get all blogs.
protected  org.opensubsystems.core.persist.DataFactory getDataFactory()
          
protected  org.opensubsystems.core.persist.BasicDataFactory getDataFactory(org.opensubsystems.core.data.DataObject data)
          
 java.util.List getEntries(int iBlogId)
          Get all entries for a given blog.
 java.lang.Object[] getWithEntries(java.lang.String strFolder)
          Get blog and its entries knowing just the folder where it's entries are displayed.
 java.lang.Object[] getWithEntry(int iBlogId, int iEntryId)
          Get blog and entry knowing just the id of the blog and the id of the entry.
 java.lang.Object[] getWithEntry(java.lang.String strFolder, int iEntryId)
          Get blog and entry knowing just the folder where the entry are displayed and the id of the entry.
 org.opensubsystems.core.data.ModifiableDataObject save(org.opensubsystems.core.data.ModifiableDataObject data)
          
 
Methods inherited from class org.opensubsystems.core.logic.impl.StatelessControllerImpl
ejbActivate, ejbPassivate, ejbRemove, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_blogFactory

protected BlogFactory m_blogFactory
Factory to use to execute persistence operations.


m_entryFactory

protected EntryFactory m_entryFactory
Factory to use to execute persistence operations.

Constructor Detail

BlogControllerImpl

public BlogControllerImpl()
Default constructor.

Method Detail

get

public Blog get(java.lang.String strFolder)
         throws org.opensubsystems.core.error.OSSException
Get blog knowing just the folder where it's entries are displayed.

Specified by:
get in interface BlogController
Parameters:
strFolder - - folder where entries for given folder are displayed
Returns:
Blog - specified blog or null if not found
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getEntries

public java.util.List getEntries(int iBlogId)
                          throws org.opensubsystems.core.error.OSSException
Get all entries for a given blog.

Specified by:
getEntries in interface BlogController
Parameters:
iBlogId - - id of a blog to get entries for
Returns:
List - list of Entry objects or null if blog doesn't contain any entries
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getWithEntries

public java.lang.Object[] getWithEntries(java.lang.String strFolder)
                                  throws org.opensubsystems.core.error.OSSException
Get blog and its entries knowing just the folder where it's entries are displayed.

Specified by:
getWithEntries in interface BlogController
Parameters:
strFolder - - folder where entries for given folder are displayed
Returns:
Object[] - index 0 is blog and index 1 is list of its entries
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getWithEntry

public java.lang.Object[] getWithEntry(java.lang.String strFolder,
                                       int iEntryId)
                                throws org.opensubsystems.core.error.OSSException
Get blog and entry knowing just the folder where the entry are displayed and the id of the entry.

Specified by:
getWithEntry in interface BlogController
Parameters:
strFolder - - folder where entries for given folder are displayed
iEntryId - - id of the blog entry to load
Returns:
Object[] - index 0 is blog and index 1 is the entry
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getWithEntry

public java.lang.Object[] getWithEntry(int iBlogId,
                                       int iEntryId)
                                throws org.opensubsystems.core.error.OSSException
Get blog and entry knowing just the id of the blog and the id of the entry.

Specified by:
getWithEntry in interface BlogController
Parameters:
iBlogId - - id of the blog to load
iEntryId - - id of the blog entry to load
Returns:
Object[] - index 0 is blog and index 1 is the entry
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getAll

public java.util.List getAll()
                      throws org.opensubsystems.core.error.OSSException
Get all blogs.

Specified by:
getAll in interface BlogController
Returns:
List - list of blogs objects sorted alphabetically
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

deleteEntry

public void deleteEntry(int iBlogEntryId)
                 throws org.opensubsystems.core.error.OSSException
Delete entry. We have to define separate method for this operation since the default data type for this controller is blog and therefore the default implementation will just delete blogs.

Specified by:
deleteEntry in interface BlogController
Parameters:
iBlogEntryId - - id of the entry to delete
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Required"

constructor

public void constructor()
                 throws org.opensubsystems.core.error.OSSException

Specified by:
constructor in interface org.opensubsystems.core.logic.StatelessController
Overrides:
constructor in class org.opensubsystems.core.logic.impl.StatelessControllerImpl
Throws:
org.opensubsystems.core.error.OSSException
XDoclet tag:
XDoclet tag:
type="Supports"

getDataFactory

protected org.opensubsystems.core.persist.DataFactory getDataFactory()

Specified by:
getDataFactory in class org.opensubsystems.core.logic.impl.DataControllerImpl

getDataFactory

protected org.opensubsystems.core.persist.BasicDataFactory getDataFactory(org.opensubsystems.core.data.DataObject data)

Specified by:
getDataFactory in class org.opensubsystems.core.logic.impl.BasicDataControllerImpl

save

public org.opensubsystems.core.data.ModifiableDataObject save(org.opensubsystems.core.data.ModifiableDataObject data)
                                                       throws org.opensubsystems.core.error.OSSException

Specified by:
save in interface org.opensubsystems.core.logic.ModifiableDataController
Overrides:
save in class org.opensubsystems.core.logic.impl.ModifiableDataControllerImpl
Throws:
org.opensubsystems.core.error.OSSException
XDoclet tag:
XDoclet tag:
type="Required"

create

public org.opensubsystems.core.data.DataObject create(org.opensubsystems.core.data.DataObject data)
                                               throws org.opensubsystems.core.error.OSSException

Specified by:
create in interface org.opensubsystems.core.logic.BasicDataController
Overrides:
create in class org.opensubsystems.core.logic.impl.BasicDataControllerImpl
Throws:
org.opensubsystems.core.error.OSSException
XDoclet tag:
XDoclet tag:
type="Required"

delete

public void delete(int iId)
            throws org.opensubsystems.core.error.OSSException

Specified by:
delete in interface org.opensubsystems.core.logic.BasicDataController
Overrides:
delete in class org.opensubsystems.core.logic.impl.BasicDataControllerImpl
Throws:
org.opensubsystems.core.error.OSSException
XDoclet tag:
XDoclet tag:
type="Required"

get

public org.opensubsystems.core.data.DataObject get(int iId)
                                            throws org.opensubsystems.core.error.OSSException

Specified by:
get in interface org.opensubsystems.core.logic.DataController
Overrides:
get in class org.opensubsystems.core.logic.impl.DataControllerImpl
Throws:
org.opensubsystems.core.error.OSSException
XDoclet tag:
XDoclet tag:
type="Supports"


Copyright © 2003 - 2007 OpenSubsystems s.r.o.