org.sakaiproject.tool.assessment.facade
Class ItemFacadeQueries

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
          extended byorg.sakaiproject.tool.assessment.facade.ItemFacadeQueries
All Implemented Interfaces:
InitializingBean, ItemFacadeQueriesAPI

public class ItemFacadeQueries
extends HibernateDaoSupport
implements ItemFacadeQueriesAPI


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
ItemFacadeQueries()
           
 
Method Summary
 Long add()
           
 void addItemMetaData(Long itemId, String label, String value)
           
 void deleteItem(Long itemId, String agent)
           
 void deleteItemContent(Long itemId, String agent)
           
 void deleteItemMetaData(Long itemId, String label)
           
 Long facadeAdd()
           
 ItemFacade getItem(Long itemId)
          private void exportXml(ItemDataIfc item) { XStream xstream = new XStream(); xstream = new XStream(new DomDriver()); xstream.alias("item", ItemData.class); xstream.alias("itemText", ItemText.class); xstream.alias("itemFeedback", ItemFeedback.class); xstream.alias("itemMetaData", ItemMetaData.class); xstream.alias("answer", Answer.class); xstream.alias("answerFeedback", AnswerFeedback.class); String xml = xstream.toXML(item); byte[] b = xml.getBytes(); try { FileOutputStream out = new FileOutputStream("out"); out.write(b); } catch (FileNotFoundException ex) { } catch (IOException ex1) { } }
 ItemFacade getItem(Long itemId, String agent)
           
 IdImpl getItemId(long id)
           
 IdImpl getItemId(Long id)
           
 IdImpl getItemId(String id)
           
 HashMap getItemsByKeyword(String keyword)
           
 List getQPItems(Long questionPoolId)
           
 void ifcShow(Long itemId)
           
 List list()
           
 void listType()
           
static void main(String[] args)
           
 void remove(Long itemId)
           
 ItemFacade saveItem(ItemFacade item)
           
 void show(Long itemId)
           
 void showType(Long typeId)
           
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemFacadeQueries

public ItemFacadeQueries()
Method Detail

getItemId

public IdImpl getItemId(String id)
Specified by:
getItemId in interface ItemFacadeQueriesAPI

getItemId

public IdImpl getItemId(Long id)
Specified by:
getItemId in interface ItemFacadeQueriesAPI

getItemId

public IdImpl getItemId(long id)
Specified by:
getItemId in interface ItemFacadeQueriesAPI

main

public static void main(String[] args)
                 throws DataFacadeException
Throws:
DataFacadeException

add

public Long add()
Specified by:
add in interface ItemFacadeQueriesAPI

getQPItems

public List getQPItems(Long questionPoolId)
Specified by:
getQPItems in interface ItemFacadeQueriesAPI

list

public List list()
Specified by:
list in interface ItemFacadeQueriesAPI

show

public void show(Long itemId)
Specified by:
show in interface ItemFacadeQueriesAPI

getItem

public ItemFacade getItem(Long itemId,
                          String agent)
Specified by:
getItem in interface ItemFacadeQueriesAPI

showType

public void showType(Long typeId)
Specified by:
showType in interface ItemFacadeQueriesAPI

listType

public void listType()
Specified by:
listType in interface ItemFacadeQueriesAPI

remove

public void remove(Long itemId)
Specified by:
remove in interface ItemFacadeQueriesAPI

deleteItem

public void deleteItem(Long itemId,
                       String agent)
Specified by:
deleteItem in interface ItemFacadeQueriesAPI

deleteItemContent

public void deleteItemContent(Long itemId,
                              String agent)
Specified by:
deleteItemContent in interface ItemFacadeQueriesAPI

deleteItemMetaData

public void deleteItemMetaData(Long itemId,
                               String label)
Specified by:
deleteItemMetaData in interface ItemFacadeQueriesAPI

addItemMetaData

public void addItemMetaData(Long itemId,
                            String label,
                            String value)
Specified by:
addItemMetaData in interface ItemFacadeQueriesAPI

facadeAdd

public Long facadeAdd()
               throws DataFacadeException
Specified by:
facadeAdd in interface ItemFacadeQueriesAPI
Throws:
DataFacadeException

ifcShow

public void ifcShow(Long itemId)
Specified by:
ifcShow in interface ItemFacadeQueriesAPI

saveItem

public ItemFacade saveItem(ItemFacade item)
                    throws DataFacadeException
Specified by:
saveItem in interface ItemFacadeQueriesAPI
Throws:
DataFacadeException

getItem

public ItemFacade getItem(Long itemId)
private void exportXml(ItemDataIfc item) { XStream xstream = new XStream(); xstream = new XStream(new DomDriver()); xstream.alias("item", ItemData.class); xstream.alias("itemText", ItemText.class); xstream.alias("itemFeedback", ItemFeedback.class); xstream.alias("itemMetaData", ItemMetaData.class); xstream.alias("answer", Answer.class); xstream.alias("answerFeedback", AnswerFeedback.class); String xml = xstream.toXML(item); byte[] b = xml.getBytes(); try { FileOutputStream out = new FileOutputStream("out"); out.write(b); } catch (FileNotFoundException ex) { } catch (IOException ex1) { } }

Specified by:
getItem in interface ItemFacadeQueriesAPI

getItemsByKeyword

public HashMap getItemsByKeyword(String keyword)
Specified by:
getItemsByKeyword in interface ItemFacadeQueriesAPI