added storage client to application

This commit is contained in:
maroy 2004-12-02 10:34:04 +00:00
parent c5f2579ec9
commit 79027ffff8
5 changed files with 77 additions and 13 deletions

View File

@ -21,7 +21,7 @@
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.6 $
# Version : $Revision: 1.7 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/Makefile.in,v $
#
# @configure_input@
@ -152,9 +152,10 @@ G_LIVESUPPORT_EXE_OBJS = ${TMP_DIR}/main.o
FSDF = ${G_LIVESUPPORT_OBJS} \
${TMP_DIR}/main.o
G_LIVESUPPORT_EXE_LIBS = -l${CORE_LIB} \
-l${AUTHENTICATION_LIB} \
G_LIVESUPPORT_EXE_LIBS = -l${AUTHENTICATION_LIB} \
-l${STORAGE_LIB} \
-l${SCHEDULER_CLIENT_LIB} \
-l${CORE_LIB} \
-lboost_date_time-gcc \
-lxmlrpc++ -lssl -lxml++-1.0

View File

@ -3,6 +3,7 @@
<!ELEMENT gLiveSupport (resourceBundle,
authenticationClientFactory,
storageClientFactory,
schedulerClientFactory) >
<!ELEMENT resourceBundle EMPTY >
@ -18,6 +19,37 @@
<!ATTLIST user login CDATA #REQUIRED >
<!ATTLIST user password CDATA #REQUIRED >
<!ELEMENT storageClientFactory (testStorage|webStorage) >
<!ELEMENT testStorage (playlist*, audioClip*) >
<!ATTLIST testStorage tempFiles CDATA #REQUIRED >
<!ELEMENT playlist (playlistElement*) >
<!ATTLIST playlist id NMTOKEN #REQUIRED >
<!ATTLIST playlist playlength NMTOKEN #REQUIRED >
<!ELEMENT playlistElement ((audioClip|playlist), fadeInfo?) >
<!ATTLIST playlistElement id NMTOKEN #REQUIRED >
<!ATTLIST playlistElement relativeOffset NMTOKEN #REQUIRED >
<!ELEMENT audioClip EMPTY >
<!ATTLIST audioClip id NMTOKEN #REQUIRED >
<!ATTLIST audioClip playlength NMTOKEN #REQUIRED >
<!ATTLIST audioClip uri CDATA #REQUIRED >
<!ELEMENT fadeInfo EMPTY >
<!ATTLIST fadeInfo id NMTOKEN #REQUIRED >
<!ATTLIST fadeInfo fadeIn NMTOKEN #REQUIRED >
<!ATTLIST fadeInfo fadeOut NMTOKEN #REQUIRED >
<!ELEMENT webStorage (location) >
<!ATTLIST webStorage tempFiles CDATA #REQUIRED >
<!ELEMENT location EMPTY >
<!ATTLIST location server CDATA #REQUIRED >
<!ATTLIST location port NMTOKEN #REQUIRED >
<!ATTLIST location path CDATA #REQUIRED >
<!ELEMENT schedulerClientFactory (schedulerDaemonXmlRpcClient) >
<!ELEMENT schedulerDaemonXmlRpcClient EMPTY >
@ -37,6 +69,15 @@
</testAuthentication>
</authenticationClientFactory>
<storageClientFactory>
<webStorage tempFiles="file:///tmp/tempPlaylist" >
<location server="localhost"
port="80"
path="/livesupportStorageServer/xmlrpc/xrLocStor.php"
/>
</webStorage>
</storageClientFactory>
<schedulerClientFactory>
<schedulerDaemonXmlRpcClient xmlRpcHost = "localhost"
xmlRpcPort = "3344"

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.3 $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $
------------------------------------------------------------------------------*/
@ -37,6 +37,7 @@
#include <gtkmm/main.h>
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/SchedulerClient/SchedulerClientFactory.h"
#include "UiTestMainWindow.h"
@ -46,6 +47,7 @@
using namespace LiveSupport::Core;
using namespace LiveSupport::Authentication;
using namespace LiveSupport::Storage;
using namespace LiveSupport::SchedulerClient;
using namespace LiveSupport::GLiveSupport;
@ -104,17 +106,27 @@ GLiveSupport :: configure(const xmlpp::Element & element)
authentication = acf->getAuthenticationClient();
// configure the StorageClientFactory
nodes = element.get_children(StorageClientFactory::getConfigElementName());
if (nodes.size() < 1) {
throw std::invalid_argument("no StorageClientFactory element");
}
Ptr<StorageClientFactory>::Ref stcf = StorageClientFactory::getInstance();
stcf->configure( *((const xmlpp::Element*) *(nodes.begin())) );
storage = stcf->getStorageClient();
// configure the SchedulerClientFactory
nodes = element.get_children(
SchedulerClientFactory::getConfigElementName());
if (nodes.size() < 1) {
throw std::invalid_argument("no schedulerClientFactory element");
}
Ptr<SchedulerClientFactory>::Ref scf
Ptr<SchedulerClientFactory>::Ref schcf
= SchedulerClientFactory::getInstance();
scf->configure( *((const xmlpp::Element*) *(nodes.begin())) );
schcf->configure( *((const xmlpp::Element*) *(nodes.begin())) );
schedulerClient = scf->getSchedulerClient();
scheduler = schcf->getSchedulerClient();
}

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.3 $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $
------------------------------------------------------------------------------*/
@ -47,6 +47,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/Configurable.h"
#include "LiveSupport/Core/AuthenticationClientInterface.h"
#include "LiveSupport/Core/StorageClientInterface.h"
#include "LiveSupport/SchedulerClient/SchedulerClientInterface.h"
namespace LiveSupport {
@ -73,18 +74,21 @@ using namespace LiveSupport::SchedulerClient;
* <pre><code>
* <!ELEMENT gLiveSupport (resourceBundle,
* authenticationClientFactory,
* storageClientFactory,
* schedulerClientFactory) >
* </code></pre>
*
* For a description of the <code>resourceBundle</code>,
* <code>authenticationClientFactory</code> and
* <code>authenticationClientFactory</code>,
* <code>storageClientFactory</code> and
* <code>schedulerClientFactory</code> elements see their
* respective documentation.
*
* @author $Author: maroy $
* @version $Revision: 1.3 $
* @version $Revision: 1.4 $
* @see LocalizedObject#getBundle(const xmlpp::Element &)
* @see AuthenticationClientFactory
* @see StorageClientFactory
* @see SchedulerClientFactory
*/
class GLiveSupport : public Configurable,
@ -106,10 +110,15 @@ class GLiveSupport : public Configurable,
*/
Ptr<AuthenticationClientInterface>::Ref authentication;
/**
* The storage client used by the application.
*/
Ptr<StorageClientInterface>::Ref storage;
/**
* The scheduler client, used to access the scheduler daemon.
*/
Ptr<SchedulerClientInterface>::Ref schedulerClient;
Ptr<SchedulerClientInterface>::Ref scheduler;
/**
* The session id for the user.

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.4 $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/main.cxx,v $
------------------------------------------------------------------------------*/
@ -151,7 +151,8 @@ int main ( int argc,
std::cerr << "using config file '" << configFileName << '\'' << std::endl;
Ptr<GLiveSupport>::Ref gLiveSupport(new GLiveSupport());
Ptr<LiveSupport::GLiveSupport::GLiveSupport>::Ref
gLiveSupport(new LiveSupport::GLiveSupport::GLiveSupport());
try {
std::auto_ptr<xmlpp::DomParser>