[isidorus-cvs] r354 - in trunk/src: ajax/javascripts rest_interface
Lukas Giessmann
lgiessmann at common-lisp.net
Fri Nov 26 16:55:18 UTC 2010
Author: lgiessmann
Date: Fri Nov 26 11:55:18 2010
New Revision: 354
Log:
REST-interface: splitted the webserver into a webserver for the UI => RDF/XTM/JSON-handlers and into an atom-webserver
Modified:
trunk/src/ajax/javascripts/datamodel.js
trunk/src/rest_interface/rest-interface.lisp
Modified: trunk/src/ajax/javascripts/datamodel.js
==============================================================================
--- trunk/src/ajax/javascripts/datamodel.js (original)
+++ trunk/src/ajax/javascripts/datamodel.js Fri Nov 26 11:55:18 2010
@@ -4414,7 +4414,6 @@
}
commitDeletedObject(delMessage, function(xhr){
- alert("Objected deleted");
if(type === "Topic"){
$(CLASSES.subPage()).update();
setNaviClasses($(PAGES.home));
@@ -4428,7 +4427,6 @@
else {
if(type === "Occurrence"){
objectToDelete.__value__.setValue("");
- objectToDelete.disable();
}
else {
objectToDelete.__value__.__frames__[0].__content__.setValue("");
@@ -4436,13 +4434,14 @@
objectToDelete.__variants__ = new VariantContainerC(null, objectToDelete);
vars.append(objectToDelete.__variants__.getFrame());
vars.remove();
- objectToDelete.disable();
}
+ objectToDelete.disable();
var ii = objectToDelete.__itemIdentity__;
objectToDelete.__itemIdentity__ = new ItemIdentityC(null, objectToDelete);
ii.append(objectToDelete.__itemIdentity__.getFrame());
ii.remove();
}
}
+ alert("Objected deleted");
});
}
\ No newline at end of file
Modified: trunk/src/rest_interface/rest-interface.lisp
==============================================================================
--- trunk/src/rest_interface/rest-interface.lisp (original)
+++ trunk/src/rest_interface/rest-interface.lisp Fri Nov 26 11:55:18 2010
@@ -25,8 +25,10 @@
:import-tm-feed
:read-url
:read-fragment-feed
- :start-tm-engine
- :shutdown-tm-engine
+ :start-json-engine
+ :start-atom-engine
+ :shutdown-json-engine
+ :shutdown-atom-engine
:*json-get-prefix*
:*get-rdf-prefix*
:*json-commit-url*
@@ -61,15 +63,47 @@
(apply page-function (coerce matched-registers 'list))))))))
-(defvar *server-acceptor* nil)
+(defvar *json-server-acceptor* nil)
+(defvar *atom-server-acceptor* nil)
-(defun start-tm-engine (repository-path &key (conffile "atom/conf.lisp")
- (host-name "localhost") (port 8000))
- "Start the Topic Map Engine on a given port, assuming a given
- hostname. Use the repository under repository-path"
- (when *server-acceptor*
- (error "Ther server is already running"))
+(defun start-json-engine (repository-path &key
+ (host-name "localhost") (port 8000))
+ "Start the Topic Maps Engine on a given port, assuming a given
+ hostname. Use the repository under repository-path.
+ This function starts only the json/xtm/rdf handlers for the UI,
+ The atom interface has to be started separately."
+ (when *json-server-acceptor*
+ (error "The json-server is already running"))
+ (setf hunchentoot:*show-lisp-errors-p* t) ;for now
+ (setf hunchentoot:*hunchentoot-default-external-format*
+ (flex:make-external-format :utf-8 :eol-style :lf))
+ (unless elephant:*store-controller*
+ (elephant:open-store
+ (xml-importer:get-store-spec repository-path)))
+ (set-up-json-interface)
+ (setf *json-server-acceptor*
+ (make-instance 'hunchentoot:acceptor :address host-name :port port))
+ (setf hunchentoot:*lisp-errors-log-level* :info)
+ (setf hunchentoot:*message-log-pathname* "./json-hunchentoot-errors.log")
+ (hunchentoot:start *json-server-acceptor*))
+
+
+(defun shutdown-json-engine ()
+ "Shut down the Topic Map Engine, only the json part."
+ (hunchentoot:stop *json-server-acceptor*)
+ (setf *json-server-acceptor* nil)
+ (elephant:close-store))
+
+
+(defun start-atom-engine (repository-path &key (conf-file "atom/conf.lisp")
+ (host-name "localhost") (port 8001))
+ "Start the Topic Maps Engine on a given port, assuming a given
+ hostname. Use the repository under repository-path.
+ This function starts only the atom interface.
+ The json/xtm/rdf interface has to be started separately."
+ (when *atom-server-acceptor*
+ (error "The atom-server is already running"))
(setf hunchentoot:*show-lisp-errors-p* t) ;for now
(setf hunchentoot:*hunchentoot-default-external-format*
(flex:make-external-format :utf-8 :eol-style :lf))
@@ -77,16 +111,17 @@
(unless elephant:*store-controller*
(elephant:open-store
(xml-importer:get-store-spec repository-path)))
- (load conffile)
+ (load conf-file)
(publish-feed atom:*tm-feed*)
- (set-up-json-interface)
- (setf *server-acceptor* (make-instance 'hunchentoot:acceptor :address host-name :port port))
+ (setf *atom-server-acceptor*
+ (make-instance 'hunchentoot:acceptor :address host-name :port port))
(setf hunchentoot:*lisp-errors-log-level* :info)
- (setf hunchentoot:*message-log-pathname* "./hunchentoot-errors.log")
- (hunchentoot:start *server-acceptor*))
+ (setf hunchentoot:*message-log-pathname* "./atom-hunchentoot-errors.log")
+ (hunchentoot:start *atom-server-acceptor*))
+
-(defun shutdown-tm-engine ()
- "Shut down the Topic Map Engine"
- (hunchentoot:stop *server-acceptor*)
- (setf *server-acceptor* nil)
+(defun shutdown-atom-engine ()
+ "Shut down the Topic Map Engine, only the atom part."
+ (hunchentoot:stop *atom-server-acceptor*)
+ (setf *atom-server-acceptor* nil)
(elephant:close-store))
\ No newline at end of file
More information about the Isidorus-cvs
mailing list