From c8159a73232e4d7c70978f6e84b2d8ff1c099096 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Thu, 16 Jun 2005 18:37:23 +0000 Subject: [PATCH] Removed references to the delete methods (audio clip and playlist), fixing bug #1169. --- .../Storage/StorageClientInterface.h | 36 +--- .../modules/storage/src/TestStorageClient.cxx | 46 +---- .../modules/storage/src/TestStorageClient.h | 35 +--- .../storage/src/TestStorageClientTest.cxx | 42 +---- .../storage/src/TestStorageClientTest.h | 17 +- .../modules/storage/src/WebStorageClient.cxx | 172 +----------------- .../modules/storage/src/WebStorageClient.h | 35 +--- .../storage/src/WebStorageClientTest.cxx | 33 +--- .../gLiveSupport/src/GLiveSupport.cxx | 25 +-- .../products/gLiveSupport/src/GLiveSupport.h | 14 +- .../gLiveSupport/src/ScratchpadWindow.cxx | 39 +--- .../gLiveSupport/src/ScratchpadWindow.h | 24 +-- livesupport/products/gLiveSupport/var/es.txt | 1 - livesupport/products/gLiveSupport/var/hu.txt | 3 +- livesupport/products/gLiveSupport/var/nl.txt | 1 - .../products/gLiveSupport/var/root.txt | 1 - .../products/gLiveSupport/var/sr_CS.txt | 1 - .../gLiveSupport/var/sr_CS_CYRILLIC.txt | 1 - .../products/scheduler/etc/Makefile.in | 5 +- .../scheduler/src/DeletePlaylistMethod.cxx | 148 --------------- .../scheduler/src/DeletePlaylistMethod.h | 152 ---------------- .../src/DeletePlaylistMethodTest.cxx | 160 ---------------- .../scheduler/src/DeletePlaylistMethodTest.h | 127 ------------- .../scheduler/src/RpcDeletePlaylistTest.cxx | 143 --------------- .../scheduler/src/RpcDeletePlaylistTest.h | 120 ------------ .../scheduler/src/SchedulerDaemon.cxx | 4 +- .../products/scheduler/src/SchedulerDaemon.h | 14 +- 27 files changed, 31 insertions(+), 1368 deletions(-) delete mode 100644 livesupport/products/scheduler/src/DeletePlaylistMethod.cxx delete mode 100644 livesupport/products/scheduler/src/DeletePlaylistMethod.h delete mode 100644 livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx delete mode 100644 livesupport/products/scheduler/src/DeletePlaylistMethodTest.h delete mode 100644 livesupport/products/scheduler/src/RpcDeletePlaylistTest.cxx delete mode 100644 livesupport/products/scheduler/src/RpcDeletePlaylistTest.h diff --git a/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h b/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h index 9f715b465..ecd51a99d 100644 --- a/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h +++ b/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.15 $ + Version : $Revision: 1.16 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h,v $ ------------------------------------------------------------------------------*/ @@ -66,7 +66,7 @@ using namespace Core; * An interface for storage clients. * * @author $Author: fgerlits $ - * @version $Revision: 1.15 $ + * @version $Revision: 1.16 $ */ class StorageClientInterface { @@ -220,23 +220,6 @@ class StorageClientInterface releasePlaylist(Ptr::Ref playlist) const throw (XmlRpcException) = 0; - /** - * Delete a playlist with the specified id. - * Will refuse to delete the playlist if it is being edited (i.e., - * has been opened with editPlaylist() but has not yet been released - * with savePlaylist()). - * - * @param sessionId the session ID from the authentication client - * @param id the id of the playlist to be deleted. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call or no playlist with the specified - * id exists. - */ - virtual void - deletePlaylist(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException) - = 0; /** * Tell if an audio clip with a given id exists. @@ -340,21 +323,6 @@ class StorageClientInterface throw (XmlRpcException) = 0; - /** - * Delete an audio clip with the specified id. - * - * @param sessionId the session ID from the authentication client - * @param id the id of the audio clip to be deleted. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call or no audio clip with the - * specified id exists. - */ - virtual void - deleteAudioClip(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException) - = 0; - /** * Search for audio clips or playlists. The results can be read * using getAudioClipIds() and getPlaylistIds(). diff --git a/livesupport/modules/storage/src/TestStorageClient.cxx b/livesupport/modules/storage/src/TestStorageClient.cxx index 46caf7a3a..3646278a0 100644 --- a/livesupport/modules/storage/src/TestStorageClient.cxx +++ b/livesupport/modules/storage/src/TestStorageClient.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.38 $ + Version : $Revision: 1.39 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $ ------------------------------------------------------------------------------*/ @@ -382,7 +382,7 @@ TestStorageClient :: savePlaylist(Ptr::Ref sessionId, storeIt = playlistMap.find(playlist->getId()->getId()); if (storeIt == playlistMap.end()) { - throw XmlRpcException("playlist deleted while it was being edited???"); + throw XmlRpcException("playlist vanished while it was being edited???"); } storeIt->second = playlist; @@ -540,29 +540,6 @@ TestStorageClient :: releasePlaylist(Ptr::Ref playlist) const } -/*------------------------------------------------------------------------------ - * Delete a playlist. - *----------------------------------------------------------------------------*/ -void -TestStorageClient :: deletePlaylist(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException) -{ - if (!sessionId) { - throw XmlRpcException("missing session ID argument"); - } - - if (editedPlaylists.find(id->getId()) != editedPlaylists.end()) { - throw XmlRpcException("playlist is being edited"); - } - - // erase() returns the number of entries found & erased - if (!playlistMap.erase(id->getId())) { - throw XmlRpcException("no such playlist"); - } -} - - /*------------------------------------------------------------------------------ * Tell if an audio clip exists. *----------------------------------------------------------------------------*/ @@ -687,25 +664,6 @@ TestStorageClient :: releaseAudioClip(Ptr::Ref audioClip) const } -/*------------------------------------------------------------------------------ - * Delete an audio clip. - *----------------------------------------------------------------------------*/ -void -TestStorageClient :: deleteAudioClip(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException) -{ - if (!sessionId) { - throw XmlRpcException("missing session ID argument"); - } - - // erase() returns the number of entries found & erased - if (!audioClipMap.erase(id->getId())) { - throw XmlRpcException("no such audio clip"); - } -} - - /*------------------------------------------------------------------------------ * Search for audio clips or playlists. *----------------------------------------------------------------------------*/ diff --git a/livesupport/modules/storage/src/TestStorageClient.h b/livesupport/modules/storage/src/TestStorageClient.h index ddde42ce5..2d7c82348 100644 --- a/livesupport/modules/storage/src/TestStorageClient.h +++ b/livesupport/modules/storage/src/TestStorageClient.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.34 $ + Version : $Revision: 1.35 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $ ------------------------------------------------------------------------------*/ @@ -86,7 +86,7 @@ using namespace LiveSupport::Core; * * * @author $Author: fgerlits $ - * @version $Revision: 1.34 $ + * @version $Revision: 1.35 $ */ class TestStorageClient : virtual public Configurable, @@ -361,23 +361,6 @@ class TestStorageClient : releasePlaylist(Ptr::Ref playlist) const throw (XmlRpcException); - /** - * Delete a playlist with the specified id. - * Will refuse to delete the playlist if it is being edited (i.e., - * has been opened with editPlaylist() but has not yet been released - * with savePlaylist()). - * - * @param sessionId the session ID from the authentication client - * @param id the id of the playlist to be deleted. - * @exception XmlRpcException if no playlist with the specified - * id exists. - */ - virtual void - deletePlaylist(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException); - - /** * Tell if an audio clip with a given id exists. * @@ -471,20 +454,6 @@ class TestStorageClient : throw (XmlRpcException); - /** - * Delete an audio clip with the specified id. - * - * @param sessionId the session ID from the authentication client - * @param id the id of the audio clip to be deleted. - * @exception XmlRpcException if no audio clip with the - * specified id exists. - */ - virtual void - deleteAudioClip(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException); - - /** * Reset the storage to its initial state. * Re-initializes the storage based on the xml element which was diff --git a/livesupport/modules/storage/src/TestStorageClientTest.cxx b/livesupport/modules/storage/src/TestStorageClientTest.cxx index 7ec8cca09..31f484dfa 100644 --- a/livesupport/modules/storage/src/TestStorageClientTest.cxx +++ b/livesupport/modules/storage/src/TestStorageClientTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.27 $ + Version : $Revision: 1.28 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -157,36 +157,6 @@ TestStorageClientTest :: getVersionTest(void) } -/*------------------------------------------------------------------------------ - * Testing the deletePlaylist method - *----------------------------------------------------------------------------*/ -void -TestStorageClientTest :: deletePlaylistTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref id1(new UniqueId(0x1)); - Ptr::Ref id2(new UniqueId(0x77)); - - try { - tsc->deletePlaylist(dummySessionId, id2); - CPPUNIT_FAIL("allowed to delete non-existent playlist"); - } catch (XmlRpcException &e) { - } - - try { - tsc->deletePlaylist(dummySessionId, id1); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL("cannot delete existing playlist"); - } - - try { - tsc->deletePlaylist(dummySessionId, id1); - CPPUNIT_FAIL("allowed to delete non-existent playlist"); - } catch (XmlRpcException &e) { - } -} - - /*------------------------------------------------------------------------------ * Testing the reset method *----------------------------------------------------------------------------*/ @@ -278,16 +248,6 @@ TestStorageClientTest :: audioClipTest(void) CPPUNIT_ASSERT(audioClipIds); CPPUNIT_ASSERT(audioClipIds->size() >= 3); - Ptr::Ref audioClipId = audioClipIds->at(0); - CPPUNIT_ASSERT((int) (audioClipId->getId()) == 0x10001); - - try { - tsc->deleteAudioClip(dummySessionId, id02); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(!tsc->existsAudioClip(dummySessionId, id02)); - Ptr::Ref title(new Glib::ustring("New Title")); Ptr::Ref playlength(new time_duration(0,0,13,0)); Ptr::Ref uri; diff --git a/livesupport/modules/storage/src/TestStorageClientTest.h b/livesupport/modules/storage/src/TestStorageClientTest.h index 7e06792d8..1409e2bcb 100644 --- a/livesupport/modules/storage/src/TestStorageClientTest.h +++ b/livesupport/modules/storage/src/TestStorageClientTest.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.11 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.12 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.h,v $ ------------------------------------------------------------------------------*/ @@ -57,8 +57,8 @@ namespace Storage { /** * Unit test for the UploadPlaylistMetohd class. * - * @author $Author: maroy $ - * @version $Revision: 1.11 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.12 $ * @see TestStorageClient */ class TestStorageClientTest : public CPPUNIT_NS::TestFixture @@ -67,7 +67,6 @@ class TestStorageClientTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(firstTest); CPPUNIT_TEST(getVersionTest); CPPUNIT_TEST(resetTest); - CPPUNIT_TEST(deletePlaylistTest); CPPUNIT_TEST(createPlaylistTest); CPPUNIT_TEST(audioClipTest); CPPUNIT_TEST(acquireAudioClipTest); @@ -105,14 +104,6 @@ class TestStorageClientTest : public CPPUNIT_NS::TestFixture void getVersionTest(void) throw (CPPUNIT_NS::Exception); - /** - * Testing deletePlaylist(). - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - deletePlaylistTest(void) - throw (CPPUNIT_NS::Exception); /** * Testing getAllPlaylists(). * diff --git a/livesupport/modules/storage/src/WebStorageClient.cxx b/livesupport/modules/storage/src/WebStorageClient.cxx index f5759c993..766173b19 100644 --- a/livesupport/modules/storage/src/WebStorageClient.cxx +++ b/livesupport/modules/storage/src/WebStorageClient.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.41 $ + Version : $Revision: 1.42 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $ ------------------------------------------------------------------------------*/ @@ -422,30 +422,6 @@ static const std::string savePlaylistNewPlaylistParamName = "newPlaylist"; static const std::string savePlaylistResultParamName = "plid"; -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: deletePlaylist */ - -/*------------------------------------------------------------------------------ - * The name of the delete playlist method on the storage server - *----------------------------------------------------------------------------*/ -static const std::string deletePlaylistMethodName - = "locstor.deletePlaylist"; - -/*------------------------------------------------------------------------------ - * The name of the session ID parameter in the input structure - *----------------------------------------------------------------------------*/ -static const std::string deletePlaylistSessionIdParamName = "sessid"; - -/*------------------------------------------------------------------------------ - * The name of the playlist unique ID parameter in the input structure - *----------------------------------------------------------------------------*/ -static const std::string deletePlaylistPlaylistIdParamName = "plid"; - -/*------------------------------------------------------------------------------ - * The name of the result parameter returned by the method - *----------------------------------------------------------------------------*/ -static const std::string deletePlaylistResultParamName = "status"; - - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ audio clip methods */ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: existsAudioClip */ @@ -605,30 +581,6 @@ static const std::string releaseAudioClipTokenParamName = "token"; static const std::string releaseAudioClipResultParamName = "status"; -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: deleteAudioClip */ - -/*------------------------------------------------------------------------------ - * The name of the delete audio clip method on the storage server - *----------------------------------------------------------------------------*/ -static const std::string deleteAudioClipMethodName - = "locstor.deleteAudioClip"; - -/*------------------------------------------------------------------------------ - * The name of the session ID parameter in the input structure - *----------------------------------------------------------------------------*/ -static const std::string deleteAudioClipSessionIdParamName = "sessid"; - -/*------------------------------------------------------------------------------ - * The name of the audio clip unique ID parameter in the input structure - *----------------------------------------------------------------------------*/ -static const std::string deleteAudioClipAudioClipIdParamName = "gunid"; - -/*------------------------------------------------------------------------------ - * The name of the result parameter returned by the method - *----------------------------------------------------------------------------*/ -static const std::string deleteAudioClipResultParamName = "status"; - - /* =============================================== local function prototypes */ @@ -1334,67 +1286,6 @@ WebStorageClient :: releasePlaylist(Ptr::Ref playlist) const } -/*------------------------------------------------------------------------------ - * Delete a playlist. - *----------------------------------------------------------------------------*/ -void -WebStorageClient :: deletePlaylist(Ptr::Ref sessionId, - Ptr::Ref id) - throw (Core::XmlRpcException) -{ - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters[deletePlaylistSessionIdParamName] - = sessionId->getId(); - parameters[deletePlaylistPlaylistIdParamName] - = std::string(*id); - - result.clear(); - if (!xmlRpcClient.execute(deletePlaylistMethodName.c_str(), - parameters, result)) { - xmlRpcClient.close(); - std::string eMsg = "cannot execute XML-RPC method '"; - eMsg += deletePlaylistMethodName; - eMsg += "'"; - throw XmlRpcCommunicationException(eMsg); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << deletePlaylistMethodName - << "' returned error message:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (! result.hasMember(deletePlaylistResultParamName) - || result[deletePlaylistResultParamName].getType() - != XmlRpcValue::TypeBoolean) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << deletePlaylistMethodName - << "' returned unexpected value:\n" - << result; - throw XmlRpcMethodResponseException(eMsg.str()); - } - - if (! bool(result[deletePlaylistResultParamName])) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << deletePlaylistMethodName - << "' returned 'false'"; - throw XmlRpcMethodResponseException(eMsg.str()); - } -} - - /*------------------------------------------------------------------------------ * Tell if an audio clip exists. *----------------------------------------------------------------------------*/ @@ -1861,67 +1752,6 @@ WebStorageClient :: releaseAudioClip(Ptr::Ref audioClip) const } -/*------------------------------------------------------------------------------ - * Delete an audio clip. - *----------------------------------------------------------------------------*/ -void -WebStorageClient :: deleteAudioClip(Ptr::Ref sessionId, - Ptr::Ref id) - throw (Core::XmlRpcException) -{ - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters[deleteAudioClipSessionIdParamName] - = sessionId->getId(); - parameters[deleteAudioClipAudioClipIdParamName] - = std::string(*id); - - result.clear(); - if (!xmlRpcClient.execute(deleteAudioClipMethodName.c_str(), - parameters, result)) { - xmlRpcClient.close(); - std::string eMsg = "cannot execute XML-RPC method '"; - eMsg += deleteAudioClipMethodName; - eMsg += "'"; - throw XmlRpcCommunicationException(eMsg); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << deleteAudioClipMethodName - << "' returned error message:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (! result.hasMember(deleteAudioClipResultParamName) - || result[deleteAudioClipResultParamName].getType() - != XmlRpcValue::TypeBoolean) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << deleteAudioClipMethodName - << "' returned unexpected value:\n" - << result; - throw XmlRpcMethodResponseException(eMsg.str()); - } - - if (! bool(result[deleteAudioClipResultParamName])) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << deleteAudioClipMethodName - << "' returned 'false'"; - throw XmlRpcMethodResponseException(eMsg.str()); - } -} - - /*------------------------------------------------------------------------------ * Reset the storage to its initial state. *----------------------------------------------------------------------------*/ diff --git a/livesupport/modules/storage/src/WebStorageClient.h b/livesupport/modules/storage/src/WebStorageClient.h index 57471f66a..8f7f29460 100644 --- a/livesupport/modules/storage/src/WebStorageClient.h +++ b/livesupport/modules/storage/src/WebStorageClient.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.28 $ + Version : $Revision: 1.29 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $ ------------------------------------------------------------------------------*/ @@ -96,7 +96,7 @@ using namespace LiveSupport::Core; * * * @author $Author: fgerlits $ - * @version $Revision: 1.28 $ + * @version $Revision: 1.29 $ */ class WebStorageClient : virtual public Configurable, @@ -355,23 +355,6 @@ class WebStorageClient : releasePlaylist(Ptr::Ref playlist) const throw (XmlRpcException); - /** - * Delete a playlist with the specified id. - * Will refuse to delete the playlist if it is being edited (i.e., - * has been opened with editPlaylist() but has not yet been released - * with savePlaylist()). - * - * @param sessionId the session ID from the authentication client - * @param id the id of the playlist to be deleted. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call or no playlist with the specified - * id exists. - */ - virtual void - deletePlaylist(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException); - /** * Tell if an audio clip with a given id exists. * @@ -473,20 +456,6 @@ class WebStorageClient : releaseAudioClip(Ptr::Ref audioClip) const throw (XmlRpcException); - /** - * Delete an audio clip with the specified id. - * - * @param sessionId the session ID from the authentication client - * @param id the id of the audio clip to be deleted. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call or no audio clip with the - * specified id exists. - */ - virtual void - deleteAudioClip(Ptr::Ref sessionId, - Ptr::Ref id) - throw (XmlRpcException); - /** * Reset the storage to its initial state. * Calls locstor.resetStorage; the audio clip and playlist IDs diff --git a/livesupport/modules/storage/src/WebStorageClientTest.cxx b/livesupport/modules/storage/src/WebStorageClientTest.cxx index 41d44bf86..60affbf8f 100644 --- a/livesupport/modules/storage/src/WebStorageClientTest.cxx +++ b/livesupport/modules/storage/src/WebStorageClientTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.43 $ + Version : $Revision: 1.44 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -355,22 +355,6 @@ WebStorageClientTest :: playlistTest(void) CPPUNIT_FAIL(e.what()); } CPPUNIT_ASSERT(!newPlaylist->getUri()); - -/* - // test deletePlaylist() - try { - wsc->deletePlaylist(sessionId, playlistIdxx); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - exists = wsc->existsPlaylist(sessionId, playlistIdxx); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(!exists); -*/ } @@ -404,7 +388,7 @@ WebStorageClientTest :: audioClipTest(void) CPPUNIT_ASSERT(sessionId); - // test existsAudioClip(), deleteAudioClip() and getAudioClip() + // test existsAudioClip() and getAudioClip() bool exists = false;; try { exists = wsc->existsAudioClip(sessionId, id01); @@ -419,20 +403,7 @@ WebStorageClientTest :: audioClipTest(void) } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } -/* - try { - wsc->deleteAudioClip(sessionId, id01); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - try { - exists = wsc->existsAudioClip(sessionId, id01); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(!exists); -*/ Ptr::Ref id77(new UniqueId(10077)); try { exists = wsc->existsAudioClip(sessionId, id77); diff --git a/livesupport/products/gLiveSupport/src/GLiveSupport.cxx b/livesupport/products/gLiveSupport/src/GLiveSupport.cxx index 73d6256e2..e3c04485b 100644 --- a/livesupport/products/gLiveSupport/src/GLiveSupport.cxx +++ b/livesupport/products/gLiveSupport/src/GLiveSupport.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.50 $ + Version : $Revision: 1.51 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $ ------------------------------------------------------------------------------*/ @@ -739,29 +739,6 @@ GLiveSupport :: removeFromSchedule(Ptr::Ref scheduleEntryId) } -/*------------------------------------------------------------------------------ - * Delete a playable object from the storage. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: deletePlayable(Ptr::Ref playable) - throw (XmlRpcException) -{ - switch (playable->getType()) { - case Playable::AudioClipType: - storage->deleteAudioClip(sessionId, playable->getId()); - break; - - case Playable::PlaylistType: - storage->deletePlaylist(sessionId, playable->getId()); - break; - - default: - break; - } -} - - /*------------------------------------------------------------------------------ * Play a Playable object using the output audio player. *----------------------------------------------------------------------------*/ diff --git a/livesupport/products/gLiveSupport/src/GLiveSupport.h b/livesupport/products/gLiveSupport/src/GLiveSupport.h index aa13435f5..122fe1490 100644 --- a/livesupport/products/gLiveSupport/src/GLiveSupport.h +++ b/livesupport/products/gLiveSupport/src/GLiveSupport.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.39 $ + Version : $Revision: 1.40 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $ ------------------------------------------------------------------------------*/ @@ -102,7 +102,7 @@ class MasterPanelWindow; * respective documentation. * * @author $Author: fgerlits $ - * @version $Revision: 1.39 $ + * @version $Revision: 1.40 $ * @see LocalizedObject#getBundle(const xmlpp::Element &) * @see AuthenticationClientFactory * @see StorageClientFactory @@ -596,16 +596,6 @@ class GLiveSupport : public LocalizedConfigurable, removeFromSchedule(Ptr::Ref scheduleEntryId) throw (XmlRpcException); - /** - * Delete a playable object from storage. - * - * @param playable the playable object to delete. - * @exception XmlRpcException in case of XML-RPC errors. - */ - virtual void - deletePlayable(Ptr::Ref playable) - throw (XmlRpcException); - /** * Play a Playable object using the output audio player. * diff --git a/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx b/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx index 1b9a13782..41ff4d7a5 100644 --- a/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx +++ b/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.22 $ + Version : $Revision: 1.23 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -166,10 +166,6 @@ ScratchpadWindow :: ScratchpadWindow (Ptr::Ref gLiveSupport, *getResourceUstring("removeMenuItem"), sigc::mem_fun(*this, &ScratchpadWindow::onRemoveItem))); - audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("deleteMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onDeleteItem))); audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem( *getResourceUstring("cueMenuItem"), sigc::mem_fun(*audioButtonBox, @@ -211,10 +207,6 @@ ScratchpadWindow :: ScratchpadWindow (Ptr::Ref gLiveSupport, *getResourceUstring("removeMenuItem"), sigc::mem_fun(*this, &ScratchpadWindow::onRemoveItem))); - playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("deleteMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onDeleteItem))); playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem( *getResourceUstring("cueMenuItem"), sigc::mem_fun(*audioButtonBox, @@ -472,23 +464,6 @@ ScratchpadWindow :: onDownItem(void) throw () } -/*------------------------------------------------------------------------------ - * Event handler for the Delete menu item selected from the entry conext menu - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onDeleteItem(void) throw () -{ - Ptr::Ref playable = currentRow[modelColumns.playableColumn]; - - try { - deleteItem(playable); - } catch (XmlRpcException &e) { - // TODO: signal error here - } - showContents(); -} - - /*------------------------------------------------------------------------------ * Remove an item from the Scratchpad *----------------------------------------------------------------------------*/ @@ -515,18 +490,6 @@ ScratchpadWindow :: removeItem(Ptr::Ref id) throw () } -/*------------------------------------------------------------------------------ - * Delete an item from storage, and remove it from the Scratchpad - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: deleteItem(Ptr::Ref playable) - throw (XmlRpcException) -{ - removeItem(playable->getId()); - gLiveSupport->deletePlayable(playable); -} - - /*------------------------------------------------------------------------------ * Event handler for the Add To Playlist menu item selected from the * entry conext menu diff --git a/livesupport/products/gLiveSupport/src/ScratchpadWindow.h b/livesupport/products/gLiveSupport/src/ScratchpadWindow.h index 177d3aef8..661daf2aa 100644 --- a/livesupport/products/gLiveSupport/src/ScratchpadWindow.h +++ b/livesupport/products/gLiveSupport/src/ScratchpadWindow.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -73,7 +73,7 @@ using namespace LiveSupport::Widgets; * playlists. * * @author $Author: fgerlits $ - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ */ class ScratchpadWindow : public WhiteWindow, public LocalizedObject @@ -87,7 +87,7 @@ class ScratchpadWindow : public WhiteWindow, * Lists one clip per row. * * @author $Author: fgerlits $ - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ */ class ModelColumns : public PlayableTreeModelColumnRecord { @@ -179,7 +179,7 @@ class ScratchpadWindow : public WhiteWindow, Button * clearListButton; /** - * The "delete selected item" button. + * The "remove selected item" button. */ Button * removeButton; @@ -228,13 +228,6 @@ class ScratchpadWindow : public WhiteWindow, virtual void onRemoveItem(void) throw (); - /** - * Signal handler for the "delete" menu item selected from - * the entry context menu. - */ - virtual void - onDeleteItem(void) throw (); - /** * Signal handler for the "up" menu item selected from * the entry context menu. @@ -270,15 +263,6 @@ class ScratchpadWindow : public WhiteWindow, virtual void onAddToLiveMode(void) throw (); - /** - * Delete an item from the storage and remove it from the Scratchpad. - * - * @param playable the Playable object to delete and remove. - * @exception XmlRpcException on XML-RPC errors. - */ - void - deleteItem(Ptr::Ref playable) throw (XmlRpcException); - public: /** diff --git a/livesupport/products/gLiveSupport/var/es.txt b/livesupport/products/gLiveSupport/var/es.txt index 82182e00c..576921a9d 100644 --- a/livesupport/products/gLiveSupport/var/es.txt +++ b/livesupport/products/gLiveSupport/var/es.txt @@ -56,7 +56,6 @@ es:table removeMenuItem:string { "Eliminar" } addToPlaylistMenuItem:string { "Añadir a lista de reproducción" } schedulePlaylistMenuItem:string { "Programar lista de reproducción" } - deleteMenuItem:string { "Eliminar" } cueMenuItem:string { "Previsualizar" } addToLiveModeMenuItem:string { "Añadir a modo en vivo" } } diff --git a/livesupport/products/gLiveSupport/var/hu.txt b/livesupport/products/gLiveSupport/var/hu.txt index a1bbf6fe2..4bf754f1b 100644 --- a/livesupport/products/gLiveSupport/var/hu.txt +++ b/livesupport/products/gLiveSupport/var/hu.txt @@ -52,10 +52,9 @@ hu:table upMenuItem:string { "_Fel" } downMenuItem:string { "_Le" } - removeMenuItem:string { "_Eltávolítani" } + removeMenuItem:string { "_Törölni" } addToPlaylistMenuItem:string { "Műsorhoz _hozzáadni" } schedulePlaylistMenuItem:string { "_Műsor időzítése" } - deleteMenuItem:string { "_Törölni" } cueMenuItem:string { "_Belehallgatni" } addToLiveModeMenuItem:string { "Élő _adásba" } } diff --git a/livesupport/products/gLiveSupport/var/nl.txt b/livesupport/products/gLiveSupport/var/nl.txt index 93899d4dd..512405d7c 100644 --- a/livesupport/products/gLiveSupport/var/nl.txt +++ b/livesupport/products/gLiveSupport/var/nl.txt @@ -56,7 +56,6 @@ nl:table removeMenuItem:string { "_Verwijderen" } addToPlaylistMenuItem:string { "_Toevoegen aan Playlist" } schedulePlaylistMenuItem:string { "_Playlist plannen" } - deleteMenuItem:string { "_Verwijder" } cueMenuItem:string { "_Cue" } addToLiveModeMenuItem:string { "Aan _Live Mode toevoegen" } } diff --git a/livesupport/products/gLiveSupport/var/root.txt b/livesupport/products/gLiveSupport/var/root.txt index 9436e72d8..d479090e1 100644 --- a/livesupport/products/gLiveSupport/var/root.txt +++ b/livesupport/products/gLiveSupport/var/root.txt @@ -56,7 +56,6 @@ root:table removeMenuItem:string { "_Remove" } addToPlaylistMenuItem:string { "_Add To Playlist" } schedulePlaylistMenuItem:string { "_Schedule Playlist" } - deleteMenuItem:string { "_Delete" } cueMenuItem:string { "Pre_view" } addToLiveModeMenuItem:string { "Add To _Live Mode" } } diff --git a/livesupport/products/gLiveSupport/var/sr_CS.txt b/livesupport/products/gLiveSupport/var/sr_CS.txt index 833a6db36..471801993 100644 --- a/livesupport/products/gLiveSupport/var/sr_CS.txt +++ b/livesupport/products/gLiveSupport/var/sr_CS.txt @@ -56,7 +56,6 @@ sr_CS:table removeMenuItem:string { "Ukloni" } addToPlaylistMenuItem:string { "Dodaj u plej listu" } schedulePlaylistMenuItem:string { "programiraj plej listu" } - deleteMenuItem:string { "Obriši" } cueMenuItem:string { "Proba" } addToLiveModeMenuItem:string { "Dodaj u Program Uživo" } } diff --git a/livesupport/products/gLiveSupport/var/sr_CS_CYRILLIC.txt b/livesupport/products/gLiveSupport/var/sr_CS_CYRILLIC.txt index 3d9eb21c3..ffd002cb7 100644 --- a/livesupport/products/gLiveSupport/var/sr_CS_CYRILLIC.txt +++ b/livesupport/products/gLiveSupport/var/sr_CS_CYRILLIC.txt @@ -56,7 +56,6 @@ sr_CS_CYRILLIC:table removeMenuItem:string { "Уклони" } addToPlaylistMenuItem:string { "Додај у плеј листу" } schedulePlaylistMenuItem:string { "Програмирај плеј листу" } - deleteMenuItem:string { "Обриши" } cueMenuItem:string { "Проба" } addToLiveModeMenuItem:string { "Додај у Програм Уживо" } } diff --git a/livesupport/products/scheduler/etc/Makefile.in b/livesupport/products/scheduler/etc/Makefile.in index 1b26b2429..e00012baa 100644 --- a/livesupport/products/scheduler/etc/Makefile.in +++ b/livesupport/products/scheduler/etc/Makefile.in @@ -21,7 +21,7 @@ # # # Author : $Author: fgerlits $ -# Version : $Revision: 1.58 $ +# Version : $Revision: 1.59 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/etc/Makefile.in,v $ # # @configure_input@ @@ -185,7 +185,6 @@ SCHEDULER_OBJS = ${TMP_DIR}/SignalDispatcher.o \ ${TMP_DIR}/RescheduleMethod.o \ ${TMP_DIR}/ScheduleFactory.o \ ${TMP_DIR}/PostgresqlSchedule.o \ - ${TMP_DIR}/DeletePlaylistMethod.o \ ${TMP_DIR}/DisplayPlaylistsMethod.o \ ${TMP_DIR}/OpenPlaylistForEditingMethod.o \ ${TMP_DIR}/CreatePlaylistMethod.o \ @@ -235,8 +234,6 @@ TEST_RUNNER_OBJS = ${SCHEDULER_OBJS} \ ${TMP_DIR}/RescheduleMethodTest.o \ ${TMP_DIR}/RpcRescheduleTest.o \ ${TMP_DIR}/PostgresqlScheduleTest.o \ - ${TMP_DIR}/DeletePlaylistMethodTest.o \ - ${TMP_DIR}/RpcDeletePlaylistTest.o \ ${TMP_DIR}/DisplayPlaylistMethodTest.o \ ${TMP_DIR}/RpcDisplayPlaylistTest.o \ ${TMP_DIR}/DisplayPlaylistsMethodTest.o \ diff --git a/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx b/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx deleted file mode 100644 index fb591f949..000000000 --- a/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx +++ /dev/null @@ -1,148 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.13 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethod.cxx,v $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Storage/StorageClientInterface.h" -#include "LiveSupport/Storage/StorageClientFactory.h" -#include "ScheduleInterface.h" -#include "ScheduleFactory.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "DeletePlaylistMethod.h" - - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Storage; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string DeletePlaylistMethod::methodName = "deletePlaylist"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int DeletePlaylistMethod::errorId = 900; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -DeletePlaylistMethod :: DeletePlaylistMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the XML-RPC function call. - * (Overrides 'execute' in XmlRpcServerMethod.) - *----------------------------------------------------------------------------*/ -void -DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref playlistId; - try{ - playlistId = XmlRpcTools::extractPlaylistId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, "missing playlist ID argument", - returnValue); - return; - } - - Ptr::Ref scf - = StorageClientFactory::getInstance(); - Ptr::Ref storage - = scf->getStorageClient(); - Ptr::Ref playlist; - try { - playlist = storage->getPlaylist(sessionId, playlistId); - } catch (Core::XmlRpcException &e) { - std::string eMsg = "playlist not found:\n"; - eMsg += e.what(); - XmlRpcTools::markError(errorId+3, eMsg, returnValue); - return; - } - - if (playlist->isLocked()) { - XmlRpcTools::markError(errorId+4, "playlist is locked", - returnValue); - return; - } - - try { - storage->deletePlaylist(sessionId, playlistId); - } catch (Core::XmlRpcException &e) { - std::string eMsg = "playlist could not be deleted:\n"; - eMsg += e.what(); - XmlRpcTools::markError(errorId+5, eMsg, returnValue); - return; - } -} diff --git a/livesupport/products/scheduler/src/DeletePlaylistMethod.h b/livesupport/products/scheduler/src/DeletePlaylistMethod.h deleted file mode 100644 index 428a4647e..000000000 --- a/livesupport/products/scheduler/src/DeletePlaylistMethod.h +++ /dev/null @@ -1,152 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethod.h,v $ - -------------------------------------------------------------------------------*/ -#ifndef DeletePlaylistMethod_h -#define DeletePlaylistMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Playlist.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to delete a playlist given by its playlist id. - * - * The name of the method when called through XML-RPC is "deletePlaylist". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
  • playlistId - string - the unique id of the playlist - * to be deleted.
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 901 - invalid argument format
  • - *
  • 902 - missing playlist ID argument
  • - *
  • 903 - playlist not found
  • - *
  • 904 - playlist is locked
  • - *
  • 905 - playlist could not be deleted
  • - *
  • 920- missing session ID argument
  • - *
