01: package com.xoetrope.carousel.debug.selfhealing;
02:
03: import javax.swing.JOptionPane;
04: import net.xoetrope.debug.selfhealing.RepairOperation;
05: import net.xoetrope.xui.XProject;
06: import net.xoetrope.xui.helper.Constants;
07: import net.xoetrope.editor.project.XEditorProject;
08:
09: /**
10: * Add the server.properties files if they are missing when required by an
11: * application
12: * <p>Copyright (c) Xoetrope Ltd., 2002-2007</p>
13: * <p>License: see license.txt</p>
14: */
15: public class ServerPropertiesMissing implements RepairOperation {
16: /**
17: * Attempt to fix an error when running a XUI application
18: * @param project the current project
19: * @param sourceObj the instance of the class from which the error handler was
20: * invoked, or the object being repaired
21: * @param t throwable the exception that was trapped, or null
22: */
23: public boolean fixError(XProject project, Object sourceObj,
24: Throwable t) {
25: // int rc = JOptionPane.showConfirmDialog( null, "The server side routes and service configuration is missing from the startup file, do you want to add it now?",
26: // "Correct the startup properties",
27: // JOptionPane.YES_NO_OPTION );
28: // if ( rc == JOptionPane.YES_OPTION ) {
29: XEditorProject editorProject = (XEditorProject) project;
30: editorProject.addCustomManagerObject(Constants.SERVER_DATASETS,
31: "serverdatasets.xml");
32: editorProject.addCustomManagerObject(Constants.SERVER_ROUTES,
33: "serverroutes.xml");
34: editorProject.addCustomManagerObject(Constants.SERVER_SERVICES,
35: "serverservices.xml");
36: editorProject.addCustomManagerObject("CustomRouteDefs",
37: "customroutedefs.xml");
38: editorProject.addCustomManagerObject("ServerStartup",
39: "xuiproserver.properties");
40: return true;
41: // }
42: //
43: // return false;
44: }
45: }
|