fixed bug in TestStorageClient reset() [did not reset list of working

copies of edited playlists];
some corrections in documentation
This commit is contained in:
fgerlits 2005-01-29 07:58:36 +00:00
parent 82e09c51b3
commit d78879f893
6 changed files with 39 additions and 22 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.3 $ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/Attic/SearchCriteria.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/Attic/SearchCriteria.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -116,6 +116,7 @@ class SearchCriteria
*/ */
typedef std::vector<SearchConditionType> typedef std::vector<SearchConditionType>
SearchConditionListType; SearchConditionListType;
/** /**
* The vector of search conditions. * The vector of search conditions.
*/ */

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -67,7 +67,7 @@ using namespace Core;
* An interface for storage clients. * An interface for storage clients.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.9 $ * @version $Revision: 1.10 $
*/ */
class StorageClientInterface class StorageClientInterface
{ {
@ -105,7 +105,12 @@ class StorageClientInterface
/** /**
* Return a playlist with the specified id to be displayed. * Return a playlist with the specified id to be displayed.
* If the playlist is being edited, its last saved state is returned. * If the playlist is being edited, and this method is called
* by the same user who is editing the playlist,
* (i.e., the method is called with the same sessionId and playlistId
* that editPlaylist() was), then the working copy of the playlist
* is returned.
* Any other user gets the old (pre-editPlaylist()) copy from storage.
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
@ -125,6 +130,10 @@ class StorageClientInterface
* This puts a lock on the playlist, and nobody else can edit it * This puts a lock on the playlist, and nobody else can edit it
* until we release it using savePlaylist(). * until we release it using savePlaylist().
* *
* This method creates a working copy of the playlist, which will
* be returned by getPlaylist() if it is called with the same
* sessionId and playlistId, until we call savePlaylist().
*
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @return the requested playlist. * @return the requested playlist.
@ -143,6 +152,8 @@ class StorageClientInterface
* Can only be called after we obtained a lock on the playlist using * Can only be called after we obtained a lock on the playlist using
* editPlaylist(); this method releases the lock. * editPlaylist(); this method releases the lock.
* *
* This method destroys the working copy created by editPlaylist().
*
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param playlist the playlist to save. * @param playlist the playlist to save.
* @exception XmlRpcException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
@ -359,8 +370,8 @@ class StorageClientInterface
/** /**
* Return the list of audio clip IDs found by the search method. * Return the list of audio clip IDs found by the search method.
* *
* (Or the list of audio clip IDs returned by the reset() method * (Or the list of audio clip IDs returned by reset()
* in WebStorageClient -- used for testing.) * -- used for testing.)
* *
* @return a vector of UniqueId objects. * @return a vector of UniqueId objects.
*/ */
@ -371,8 +382,8 @@ class StorageClientInterface
/** /**
* Return the list of playlist IDs found by the search method. * Return the list of playlist IDs found by the search method.
* *
* (Or the list of playlist IDs returned by the reset() method * (Or the list of playlist IDs returned by reset()
* in WebStorageClient -- used for testing.) * -- used for testing.)
* *
* @return a vector of UniqueId objects. * @return a vector of UniqueId objects.
*/ */

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.3 $ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/Attic/SearchCriteria.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/Attic/SearchCriteria.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -95,13 +95,16 @@ SearchCriteria :: operator XmlRpc::XmlRpcValue() const
XmlRpc::XmlRpcValue returnValue; XmlRpc::XmlRpcValue returnValue;
returnValue["filetype"] = type; returnValue["filetype"] = type;
returnValue["operator"] = logicalOperator; if (searchConditions.size() != 1) {
returnValue["operator"] = logicalOperator;
}
XmlRpc::XmlRpcValue conditionList; XmlRpc::XmlRpcValue conditionList;
conditionList.setSize(searchConditions.size()); conditionList.setSize(searchConditions.size());
SearchConditionListType::const_iterator SearchConditionListType::const_iterator it, end;
it = searchConditions.begin(); it = searchConditions.begin();
for (int i = 0; it != searchConditions.end(); ++i, ++it) { end = searchConditions.end();
for (int i = 0; it != end; ++i, ++it) {
XmlRpc::XmlRpcValue condition; XmlRpc::XmlRpcValue condition;
condition["cat"] = it->key; condition["cat"] = it->key;
condition["op"] = it->comparisonOperator; condition["op"] = it->comparisonOperator;

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.35 $ Version : $Revision: 1.36 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -185,6 +185,7 @@ TestStorageClient :: reset(void)
xmlpp::Node::NodeList::iterator it xmlpp::Node::NodeList::iterator it
= nodes.begin(); = nodes.begin();
playlistMap.clear(); playlistMap.clear();
editedPlaylists.clear();
playlistIds.reset(new std::vector<Ptr<UniqueId>::Ref>); playlistIds.reset(new std::vector<Ptr<UniqueId>::Ref>);
while (it != nodes.end()) { while (it != nodes.end()) {
@ -201,6 +202,7 @@ TestStorageClient :: reset(void)
nodes = element->get_children(AudioClip::getConfigElementName()); nodes = element->get_children(AudioClip::getConfigElementName());
it = nodes.begin(); it = nodes.begin();
audioClipMap.clear(); audioClipMap.clear();
audioClipUris.clear();
audioClipIds.reset(new std::vector<Ptr<UniqueId>::Ref>); audioClipIds.reset(new std::vector<Ptr<UniqueId>::Ref>);
while (it != nodes.end()) { while (it != nodes.end()) {

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.29 $ Version : $Revision: 1.30 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -86,7 +86,7 @@ using namespace LiveSupport::Core;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.29 $ * @version $Revision: 1.30 $
*/ */
class TestStorageClient : class TestStorageClient :
virtual public Configurable, virtual public Configurable,
@ -512,7 +512,7 @@ class TestStorageClient :
/** /**
* Return the list of audio clip IDs found by the search method. * Return the list of audio clip IDs found by the search method.
* *
* (Or the list of audio clip IDs returned by the reset() method * (Or the list of audio clip IDs returned by reset()
* -- used for testing.) * -- used for testing.)
* *
* @return a vector of UniqueId objects. * @return a vector of UniqueId objects.
@ -527,7 +527,7 @@ class TestStorageClient :
/** /**
* Return the list of playlist IDs found by the search method. * Return the list of playlist IDs found by the search method.
* *
* (Or the list of playlist IDs returned by the reset() method * (Or the list of playlist IDs returned by reset()
* -- used for testing.) * -- used for testing.)
* *
* @return a vector of UniqueId objects. * @return a vector of UniqueId objects.

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.23 $ Version : $Revision: 1.24 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -96,7 +96,7 @@ using namespace LiveSupport::Core;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.23 $ * @version $Revision: 1.24 $
*/ */
class WebStorageClient : class WebStorageClient :
virtual public Configurable, virtual public Configurable,
@ -513,7 +513,7 @@ class WebStorageClient :
/** /**
* Return the list of playlist IDs found by the search method. * Return the list of playlist IDs found by the search method.
* *
* (Or the list of playlist IDs returned by the reset() method * (Or the list of playlist IDs returned by reset()
* -- used for testing.) * -- used for testing.)
* *
* @return a vector of UniqueId objects. * @return a vector of UniqueId objects.
@ -528,7 +528,7 @@ class WebStorageClient :
/** /**
* Return the list of audio clip IDs found by the search method. * Return the list of audio clip IDs found by the search method.
* *
* (Or the list of audio clip IDs returned by the reset() method * (Or the list of audio clip IDs returned by reset()
* -- used for testing.) * -- used for testing.)
* *
* @return a vector of UniqueId objects. * @return a vector of UniqueId objects.