wrote specifications for the playlist methods in the storage server

started adding a savePlaylist() call to the xml-rpc functions which
  call the storage server (I should have done this earlier but didn't)
This commit is contained in:
fgerlits 2004-11-26 18:54:53 +00:00
parent 41f6befa43
commit 7a6592edbf
8 changed files with 346 additions and 75 deletions

View File

@ -14,7 +14,7 @@ Development Loan Fund</a>, under the GNU <a
href="http://www.gnu.org/licenses/gpl.html">GPL</a>.<br>
<ul>
<li>Author: $Author: fgerlits $</li>
<li>Version: $Revision: 1.2 $</li>
<li>Version: $Revision: 1.3 $</li>
<li>Location: $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/doc/model/LocalStorage/index.html,v $</li>
</ul>
<h1>Scope</h1>
@ -1552,9 +1552,15 @@ Scheduler daemon, and the main associations between the concepts.<br>
<td valign="top">Component responsible for doing the
authentications <br>
</td>
</tr>
<td valign="top"><b>Session ID</b><br>
</td>
<td valign="top">An identifier issued by Authentication, to be
used by subsequent operations.<br>
</td>
</tr>
<tr>
<td valign="top"><b>Unique Id<br>
<td valign="top"><b>Unique ID<br>
</b> </td>
<td valign="top">A globally unique identifier used to to
differentiate between objects that might even be created on different
@ -1608,6 +1614,19 @@ in the Local storage<br>
extra (fade in / fade out) information<br>
</td>
</tr>
<tr>
<td valign="top"><b>URL</b><br>
</td>
<td valign="top">The location of a metafile (in the local filesystem)<br>
</td>
</tr>
<tr>
<td valign="top"><b>Token</b><br>
</td>
<td valign="top">An identifier used to match the parts of two-part
operations, e.g., access--release or edit--save<br>
</td>
</tr>
<tr>
<td valign="top"><br>
</td>
@ -1743,6 +1762,25 @@ AudioClips<br>
<td valign="top">This includes creating, editing, deleting and
accessing Playlists<br>
</td>
</tr>
<td valign="top">Playlist<br>
</td>
<td valign="top">Is associated with<br>
</td>
<td valign="top">URL<br>
</td>
<td valign="top">The path of (a copy of) the playlist metafile<br>
</td>
</tr>
<td valign="top">Playlist<br>
</td>
<td valign="top">Is associated with<br>
</td>
<td valign="top">Token<br>
</td>
<td valign="top">An identifier issued by access operations, to be
used for identification by release operations<br>
</td>
</tr>
<tr>
<td valign="top"><br>
@ -1818,7 +1856,8 @@ see Authentication : Authenticate<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">existsAudioClip<br>
(audioClipId : UniqueId)<br>
(sessionId : SessionId, <br>
audioClipId : UniqueId)<br>
: boolean<br>
</td>
</tr>
@ -1891,7 +1930,8 @@ with the specified id is stored in Local storage, false otherwise<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">storeAudioClip<br>
(audioClip : AudioClip)<br>
(sessionId : SessionId, <br>
audioClip : AudioClip)<br>
: UniqueId<br>
</td>
</tr>
@ -2041,7 +2081,8 @@ are replaced by the presented contents<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">deleteAudioClip<br>
(audioClipId : UniqueId)<br>
(sessionId : SessionId, <br>
audioClipId : UniqueId)<br>
: void<br>
</td>
</tr>
@ -2149,7 +2190,8 @@ as an error.<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">updateAudioClipMetadata<br>
(audioClipId : UniqueId,<br>
(sessionId : SessionId, <br>
audioClipId : UniqueId,<br>
newMetadata : MetaData)<br>
: void<br>
</td>
@ -2233,7 +2275,8 @@ replaced with the presented contents<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">accessRawAudioData<br>
(audioClipId : UniqueId)<br>
(sessionId : SessionId, <br>
audioClipId : UniqueId)<br>
: RawAudioData<br>
</td>
</tr>
@ -2317,7 +2360,8 @@ RawAudioData for AudioClip is increased by one<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">releaseRawAudioData<br>
(rawAudioData : RawAudioData)<br>
(sessionId : SessionId, <br>
rawAudioData : RawAudioData)<br>
: void<br>
</td>
</tr>
@ -2400,7 +2444,8 @@ RawAudioData for AudioClip is decreased by one<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">searchMetadata<br>
(criteria : SearchCriteria)<br>
(sessionId : SessionId, <br>
criteria : SearchCriteria)<br>
: UniqueId<br>
</td>
</tr>
@ -2474,7 +2519,8 @@ ids, for which MetaData matches the supplied search criteria<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">getAudioClip<br>
(audioClipId : UniqueId)<br>
(sessionId : SessionId, <br>
audioClipId : UniqueId)<br>
: AudioClip<br>
</td>
</tr>
@ -2549,7 +2595,8 @@ specified by the supplied id.<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">createPlaylist<br>
(playlistId : UniqueId)<br>
(sessionId : SessionId, <br>
playlistId : UniqueId)<br>
: void<br>
</td>
</tr>
@ -2638,8 +2685,9 @@ not being edited<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">editPlaylist<br>
(playlistId : UniqueId)<br>
: Playlist<br>
(sessionId : SessionId, <br>
playlistId : UniqueId)<br>
: { playlistURL : URL, playlistToken: Token }<br>
</td>
</tr>
<tr>
@ -2729,7 +2777,9 @@ associated with the token returned<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">savePlaylist<br>
(playlist : Playlist)<br>
(sessionId : SessionId, <br>
playlistToken : Token, <br>
newPlaylistURL : URL)<br>
: void<br>
</td>
</tr>
@ -2755,15 +2805,13 @@ metafile in place of the old one.<br>
<tr>
<td valign="top"><b>Notes</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">'playlist' is two arguments,
really: the URL of a (new) Playlist metafile,
and the token returned previously by editPlaylist()<br>
<td colspan="2" rowspan="1" valign="top">none<br>
</td>
</tr>
<tr>
<td valign="top"><b>Exceptions</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">if the playlist token argument
<td colspan="2" rowspan="1" valign="top">if the playlistToken argument
does not match a token generated earlier in this session by editPlaylist(),
report as an error<br>
</td>
@ -2799,8 +2847,8 @@ not being edited<br>
</tr>
<tr>
<td valign="top"></td>
<td valign="top">the token and the URL returned earlier by
editPlaylist() together with it are no longer valid</td>
<td valign="top">the playlistToken token and the URL returned earlier
by editPlaylist() together with it are no longer valid</td>
<td valign="top">association broken<br>
</td>
</tr>
@ -2823,7 +2871,8 @@ editPlaylist() together with it are no longer valid</td>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">deletePlaylist<br>
(playlistId : UniqueId)<br>
(sessionId : SessionId, <br>
playlistId : UniqueId)<br>
: void<br>
</td>
</tr>
@ -2904,8 +2953,9 @@ being edited, report as an error<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">accessPlaylist<br>
(playlistId : UniqueId)<br>
: Playlist<br>
(sessionId : SessionId, <br>
playlistId : UniqueId)<br>
: { playlistURL : URL, playlistToken : Token }<br>
</td>
</tr>
<tr>
@ -2988,7 +3038,8 @@ associated with the token returned<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">releasePlaylist<br>
(playlist : Playlist)<br>
(sessionId : SessionId, <br>
playlistToken : Token)<br>
: void<br>
</td>
</tr>
@ -3014,14 +3065,13 @@ obtained earlier by accessPlaylist().<br>
<tr>
<td valign="top"><b>Notes</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">here 'playlist' is just one
argument (sorry!), a token returned previously by accessPlaylist()<br>
<td colspan="2" rowspan="1" valign="top">none<br>
</td>
</tr>
<tr>
<td valign="top"><b>Exceptions</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">if the playlist token argument
<td colspan="2" rowspan="1" valign="top">if the playlistToken argument
does not match a token generated earlier in this session by accessPlaylist(),
report as an error<br>
</td>
@ -3047,8 +3097,8 @@ report as an error<br>
</tr>
<tr>
<td valign="top"></td>
<td valign="top">the token and the URL returned earlier by
accessPlaylist() together with it are no longer valid</td>
<td valign="top">the playlistToken token and the URL returned earlier
by accessPlaylist() together with it are no longer valid</td>
<td valign="top">association broken<br>
</td>
</tr>
@ -3071,7 +3121,8 @@ accessPlaylist() together with it are no longer valid</td>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">existsPlaylist<br>
(playlistId : UniqueId)<br>
(sessionId : SessionId, <br>
playlistId : UniqueId)<br>
: bool<br>
</td>
</tr>
@ -3133,6 +3184,79 @@ metafile with the given playlist ID exists.<br>
</tbody>
</table>
<br>
<h4>Contract for Local storage : playlistIsAvailable<br>
</h4>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">playlistIsAvailable<br>
(sessionId : SessionId, <br>
playlistId : UniqueId)<br>
: bool<br>
</td>
</tr>
<tr>
<td valign="top"><b>Responsibilities</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">Check whether a Playlist
metafile with the given playlist ID is available for editing, i.e., exists
and has not been opened for editing yet.<br>
</td>
</tr>
<tr>
<td valign="top"><b>Type</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">system<br>
</td>
</tr>
<tr>
<td valign="top"><b>Cross-reference</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">UC-7<br>
</td>
</tr>
<tr>
<td valign="top"><b>Notes</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">none<br>
</td>
</tr>
<tr>
<td valign="top"><b>Exceptions</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">none<br>
</td>
</tr>
<tr>
<td valign="top"><b>Output</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">true if the playlist exists
and is available; false if either condition fails<br>
</td>
</tr>
<tr>
<td valign="top"><b>Pre-conditions</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">none</td>
</tr>
<tr>
<td valign="top"><b>Post-conditions</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">none</td>
</tr>
<tr>
<td valign="top"><br>
</td>
<td valign="top"><br>
</td>
<td valign="top"><br>
</td>
</tr>
</tbody>
</table>
<br>
<h4>Contract for Local storage : accessAudioClip<br>
</h4>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
@ -3141,8 +3265,9 @@ metafile with the given playlist ID exists.<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">accessAudioClip<br>
(audioClipId : UniqueId)<br>
: AudioClip<br>
(sessionId : SessionId, <br>
audioClipId : UniqueId)<br>
: { audioClipURL : URL, audioClipToken : Token }<br>
</td>
</tr>
<tr>
@ -3223,7 +3348,8 @@ associated with the token returned<br>
<td valign="top"><b>Name</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">releaseAudioClip<br>
(audioClip : AudioClip)<br>
(sessionId : SessionId, <br>
audioClipToken : Token)<br>
: void<br>
</td>
</tr>
@ -3249,14 +3375,13 @@ obtained earlier by accessAudioClip().<br>
<tr>
<td valign="top"><b>Notes</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">here 'audioClip' is just one
argument (sorry!), a token returned previously by accessAudioClip()<br>
<td colspan="2" rowspan="1" valign="top">none<br>
</td>
</tr>
<tr>
<td valign="top"><b>Exceptions</b><br>
</td>
<td colspan="2" rowspan="1" valign="top">if the playlist token argument
<td colspan="2" rowspan="1" valign="top">if the audioClipToken argument
does not match a token generated earlier in this session by accessAudioClip(),
report as an error<br>
</td>
@ -3282,8 +3407,8 @@ report as an error<br>
</tr>
<tr>
<td valign="top"></td>
<td valign="top">the token and the URL returned earlier by
accessAudioClip() together with it are no longer valid</td>
<td valign="top">the audioClipToken token and the URL returned earlier
by accessAudioClip() together with it are no longer valid</td>
<td valign="top">association broken<br>
</td>
</tr>

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.14 $
Version : $Revision: 1.15 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/Attic/StorageClientInterface.h,v $
------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ namespace Core {
* An interface for storage clients.
*
* @author $Author: fgerlits $
* @version $Revision: 1.14 $
* @version $Revision: 1.15 $
*/
class StorageClientInterface
{
@ -82,7 +82,7 @@ class StorageClientInterface
= 0;
/**
* Return a playlist with the specified id.
* Return a playlist with the specified id, to be displayed.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
@ -96,6 +96,35 @@ class StorageClientInterface
throw (std::logic_error)
= 0;
/**
* Return a playlist with the specified id, to be edited.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
* @return the requested playlist.
* @exception std::logic_error if no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (std::logic_error)
= 0;
/**
* Save the playlist after editing.
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to save.
* @exception std::logic_error if the playlist has not been previously
* opened by getPlaylist()
*/
virtual void
savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (std::logic_error)
= 0;
/**
* Acquire the resources for the playlist.
*

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.18 $
Version : $Revision: 1.19 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $
------------------------------------------------------------------------------*/
@ -191,7 +191,7 @@ TestStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
/*------------------------------------------------------------------------------
* Return a playlist.
* Return a playlist to be displayed.
*----------------------------------------------------------------------------*/
Ptr<Playlist>::Ref
TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
@ -208,6 +208,35 @@ TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
}
/*------------------------------------------------------------------------------
* Return a playlist to be edited.
*----------------------------------------------------------------------------*/
Ptr<Playlist>::Ref
TestStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (std::invalid_argument)
{
PlaylistMap::const_iterator it = playlistMap.find(id->getId());
if (it == playlistMap.end()) {
throw std::invalid_argument("no such playlist");
}
return it->second;
}
/*------------------------------------------------------------------------------
* Save a playlist after editing.
*----------------------------------------------------------------------------*/
void
TestStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (std::logic_error)
{
}
/*------------------------------------------------------------------------------
* Acquire resources for a playlist.
*----------------------------------------------------------------------------*/

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.16 $
Version : $Revision: 1.17 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $
------------------------------------------------------------------------------*/
@ -90,7 +90,7 @@ using namespace LiveSupport::Core;
* </code></pre>
*
* @author $Author: fgerlits $
* @version $Revision: 1.16 $
* @version $Revision: 1.17 $
*/
class TestStorageClient :
virtual public Configurable,
@ -179,7 +179,7 @@ class TestStorageClient :
throw ();
/**
* Return a playlist with the specified id.
* Return a playlist with the specified id, to be displayed.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
@ -192,6 +192,33 @@ class TestStorageClient :
Ptr<UniqueId>::Ref id) const
throw (std::invalid_argument);
/**
* Return a playlist with the specified id, to be edited.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
* @return the requested playlist.
* @exception std::invalid_argument if no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (std::invalid_argument);
/**
* Save the playlist after editing.
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to save.
* @exception std::logic_error if the playlist has not been previously
* opened by getPlaylist()
*/
virtual void
savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (std::logic_error);
/**
* Acquire the resources for the playlist.
*

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $
------------------------------------------------------------------------------*/
@ -288,7 +288,7 @@ WebStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
/*------------------------------------------------------------------------------
* Return a playlist.
* Return a playlist to be displayed.
*----------------------------------------------------------------------------*/
Ptr<Playlist>::Ref
WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
@ -300,6 +300,30 @@ WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
}
/*------------------------------------------------------------------------------
* Return a playlist to be edited.
*----------------------------------------------------------------------------*/
Ptr<Playlist>::Ref
WebStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (std::logic_error)
{
Ptr<Playlist>::Ref playlist(new Playlist);
return playlist;
}
/*------------------------------------------------------------------------------
* Save a playlist after editing.
*----------------------------------------------------------------------------*/
void
WebStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (std::logic_error)
{
}
/*------------------------------------------------------------------------------
* Acquire resources for a playlist.
*----------------------------------------------------------------------------*/

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $
------------------------------------------------------------------------------*/
@ -99,7 +99,7 @@ using namespace LiveSupport::Core;
* </code></pre>
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @version $Revision: 1.5 $
*/
class WebStorageClient :
virtual public Configurable,
@ -201,7 +201,7 @@ class WebStorageClient :
throw (std::logic_error);
/**
* Return a playlist with the specified id.
* Return a playlist with the specified id, to be displayed.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
@ -215,6 +215,34 @@ class WebStorageClient :
Ptr<UniqueId>::Ref id) const
throw (std::logic_error);
/**
* Return a playlist with the specified id, to be edited.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
* @return the requested playlist.
* @exception std::logic_error if no playlist with the specified
* id exists.
* @exception std::logic_error if we have not logged in yet.
*/
virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (std::logic_error);
/**
* Save the playlist after editing.
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to save.
* @exception std::logic_error if the playlist has not been previously
* opened by getPlaylist()
*/
virtual void
savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (std::logic_error);
/**
* Acquire the resources for the playlist.
*

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.6 $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/
@ -112,7 +112,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
sessionId = XmlRpcTools::extractSessionId(parameters);
}
catch (std::invalid_argument &e) {
XmlRpcTools::markError(errorId+22,
XmlRpcTools::markError(errorId+20,
"missing session ID argument",
returnValue);
return;
@ -158,15 +158,10 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
playlist = storage->getPlaylist(sessionId, playlistId);
}
catch (std::invalid_argument &e) {
XmlRpcTools::markError(errorId+5, "playlist not found",
returnValue);
return;
}
if (!playlist->canBeEdited()) {
XmlRpcTools::markError(errorId+6,
"playlist has not been opened for editing",
returnValue);
std::string eMsg = "AddAudioClipToPlaylistlaylist: ";
eMsg += "storage.getPlaylist() error:\n";
eMsg += e.what();
XmlRpcTools::markError(errorId+5, eMsg, returnValue);
return;
}
@ -175,18 +170,32 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
audioClip = storage->getAudioClip(sessionId, audioClipId);
}
catch (std::invalid_argument &e) {
XmlRpcTools::markError(errorId+7, "audio clip does not exist",
returnValue);
std::string eMsg = "AddAudioClipToPlaylistlaylist: ";
eMsg += "storage.getAudioClip() error:\n";
eMsg += e.what();
XmlRpcTools::markError(errorId+7, eMsg, returnValue);
return;
}
try { // and finally, the beef
try {
playlist->addAudioClip(audioClip, relativeOffset);
}
catch(std::invalid_argument &e) {
XmlRpcTools::markError(errorId+8,
"two audio clips at the same relative offset",
returnValue);
std::string eMsg = "AddAudioClipToPlaylistlaylist: ";
eMsg += "playlist.addAudioClip() error:\n";
eMsg += e.what();
XmlRpcTools::markError(errorId+8, eMsg, returnValue);
return;
}
try {
storage->savePlaylist(sessionId, playlist);
}
catch (std::invalid_argument &e) {
std::string eMsg = "AddAudioClipToPlaylistlaylist: ";
eMsg += "storage.savePlaylist() error:\n";
eMsg += e.what();
XmlRpcTools::markError(errorId+10, eMsg, returnValue);
return;
}
}

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.6 $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.h,v $
------------------------------------------------------------------------------*/
@ -94,15 +94,15 @@ using namespace LiveSupport::Core;
* <li>302 - missing playlist ID argument </li>
* <li>303 - missing audio clip ID argument </li>
* <li>304 - missing relative offset argument </li>
* <li>305 - playlist not found </li>
* <li>306 - playlist has not been opened for editing </li>
* <li>307 - audio clip does not exist </li>
* <li>308 - two audio clips at the same relative offset</li>
* <li>322 - missing session ID argument </li>
* <li>305 - storage.getPlaylist() returned error message </li>
* <li>307 - storage.getAudioClip() returned error message </li>
* <li>308 - playlist.addAudioClip() returned error message </li>
* <li>310 - storage.savePlaylist() returned error message </li>
* <li>320 - missing session ID argument </li>
* </ul>
*
* @author $Author: fgerlits $
* @version $Revision: 1.6 $
* @version $Revision: 1.7 $
*/
class AddAudioClipToPlaylistMethod : public XmlRpc::XmlRpcServerMethod
{