mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 16:45:11 -04:00
Modified WikiPages service to Request / Response format in libretroshare.
As opposed to the previous ones, this ends up with a massively complicated set of data calls to build the tree of modifications... It suggests the need for a dbase cache of MetaData for both Groups and Msgs. - modified rsphoto/p3PhotoService interface to conform to 'developing style' - shifted fakeprocessrequests() to p3GxsService - as its generic. - added requestMsgRelatedList() request to allow searching for OrigMsgId, MsgVersions + LatestVersions. - added RsTokReqOptions class to allow fine tuning of requests. - major changes to p3WikiService to conform to new standard. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@5204 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b94e6d9888
commit
a27cecc522
9 changed files with 460 additions and 61 deletions
|
@ -36,6 +36,24 @@
|
|||
* The requests can be generic, but the reponses are service specific (dependent on data types).
|
||||
*/
|
||||
|
||||
// This bit will be filled out over time.
|
||||
#define RS_TOKREQOPT_MSG_VERSIONS 0x0001
|
||||
#define RS_TOKREQOPT_MSG_ORIGMSG 0x0002
|
||||
#define RS_TOKREQOPT_MSG_LATEST 0x0003
|
||||
|
||||
#define RS_TOKREQOPT_MSG_THREAD 0x0004
|
||||
#define RS_TOKREQOPT_MSG_PARENT 0x0005
|
||||
|
||||
class RsTokReqOptions
|
||||
{
|
||||
public:
|
||||
RsTokReqOptions() { mOptions = 0; mBefore = 0; mAfter = 0; }
|
||||
|
||||
uint32_t mOptions;
|
||||
time_t mBefore;
|
||||
time_t mAfter;
|
||||
};
|
||||
|
||||
class RsTokenService
|
||||
{
|
||||
public:
|
||||
|
@ -44,10 +62,12 @@ class RsTokenService
|
|||
virtual ~RsTokenService() { return; }
|
||||
|
||||
/* Data Requests */
|
||||
virtual bool requestGroupList(uint32_t &token) = 0;
|
||||
virtual bool requestGroupData(uint32_t &token, const std::list<std::string> &ids) = 0;
|
||||
virtual bool requestMsgList(uint32_t &token, const std::list<std::string> &ids) = 0;
|
||||
virtual bool requestMsgData(uint32_t &token, const std::list<std::string> &ids) = 0;
|
||||
virtual bool requestGroupList( uint32_t &token, const RsTokReqOptions &opts) = 0;
|
||||
virtual bool requestMsgList( uint32_t &token, const RsTokReqOptions &opts, const std::list<std::string> &groupIds) = 0;
|
||||
virtual bool requestMsgRelatedList(uint32_t &token, const RsTokReqOptions &opts, const std::list<std::string> &msgIds) = 0;
|
||||
|
||||
virtual bool requestGroupData( uint32_t &token, const std::list<std::string> &groupIds) = 0;
|
||||
virtual bool requestMsgData( uint32_t &token, const std::list<std::string> &msgIds) = 0;
|
||||
|
||||
/* Poll */
|
||||
virtual uint32_t requestStatus(const uint32_t token) = 0;
|
||||
|
|
|
@ -111,7 +111,31 @@ virtual ~RsPhoto() { return; }
|
|||
/* changed? */
|
||||
virtual bool updated() = 0;
|
||||
|
||||
/* Data Requests (from RsTokenService) */
|
||||
//virtual bool requestGroupList( uint32_t &token, const RsTokReqOptions &opts) = 0;
|
||||
//virtual bool requestMsgList( uint32_t &token, const RsTokReqOptions &opts, const std::list<std::string> &groupIds) = 0;
|
||||
//virtual bool requestMsgRelatedList(uint32_t &token, const RsTokReqOptions &opts, const std::list<std::string> &msgIds) = 0;
|
||||
|
||||
//virtual bool requestGroupData( uint32_t &token, const std::list<std::string> &groupIds) = 0;
|
||||
//virtual bool requestMsgData( uint32_t &token, const std::list<std::string> &msgIds) = 0;
|
||||
|
||||
/* Poll */
|
||||
//virtual uint32_t requestStatus(const uint32_t token) = 0;
|
||||
|
||||
/* Generic List Data */
|
||||
virtual bool getGroupList(const uint32_t &token, std::list<std::string> &groupIds) = 0;
|
||||
virtual bool getMsgList(const uint32_t &token, std::list<std::string> &msgIds) = 0;
|
||||
|
||||
/* Specific Service Data */
|
||||
virtual bool getAlbum(const uint32_t &token, RsPhotoAlbum &album) = 0;
|
||||
virtual bool getPhoto(const uint32_t &token, RsPhotoPhoto &photo) = 0;
|
||||
|
||||
/* details are updated in album - to choose Album ID, and storage path */
|
||||
virtual bool submitAlbumDetails(RsPhotoAlbum &album) = 0;
|
||||
virtual bool submitPhoto(RsPhotoPhoto &photo) = 0;
|
||||
|
||||
|
||||
#if 0
|
||||
virtual bool requestAlbumList(uint32_t &token) = 0;
|
||||
virtual bool requestPhotoList(uint32_t &token, const std::list<std::string> &albumids) = 0;
|
||||
|
||||
|
@ -121,23 +145,15 @@ virtual bool requestPhotos(uint32_t &token, const std::list<std::string> &photoi
|
|||
virtual bool getAlbumList(const uint32_t &token, std::list<std::string> &albums) = 0;
|
||||
virtual bool getPhotoList(const uint32_t &token, std::list<std::string> &photos) = 0;
|
||||
|
||||
virtual bool getAlbum(const uint32_t &token, RsPhotoAlbum &album) = 0;
|
||||
virtual bool getPhoto(const uint32_t &token, RsPhotoPhoto &photo) = 0;
|
||||
|
||||
/* details are updated in album - to choose Album ID, and storage path */
|
||||
virtual bool submitAlbumDetails(RsPhotoAlbum &album) = 0;
|
||||
virtual bool submitPhoto(RsPhotoPhoto &photo) = 0;
|
||||
|
||||
|
||||
/* Data Requests (from RsTokenService) */
|
||||
virtual bool requestGroupList(uint32_t &token) { return requestAlbumList(token); }
|
||||
virtual bool requestGroupData(uint32_t &token, const std::list<std::string> &ids) { return requestAlbums(token, ids); }
|
||||
virtual bool requestMsgList(uint32_t &token, const std::list<std::string> &ids) { return requestPhotoList(token, ids); }
|
||||
virtual bool requestMsgData(uint32_t &token, const std::list<std::string> &ids) { return requestPhotos(token, ids); }
|
||||
#endif
|
||||
|
||||
|
||||
/* Poll */
|
||||
virtual uint32_t requestStatus(const uint32_t token) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#include <retroshare/rsidentity.h>
|
||||
|
||||
/* The Main Interface Class - for information about your Peers */
|
||||
class RsWiki;
|
||||
extern RsWiki *rsWiki;
|
||||
|
@ -76,7 +78,7 @@ class RsWikiPage
|
|||
std::string mHashTags;
|
||||
};
|
||||
|
||||
class RsWiki
|
||||
class RsWiki: public RsTokenService
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -86,16 +88,39 @@ virtual ~RsWiki() { return; }
|
|||
/* changed? */
|
||||
virtual bool updated() = 0;
|
||||
|
||||
/* Data Requests (from RsTokenService) */
|
||||
//virtual bool requestGroupList( uint32_t &token, const RsTokReqOptions &opts) = 0;
|
||||
//virtual bool requestMsgList( uint32_t &token, const RsTokReqOptions &opts, const std::list<std::string> &groupIds) = 0;
|
||||
//virtual bool requestMsgRelatedList(uint32_t &token, const RsTokReqOptions &opts, const std::list<std::string> &msgIds) = 0;
|
||||
|
||||
//virtual bool requestGroupData( uint32_t &token, const std::list<std::string> &groupIds) = 0;
|
||||
//virtual bool requestMsgData( uint32_t &token, const std::list<std::string> &msgIds) = 0;
|
||||
|
||||
/* Poll */
|
||||
//virtual uint32_t requestStatus(const uint32_t token) = 0;
|
||||
|
||||
/* Generic List Data */
|
||||
virtual bool getGroupList(const uint32_t &token, std::list<std::string> &groupIds) = 0;
|
||||
virtual bool getMsgList(const uint32_t &token, std::list<std::string> &msgIds) = 0;
|
||||
|
||||
/* Specific Service Data */
|
||||
virtual bool getGroupData(const uint32_t &token, RsWikiGroup &group) = 0;
|
||||
virtual bool getMsgData(const uint32_t &token, RsWikiPage &page) = 0;
|
||||
|
||||
|
||||
|
||||
/* details are updated in group - to choose GroupID */
|
||||
virtual bool createGroup(RsWikiGroup &group) = 0;
|
||||
virtual bool createPage(RsWikiPage &page) = 0;
|
||||
|
||||
#if 0
|
||||
virtual bool getGroupList(std::list<std::string> &groups) = 0;
|
||||
virtual bool getGroup(const std::string &groupid, RsWikiGroup &group) = 0;
|
||||
virtual bool getPage(const std::string &pageid, RsWikiPage &page) = 0;
|
||||
virtual bool getPageVersions(const std::string &origPageId, std::list<std::string> &pages) = 0;
|
||||
virtual bool getOrigPageList(const std::string &groupid, std::list<std::string> &pageIds) = 0;
|
||||
virtual bool getLatestPage(const std::string &origPageId, std::string &pageId) = 0;
|
||||
|
||||
/* details are updated in group - to choose GroupID */
|
||||
virtual bool createGroup(RsWikiGroup &group) = 0;
|
||||
virtual bool createPage(RsWikiPage &page) = 0;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue