Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsAbstractFsClient.h
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsAbstractFsClient.h
4  *
5  * Description: File System Tree client
6  *
7  * Version: 1.0
8  * Created: 07/25/2011 04:11:48 PM
9  *
10  */
11 
12 
13 #ifndef WS_ABSTRACT_FSCLIENT_H__
14 #define WS_ABSTRACT_FSCLIENT_H__
15 #include <iostream>
16 #include <vector>
17 
20 #include <Logger/WsLogger.h>
21 #include <Search/WsResultItem.h>
22 
27 public:
28 
29  virtual ~WsAbstractFsClient();
30 
34  virtual int load() = 0;
38  virtual int getPermissions(const std::string& p) = 0;
42  virtual const WsNodeProperties* getProperties (const std::string& p) = 0;
43 
47  virtual std::string getProperty(const std::string& section, const std::string& p, const std::string& prop) = 0;
48 
52  virtual const std::string& getSurname() const = 0;
53 
57  virtual const std::string& getFirstName() const = 0;
58 
62  virtual const std::string& getEmail() const = 0;
63 
67  virtual int getLock(const std::string& path) = 0;
68 
72  virtual int putLock(const std::string& path) = 0;
73 
77  virtual int isLocked(const std::string& path, std::string& uid) = 0;
78 
82  virtual NodePtr getAccessRoot( const bool& forceUpdate = false) = 0;
83 
87  virtual std::vector<WsResultItem> getSearchResults(const std::string& terms) = 0;
88 
92  virtual std::set<string> getAllGroups() = 0;
93 
97  virtual const std::string getRootPath() = 0;
98 
102  virtual int saveProperties(WsNodeProperties* props, const std::string& path) = 0;
103 
107  virtual int saveProperty(const std::string& path, const std::string& section, const std::string& attr, const std::string& val) = 0;
108 
112  virtual int createNode(const string& path, int type) = 0;
113 
117  virtual int deleteNode(const string& path) = 0;
118 
122  virtual int renameNode(const string& path, const string& newPath) = 0;
123 
127  virtual bool isAdministrator() = 0;
128 
132  virtual bool isEditor() = 0;
133 
137  virtual std::vector<std::string> getTemplatesList(const std::string& path) = 0;
138 
139 
140 };
141 
142 #endif
boost::shared_ptr< WsAbstractNode > NodePtr
virtual std::vector< WsResultItem > getSearchResults(const std::string &terms)=0
search for all matching results of terms using WsSearch class
virtual bool isEditor()=0
virtual const WsNodeProperties * getProperties(const std::string &p)=0
return the permissions on specific node
virtual NodePtr getAccessRoot(const bool &forceUpdate=false)=0
return the root node of the access tree starting from the root
Properties of a WsNode.
virtual int putLock(const std::string &path)=0
releases the lock for the path.
virtual std::string getProperty(const std::string &section, const std::string &p, const std::string &prop)=0
returns the properties of a node
virtual int isLocked(const std::string &path, std::string &uid)=0
check is the path is already locked
virtual int getLock(const std::string &path)=0
tries to acquire the lock for the path. @ return ErrorCode::Locked if the lock cannot be aquired beca...
virtual int renameNode(const string &path, const string &newPath)=0
renames a node In case of a WsDirNode, all the contents of the directory and the directory will be mo...
virtual int saveProperties(WsNodeProperties *props, const std::string &path)=0
save the properties of the node on disk. The user must have access and edit rights for the node...
virtual int saveProperty(const std::string &path, const std::string &section, const std::string &attr, const std::string &val)=0
sets one property of the node and save it on disk.
virtual std::set< string > getAllGroups()=0
virtual int createNode(const string &path, int type)=0
create a directory or File. If the node is a WsDirNode than it will be only accessible to the Admin a...
virtual int load()=0
loads the user info
Abstract Interface between the WsUser class and the operation on the tree.
virtual bool isAdministrator()=0
virtual std::vector< std::string > getTemplatesList(const std::string &path)=0
virtual int getPermissions(const std::string &p)=0
Load infos of the user.
virtual const std::string getRootPath()=0
return the root path of the filesystem tree, example : /var/www/demo_site
virtual const std::string & getSurname() const =0
return the surname of the person
Abstract Node class.
virtual const std::string & getFirstName() const =0
return the name of the person
virtual const std::string & getEmail() const =0
return the email of the person
virtual int deleteNode(const string &path)=0
delete a node. The user must be an Admin on editor to remove the node In case of a WsDirNode...