Index: lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml
===================================================================
diff -u -r951164b44891e7f99550648139df0e4a89e755fc -rda6cbb5f4783fb429592a0010961e8666c90ffb0
--- lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml (.../authoringApplicationContext.xml) (revision 951164b44891e7f99550648139df0e4a89e755fc)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml (.../authoringApplicationContext.xml) (revision da6cbb5f4783fb429592a0010961e8666c90ffb0)
@@ -31,7 +31,6 @@
-
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java
===================================================================
diff -u -rccd319d5814f7182b441e35cd615aa162fef83fb -rda6cbb5f4783fb429592a0010961e8666c90ffb0
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision ccd319d5814f7182b441e35cd615aa162fef83fb)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision da6cbb5f4783fb429592a0010961e8666c90ffb0)
@@ -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
===================================================================
diff -u -r86d71c1ef9ce4edd930b678d8c3942f837641a8b -rda6cbb5f4783fb429592a0010961e8666c90ffb0
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java (.../IAuthoringService.java) (revision 86d71c1ef9ce4edd930b678d8c3942f837641a8b)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java (.../IAuthoringService.java) (revision da6cbb5f4783fb429592a0010961e8666c90ffb0)
@@ -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
===================================================================
diff -u -rb31438f14603ef90bb73d6a0621a6b3e10f01ba7 -rda6cbb5f4783fb429592a0010961e8666c90ffb0
--- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision b31438f14603ef90bb73d6a0621a6b3e10f01ba7)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision da6cbb5f4783fb429592a0010961e8666c90ffb0)
@@ -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,