Index: lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml,v
diff -u -r1.5 -r1.6
--- lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml 21 Feb 2006 05:48:26 -0000 1.5
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml 9 Mar 2006 00:08:38 -0000 1.6
@@ -31,7 +31,6 @@
-
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java,v
diff -u -r1.18 -r1.19
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 24 Feb 2006 08:23:41 -0000 1.18
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 9 Mar 2006 00:08:38 -0000 1.19
@@ -98,7 +98,6 @@
protected LicenseDAO licenseDAO;
protected GroupingDAO groupingDAO;
protected GroupDAO groupDAO;
- protected ICSSThemeDAO themeDAO;
protected ILamsCoreToolService lamsCoreToolService;
protected ILearningDesignService learningDesignService;
protected MessageService messageService;
@@ -180,19 +179,6 @@
this.licenseDAO = licenseDAO;
}
- /**
- * @return Returns the themeDAO.
- */
- public ICSSThemeDAO getThemeDAO() {
- return themeDAO;
- }
- /**
- * @param themeDAO The ICSSThemeDAO to set.
- */
- public void setThemeDAO(ICSSThemeDAO themeDAO) {
- this.themeDAO = themeDAO;
- }
-
public ILamsCoreToolService getLamsCoreToolService() {
return lamsCoreToolService;
}
@@ -533,84 +519,6 @@
return flashMessage.serializeMessage();
}
-
- /**
- * Store a theme created on a client.
- * @param wddxPacket The WDDX packet received from Flash
- * @return String The acknowledgement in WDDX format that the theme has been
- * successfully saved.
- * @throws IOException
- * @throws WddxDeserializationException
- * @throws Exception
- */
- public String storeTheme(String wddxPacket) throws Exception {
-
- Hashtable table = (Hashtable)WDDXProcessor.deserialize(wddxPacket);
-
- CSSThemeDTO themeDTO = new CSSThemeDTO(table);
- if ( log.isDebugEnabled() ) {
- log.debug("Converted Theme packet. Packet was \n"+wddxPacket+
- "\nDTO is\n"+themeDTO);
- }
-
- CSSThemeVisualElement dbTheme = null;
- CSSThemeVisualElement storedTheme = null;
- if ( themeDTO.getId() != null ) {
- // Flash has supplied an id, get the record from the database for update
- dbTheme = themeDAO.getThemeById(themeDTO.getId());
- }
-
- if ( dbTheme == null ) {
- storedTheme = themeDTO.createCSSThemeVisualElement();
- } else {
- storedTheme = themeDTO.updateCSSTheme(dbTheme);
- }
-
- themeDAO.saveOrUpdateTheme(storedTheme);
- flashMessage = new FlashMessage(IAuthoringService.STORE_THEME_MESSAGE_KEY,storedTheme.getId());
- return flashMessage.serializeMessage();
- }
-
- /**
- * Returns a string representing the requested theme in WDDX format
- *
- * @param learningDesignID The learning_design_id of the design whose WDDX packet is requested
- * @return String The requested LearningDesign in WDDX format
- * @throws Exception
- */
- public String getTheme(Long themeId)throws IOException {
- CSSThemeVisualElement theme = themeDAO.getThemeById(themeId);
- if(theme==null)
- flashMessage = FlashMessage.getNoSuchTheme("wddxPacket",themeId);
- else{
- CSSThemeDTO dto = new CSSThemeDTO(theme);
- flashMessage = new FlashMessage("getTheme",dto);
- }
- return flashMessage.serializeMessage();
- }
-
-
- /**
- * This method returns a list of all available themes in
- * WDDX format. We need to work out if this should be restricted
- * by user.
- *
- * @return String The required information in WDDX format
- * @throws IOException
- */
- public String getThemes() throws IOException {
- List themes = themeDAO.getAllThemes();
- ArrayList themeList = new ArrayList();
- Iterator iterator = themes.iterator();
- while(iterator.hasNext()){
- CSSThemeBriefDTO dto = new CSSThemeBriefDTO((CSSThemeVisualElement)iterator.next());
- themeList.add(dto);
- }
- flashMessage = new FlashMessage("getThemes",themeList);
- return flashMessage.serializeMessage();
- }
-
-
/** @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getToolContentID(java.lang.Long) */
public String getToolContentID(Long toolID) throws IOException
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java,v
diff -u -r1.7 -r1.8
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 20 Feb 2006 05:35:34 -0000 1.7
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 9 Mar 2006 00:08:38 -0000 1.8
@@ -38,9 +38,6 @@
*/
public interface IAuthoringService {
- /** Message key returned by the storeTheme() method */
- public static final String STORE_THEME_MESSAGE_KEY = "storeTheme";
-
/** Message key returned by the storeLearningDesignDetails() method */
public static final String STORE_LD_MESSAGE_KEY = "storeLearningDesignDetails";
@@ -164,35 +161,6 @@
public String getAllLearningLibraryDetails()throws IOException;
/**
- * Store a theme created on a client.
- * @param wddxPacket The WDDX packet received from Flash
- * @return String The acknowledgement in WDDX format that the theme has been
- * successfully saved.
- * @throws Exception
- */
- public String storeTheme(String wddxPacket) throws Exception;
-
- /**
- * Returns a string representing the requested theme in WDDX format
- *
- * @param learningDesignID The learning_design_id of the design whose WDDX packet is requested
- * @return String The requested LearningDesign in WDDX format
- * @throws Exception
- */
- public String getTheme(Long themeId)throws IOException;
-
-
- /**
- * This method returns a list of all available themes in
- * WDDX format. We need to work out if this should be restricted
- * by user.
- *
- * @return String The required information in WDDX format
- * @throws IOException
- */
- public String getThemes() throws IOException;
-
- /**
* Returns a string representing the new tool content id in
* WDDX format.
*
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java,v
diff -u -r1.6 -r1.7
--- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 27 Jan 2006 06:54:48 -0000 1.6
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 9 Mar 2006 00:08:38 -0000 1.7
@@ -35,6 +35,7 @@
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
+import org.lamsfoundation.lams.web.action.LamsDispatchAction;
import org.lamsfoundation.lams.authoring.service.IAuthoringService;
import org.lamsfoundation.lams.learningdesign.exception.LearningDesignException;
import org.lamsfoundation.lams.usermanagement.exception.UserException;
@@ -54,7 +55,7 @@
* @struts.action-forward name = "success" path = "/index.jsp"
*
*/
-public class AuthoringAction extends DispatchAction{
+public class AuthoringAction extends LamsDispatchAction{
private static Logger log = Logger.getLogger(AuthoringAction.class);
@@ -63,9 +64,6 @@
* If you want it returned as a stream (ie for Flash), do not define this parameter
*/
public static String USE_JSP_OUTPUT = "jspoutput";
-
- /** Id of theme to be retrieved from the db */
- public static final String THEME_ID_PARAMETER = "themeID";
public IAuthoringService getAuthoringService(){
WebApplicationContext webContext = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServlet().getServletContext());
@@ -134,47 +132,6 @@
return outputPacket(mapping, request, response, wddxPacket, "details");
}
-
-
- /**
- * Returns a string representing the requested theme in WDDX format
- *
- * @param learningDesignID The learning_design_id of the design whose WDDX packet is requested
- * @return String The requested LearningDesign in WDDX format
- * @throws Exception
- */
- public ActionForward getTheme(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response)throws ServletException, Exception{
-
- Long themeId = new Long(WebUtil.readLongParam(request,THEME_ID_PARAMETER));
- IAuthoringService authoringService = getAuthoringService();
- String message = authoringService.getTheme(themeId);
- request.getSession().setAttribute("message",message);
- return outputPacket(mapping, request, response, message, "message");
- }
-
-
- /**
- * This method returns a list of all available themes in
- * WDDX format. We need to work out if this should be restricted
- * by user.
- *
- * @return String The required information in WDDX format
- * @throws IOException
- */
- public ActionForward getThemes(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response)throws ServletException, Exception{
-
- IAuthoringService authoringService = getAuthoringService();
- String message = authoringService.getThemes();
- request.getSession().setAttribute("message",message);
- return outputPacket(mapping, request, response, message, "message");
- }
-
public ActionForward getToolContentID(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,