mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-25 09:29:23 -04:00
Added acadeeb - A bibiography / reference paper system.
Added wire - decentralised twitter clone. Tweaks to other definitions. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@4809 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
aa64617142
commit
6d4fa40416
82
libretroshare/src/gxs/db_acadeeb.h
Normal file
82
libretroshare/src/gxs/db_acadeeb.h
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* libretroshare/src/gxp: gxp_apps.h
|
||||||
|
*
|
||||||
|
* General Exchange Protocol interface for RetroShare.
|
||||||
|
*
|
||||||
|
* Copyright 2011-2011 by Robert Fernie.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License Version 2 as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This library 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
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||||
|
* USA.
|
||||||
|
*
|
||||||
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RS_ACADEE_H
|
||||||
|
#define RS_ACADEE_H
|
||||||
|
|
||||||
|
/*******
|
||||||
|
* Stores a Bibliography of Academic Articles, with links to allow you to access the actual article.
|
||||||
|
* The data fields, should contain enough information to
|
||||||
|
* - extract full biblio (bibtex or ris formats).
|
||||||
|
* - read abstract.
|
||||||
|
* - review / rating of the article
|
||||||
|
* - references to similar papers, and bibliography.
|
||||||
|
* - keywords, and the like.
|
||||||
|
*
|
||||||
|
* It will be possible to have multiple identical / similar / different descriptions of the same article.
|
||||||
|
* The class will have to handle this: sorting and matching as best it can.
|
||||||
|
*
|
||||||
|
****/
|
||||||
|
|
||||||
|
class gxp::Paper
|
||||||
|
{
|
||||||
|
/* fields from ris */
|
||||||
|
std::string reftype;
|
||||||
|
std::string journal;
|
||||||
|
std::string title;
|
||||||
|
std::string issuetitle;
|
||||||
|
uint32_t volume;
|
||||||
|
uint32_t issue;
|
||||||
|
std::string publisher;
|
||||||
|
std::string serialnumber;
|
||||||
|
std::string url;
|
||||||
|
std::list<std::string> authors;
|
||||||
|
time_t date;
|
||||||
|
uint32_t startpage;
|
||||||
|
uint32_t endpage;
|
||||||
|
std::string language;
|
||||||
|
|
||||||
|
std::string abstract;
|
||||||
|
|
||||||
|
// KeyWords <- go into hashtags (parent class)
|
||||||
|
//References & Similar Papers <- go into links (parent class)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class rsAcadee: public rsGmxp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/* we want to access the */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* RS_GXP_H */
|
||||||
|
|
||||||
|
|
@ -50,14 +50,49 @@
|
|||||||
*****/
|
*****/
|
||||||
|
|
||||||
|
|
||||||
|
/******
|
||||||
|
* NOTES:
|
||||||
|
* 1) Based on Forum/Channel Groups.
|
||||||
|
* 2) Will likely need to extend to handle info for other services.
|
||||||
|
* 3) Perhaps a more generalised class like gxmp::msg would be best with extra data.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
class gxmp::group
|
||||||
|
{
|
||||||
|
gxp::id grpId;
|
||||||
|
uint32_t grpType; /* FORUM, CHANNEL, TWITTER, etc */
|
||||||
|
|
||||||
|
uint32_t timestamp;
|
||||||
|
uint32_t grpFlags;
|
||||||
|
std::string grpName;
|
||||||
|
std::string grpDesc;
|
||||||
|
std::string grpCategory;
|
||||||
|
|
||||||
|
RsTlvImage grpPixmap;
|
||||||
|
|
||||||
|
gpp::permissions grpPermissions;
|
||||||
|
|
||||||
|
gxip::keyref adminKey;
|
||||||
|
gxip::keyrefset publishKeys;
|
||||||
|
|
||||||
|
gxip::signature adminSignature;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/******
|
/******
|
||||||
* NOTES:
|
* NOTES:
|
||||||
* 1) This represents the base of the Unpacked Msgs, it will be overloaded by all classes
|
* 1) This represents the base of the Unpacked Msgs, it will be overloaded by all classes
|
||||||
* that want to use the service. It is difficult to go from gxmp::msg => gxmp::signedmsg
|
* that want to use the service. It is difficult to go from gxmp::msg => gxmp::signedmsg
|
||||||
* so data should be stored in the signedmsg format.
|
* so data should be stored in the signedmsg format.
|
||||||
* 2) All services will fundamentally use data types derived from this.
|
* 2) All services will fundamentally use data types derived from this.
|
||||||
* 3) This packet is only serialised once at post time, typically it is deserialised be all nodes.
|
* 3) This packet is only serialised once at post time, typically it is deserialised by all nodes.
|
||||||
*/
|
*/
|
||||||
|
class gmxp::link
|
||||||
|
{
|
||||||
|
uint32_t linktype;
|
||||||
|
gxp::id msgId;
|
||||||
|
}
|
||||||
|
|
||||||
class gmxp::msg
|
class gmxp::msg
|
||||||
{
|
{
|
||||||
@ -70,15 +105,23 @@ class gmxp::msg
|
|||||||
gxp::id origMsgId; /* if a replacement msg, otherwise == msgId */
|
gxp::id origMsgId; /* if a replacement msg, otherwise == msgId */
|
||||||
gxp::id replacingMsgId; /* if a replacement msg, otherwise == NULL (for ordering) */
|
gxp::id replacingMsgId; /* if a replacement msg, otherwise == NULL (for ordering) */
|
||||||
|
|
||||||
uint32_t type; /* FORUM, CHANNEL, EVENT, COMMENT, VOTE, etc */
|
uint32_t msgtype; /* FORUM, CHANNEL, EVENT, COMMENT, VOTE, etc */
|
||||||
uint32_t flags; /* Is this needed? */
|
uint32_t flags; /* Is this needed? */
|
||||||
uint32_t timestamp;
|
uint32_t timestamp;
|
||||||
|
|
||||||
|
// New extensions - put these in the generic message, so we can handle search / linking for all services.
|
||||||
|
std::list<std::string> hashtags;
|
||||||
|
std::list<gmxp::link> linked;
|
||||||
|
|
||||||
gpp::permissions msgPermissions;
|
gpp::permissions msgPermissions;
|
||||||
|
|
||||||
gxip::signset signatures;
|
gxip::signset signatures; // should this be a set, or a singleton?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class gmxp::group: public gxp::group
|
||||||
|
{
|
||||||
|
???
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/******
|
/******
|
||||||
@ -93,6 +136,45 @@ class gmxp::msg
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* General Interface class which is extended by specific versions.
|
||||||
|
*
|
||||||
|
* This provides most of the generic search, and access functions.
|
||||||
|
* As we are going to end up with diamond style double inheritance.
|
||||||
|
* This function needs to be pure virtual.. so there is no disambiugation issues.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class rsGmxp
|
||||||
|
{
|
||||||
|
/* create content */
|
||||||
|
std::string createGroup(std::wstring name, std::wstring desc, uint32_t flags, unsigned char *pngImageData, uint32_t imageSize);
|
||||||
|
std::string publishMsg(RsDistribMsg *msg, bool personalSign);
|
||||||
|
|
||||||
|
/* indicate interest in info */
|
||||||
|
bool subscribeToGroup(const std::string &grpId, bool subscribe);
|
||||||
|
|
||||||
|
/* search messages (TO DEFINE) */
|
||||||
|
|
||||||
|
/* extract messages (From p3Distrib Existing Methods) */
|
||||||
|
|
||||||
|
bool getAllGroupList(std::list<std::string> &grpids);
|
||||||
|
bool getSubscribedGroupList(std::list<std::string> &grpids);
|
||||||
|
bool getPublishGroupList(std::list<std::string> &grpids);
|
||||||
|
void getPopularGroupList(uint32_t popMin, uint32_t popMax, std::list<std::string> &grpids);
|
||||||
|
|
||||||
|
bool getAllMsgList(const std::string& grpId, std::list<std::string> &msgIds);
|
||||||
|
bool getParentMsgList(const std::string& grpId,
|
||||||
|
const std::string& pId, std::list<std::string> &msgIds);
|
||||||
|
bool getTimePeriodMsgList(const std::string& grpId, uint32_t timeMin,
|
||||||
|
uint32_t timeMax, std::list<std::string> &msgIds);
|
||||||
|
|
||||||
|
GroupInfo *locked_getGroupInfo(const std::string& grpId);
|
||||||
|
RsDistribMsg *locked_getGroupMsg(const std::string& grpId, const std::string& msgId);
|
||||||
|
|
||||||
|
void getGrpListPubKeyAvailable(std::list<std::string>& grpList);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class p3gmxp
|
class p3gmxp
|
||||||
{
|
{
|
||||||
p3gmxp(int serviceType, serialiser *);
|
p3gmxp(int serviceType, serialiser *);
|
||||||
|
@ -138,7 +138,7 @@ class gxmp::group
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class gxmp::signedmsg
|
class gxp::signedmsg
|
||||||
{
|
{
|
||||||
gxp::id groupId; /* high level groupings, e.g. specific forum, channel, or twitter user, etc. */
|
gxp::id groupId; /* high level groupings, e.g. specific forum, channel, or twitter user, etc. */
|
||||||
gxp::id msgId; /* unique msgId within that group, normally signature of the message */
|
gxp::id msgId; /* unique msgId within that group, normally signature of the message */
|
||||||
@ -154,16 +154,22 @@ class gxmp::signedmsg
|
|||||||
|
|
||||||
class gdp::interface
|
class gdp::interface
|
||||||
{
|
{
|
||||||
|
/* query for available groups & messages */
|
||||||
|
int listgroups(std::list<gdb::id> &grpIds);
|
||||||
|
/* response from listmsgs: -1 = invalid parameters, 0 = incomplete list, 1 = all known msgs */
|
||||||
|
int listmsgs(const gdp::id grpId, std::list<gdb::id> &msgIds, const time_t from, const time_t to, const int maxmsgs);
|
||||||
|
|
||||||
/* very basic interface */
|
/* response from requestMsg: YES (available immediately), RETRIEVING (known to exist),
|
||||||
|
* IN_REQUEST (might exist), NOT_AVAILABLE (still might exist)
|
||||||
/* response from requestMsg: YES (available immediately, RETRIEVING (known to exist), IN_REQUEST (might exist), NOT_AVAILABLE (still might exist)
|
|
||||||
* NB: NOT_AVAILABLE could mean that it will be retrievable later when other peers come online, or possibilly we are not allowed it.
|
* NB: NOT_AVAILABLE could mean that it will be retrievable later when other peers come online, or possibilly we are not allowed it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int requestMsg(gdp::id groupId, gdp::id msgId, double &delay);
|
int requestMsg(gdp::id groupId, gdp::id msgId, double &delay);
|
||||||
int getMsg(gdp::id groupId, gdp::id msgId, gdp::message &msg);
|
int getMsg(gdp::id groupId, gdp::id msgId, gdp::message &msg);
|
||||||
int storeMsg(const gdp::message &msg);
|
int storeMsg(const gdp::message &msg);
|
||||||
|
|
||||||
|
/* search interface, is it here? or next level up */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
50
libretroshare/src/gxs/db_wire.h
Normal file
50
libretroshare/src/gxs/db_wire.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
#include "gxp_service.h"
|
||||||
|
|
||||||
|
class db_wire
|
||||||
|
{
|
||||||
|
/* external interface for accessing the info */
|
||||||
|
|
||||||
|
/** Note this could get very busy with a large number of tweeters.
|
||||||
|
* need some other method of getting data
|
||||||
|
*/
|
||||||
|
|
||||||
|
getTweeters(std::list<std::string> &tweeterIds);
|
||||||
|
{
|
||||||
|
getGroups();
|
||||||
|
}
|
||||||
|
|
||||||
|
getTweetRange(GxpTimeStamp, GxpTimeStamp, std::list<std::string> &tweetIds);
|
||||||
|
{
|
||||||
|
getTimeRange();
|
||||||
|
}
|
||||||
|
|
||||||
|
getTweetRangeSource(GxpTimeStamp, GxpTimeStamp, std::string tweeterId, std::list<std::string> &tweetIds);
|
||||||
|
{
|
||||||
|
getGroupTimeRange();
|
||||||
|
}
|
||||||
|
|
||||||
|
getTweet(std::string id, TweetData &tweet);
|
||||||
|
{
|
||||||
|
StackLock();
|
||||||
|
|
||||||
|
RsGxpItem *getMsg_locked(id);
|
||||||
|
|
||||||
|
// translate message into TweetData.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default
|
||||||
|
getProfile(std::string id, TweetData &tweet);
|
||||||
|
|
||||||
|
/* returns a search code, which is used to id later delivery */
|
||||||
|
int searchTweets(GxpSearchCondition cond, std::list<std::string>);
|
||||||
|
|
||||||
|
/* returns a search code, which is used to id later delivery */
|
||||||
|
int fetchPendingSearchResults(int searchId, std::list<std::string>);
|
||||||
|
|
||||||
|
int cancelSearch(int searchId, std::list<std::string>);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user