- * - * @author $Author: fgerlits $ - * @version $Revision: 1.7 $ - */ -class DeletePlaylistMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - DeletePlaylistMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - DeletePlaylistMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the display schedule command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // DisplayPlaylistMethod_h - diff --git a/livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx b/livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx deleted file mode 100644 index 475dda6b3..000000000 --- a/livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx +++ /dev/null @@ -1,160 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.11 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethodTest.cxx,v $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/Storage/StorageClientFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" - -#include "SchedulerDaemon.h" -#include "OpenPlaylistForEditingMethod.h" -#include "SavePlaylistMethod.h" - -#include "DeletePlaylistMethod.h" -#include "DeletePlaylistMethodTest.h" - - -using namespace LiveSupport::Db; -using namespace LiveSupport::Storage; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::Authentication; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(DeletePlaylistMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -DeletePlaylistMethodTest :: setUp(void) throw () -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - Ptr::Ref storage = scheduler->getStorage(); - storage->reset(); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } catch (std::exception &e) { - CPPUNIT_FAIL(e.what()); - } - - authentication = scheduler->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::string eMsg = "could not log in:\n"; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -DeletePlaylistMethodTest :: tearDown(void) throw () -{ - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * A very simple negative test - *----------------------------------------------------------------------------*/ -void -DeletePlaylistMethodTest :: negativeTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new DeletePlaylistMethod()); - XmlRpc::XmlRpcValue parameter; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - - parameter["sessionId"] = sessionId->getId(); - parameter["playlistId"] = "0000000000009999"; - rootParameter[0] = parameter; - - result.clear(); - try { - method->execute(rootParameter, result); - CPPUNIT_FAIL("allowed to delete non-existent playlist"); - } catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 903); // playlist not found - } - - parameter.clear(); - rootParameter.clear(); - parameter["sessionId"] = sessionId->getId(); - parameter["playlistId"] = "0000000000000001"; - rootParameter[0] = parameter; - - result.clear(); - try { - method->execute(rootParameter, result); - CPPUNIT_FAIL("allowed disabled deletePlaylist method"); - } catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 905); // method disabled - } - -} - diff --git a/livesupport/products/scheduler/src/DeletePlaylistMethodTest.h b/livesupport/products/scheduler/src/DeletePlaylistMethodTest.h deleted file mode 100644 index e103fb629..000000000 --- a/livesupport/products/scheduler/src/DeletePlaylistMethodTest.h +++ /dev/null @@ -1,127 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethodTest.h,v $ - -------------------------------------------------------------------------------*/ -#ifndef DeletePlaylistMethodTest_h -#define DeletePlaylistMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the DeletePlaylistMethod class. - * - * @author $Author: maroy, fgerlits - $ - * @version $Revision: 1.6 $ - * @see DeletePlaylistMethod - */ -class DeletePlaylistMethodTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(DeletePlaylistMethodTest); - CPPUNIT_TEST(negativeTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The authentication client produced by the factory. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - - protected: - - /** - * A simple negative test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - negativeTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // DeletePlaylistMethodTest_h - diff --git a/livesupport/products/scheduler/src/RpcDeletePlaylistTest.cxx b/livesupport/products/scheduler/src/RpcDeletePlaylistTest.cxx deleted file mode 100644 index 9756d0061..000000000 --- a/livesupport/products/scheduler/src/RpcDeletePlaylistTest.cxx +++ /dev/null @@ -1,143 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/RpcDeletePlaylistTest.cxx,v $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "SchedulerDaemon.h" - -#include "RpcDeletePlaylistTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcDeletePlaylistTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcDeletePlaylistTest :: setUp(void) throw () -{ - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcDeletePlaylistTest :: tearDown(void) throw () -{ - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A very simple negative test - *----------------------------------------------------------------------------*/ -void -RpcDeletePlaylistTest :: negativeTest(void) - throw (CPPUNIT_NS::Exception) -{ - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000009999"; - - result.clear(); - xmlRpcClient.execute("deletePlaylist", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("faultCode")); - CPPUNIT_ASSERT(int(result["faultCode"]) == 903); // playlist not found - - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - - result.clear(); - xmlRpcClient.execute("deletePlaylist", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("faultCode")); - CPPUNIT_ASSERT(int(result["faultCode"]) == 905); // method disabled - - xmlRpcClient.close(); -} - diff --git a/livesupport/products/scheduler/src/RpcDeletePlaylistTest.h b/livesupport/products/scheduler/src/RpcDeletePlaylistTest.h deleted file mode 100644 index 23b53eb7a..000000000 --- a/livesupport/products/scheduler/src/RpcDeletePlaylistTest.h +++ /dev/null @@ -1,120 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/RpcDeletePlaylistTest.h,v $ - -------------------------------------------------------------------------------*/ -#ifndef RpcDeletePlaylistTest_h -#define RpcDeletePlaylistTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the DeletePlaylistMethod class. - * - * @author $Author: maroy, fgerlits - $ - * @version $Revision: 1.5 $ - * @see DeletePlaylistMethod - */ -class RpcDeletePlaylistTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcDeletePlaylistTest); - CPPUNIT_TEST(negativeTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - protected: - - /** - * A simple negative test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - negativeTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcDeletePlaylistTest_h - diff --git a/livesupport/products/scheduler/src/SchedulerDaemon.cxx b/livesupport/products/scheduler/src/SchedulerDaemon.cxx index 942098b47..761f659ad 100644 --- a/livesupport/products/scheduler/src/SchedulerDaemon.cxx +++ b/livesupport/products/scheduler/src/SchedulerDaemon.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.28 $ + Version : $Revision: 1.29 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.cxx,v $ ------------------------------------------------------------------------------*/ @@ -119,7 +119,6 @@ SchedulerDaemon :: SchedulerDaemon (void) throw () { addAudioClipToPlaylistMethod.reset(new AddAudioClipToPlaylistMethod()); createPlaylistMethod.reset(new CreatePlaylistMethod()); - deletePlaylistMethod.reset(new DeletePlaylistMethod()); displayAudioClipMethod.reset(new DisplayAudioClipMethod()); displayAudioClipsMethod.reset(new DisplayAudioClipsMethod()); displayPlaylistMethod.reset(new DisplayPlaylistMethod()); @@ -282,7 +281,6 @@ SchedulerDaemon :: registerXmlRpcFunctions( { xmlRpcServer->addMethod(addAudioClipToPlaylistMethod.get()); xmlRpcServer->addMethod(createPlaylistMethod.get()); - xmlRpcServer->addMethod(deletePlaylistMethod.get()); xmlRpcServer->addMethod(displayAudioClipMethod.get()); xmlRpcServer->addMethod(displayAudioClipsMethod.get()); xmlRpcServer->addMethod(displayPlaylistMethod.get()); diff --git a/livesupport/products/scheduler/src/SchedulerDaemon.h b/livesupport/products/scheduler/src/SchedulerDaemon.h index 188dd44a3..fbc43c965 100644 --- a/livesupport/products/scheduler/src/SchedulerDaemon.h +++ b/livesupport/products/scheduler/src/SchedulerDaemon.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.20 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.21 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.h,v $ ------------------------------------------------------------------------------*/ @@ -68,7 +68,6 @@ #include "LiveSupport/EventScheduler/EventScheduler.h" #include "AddAudioClipToPlaylistMethod.h" #include "CreatePlaylistMethod.h" -#include "DeletePlaylistMethod.h" #include "DisplayAudioClipMethod.h" #include "DisplayAudioClipsMethod.h" #include "DisplayPlaylistMethod.h" @@ -167,8 +166,8 @@ using namespace LiveSupport::PlaylistExecutor; * xmlRpcDaemon) > * * - * @author $Author: maroy $ - * @version $Revision: 1.20 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.21 $ * @see ConnectionManagerFactory * @see AuthenticationClientFactory * @see StorageClientFactory @@ -237,11 +236,6 @@ class SchedulerDaemon : public Installable, */ Ptr::Ref createPlaylistMethod; - /** - * The deletePlaylistMethod the daemon is providing. - */ - Ptr::Ref deletePlaylistMethod; - /** * The displayAudioClipMethod the daemon is providing. */