Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsFsTreeOperations.h
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsFsTreeOperations.cpp
4  *
5  * Description:
6  *
7  * Created: 31/03/13 15:33:40
8  *
9  * Author: Benoit Daccache, ben.daccache@gmail.com
10  *
11  */
12 
13 #ifndef WS_FSTREE_OPERATIONS
14 #define WS_FSTREE_OPERATIONS
15 
16 #include <Tree/WsAccessTree.h>
17 #include <Search/WsResultItem.h>
18 #include "WsFsTreeConsultation.h"
19 #include "WsFsTreeModification.h"
20 
21 
29 
30 public:
32 
33 
42  int getPermissions( const std::set<std::string>& groups, const std::string& p) ;
43 
44 
53  WsNodeProperties* getProperties ( const std::set<std::string>& groups, const std::string& p) ;
54 
65  std::string getProperty( const std::set<std::string>& groups, const std::string& section, const std::string& p, const std::string& prop) ;
66 
77  int getLock(const std::set<std::string> groups, const std::string& uid, const std::string& path);
78 
90  int putLock(const std::set<std::string> groups, const std::string& uid, const std::string& path);
91 
102  int isLocked(const std::set<std::string> groups, const std::string& uid, const std::string& path, std::string& id);
103 
112  WsAccessTree* getAccessTree( const std::set<std::string>& groups) ;
113 
122  std::vector<WsResultItem> getSearchResults( const std::set<std::string>& groups, const std::string& terms) ;
123  const std::string getRootPath() ;
124 
133  std::vector<std::string> getTemplatesList( const std::set<std::string>& groups, const std::string& path) ;
134 
144  int saveProperties( const std::set<std::string>& groups, const std::string& json, const std::string& path) ;
145 
157  int saveProperty( const std::set<std::string>& groups, const std::string& path, const std::string& section, const std::string& attr, const std::string& val) ;
158 
169  int createNode( const std::set<std::string>& groups, const std::string& uid, const string& path, int type) ;
170 
180  int deleteNode( const std::set<std::string>& groups, const std::string& uid, const string& path) ;
181 
192  int renameNode( const std::set<std::string>& groups, const std::string& uid, const string& path, const string& newPath) ;
193 
194 
199  bool isAdministrator( const std::set<std::string>& groups);
200 
205  bool isEditor( const std::set<std::string>& groups );
206 
212  int update();
213 
219  const std::string& getFsTreeStamp();
220 
221 private:
226 
227 };
228 
229 #endif
WsFsTreeModification * m_modification
Reprensents the menu tree of a group. If a group does not have access to a Node, this Node will not s...
int putLock(const std::set< std::string > groups, const std::string &uid, const std::string &path)
unlocks the file by deleting the .config/locks/filename.lock file Only the owner of the lock can unlo...
std::string getProperty(const std::set< std::string > &groups, const std::string &section, const std::string &p, const std::string &prop)
get a property for a node corresponding to the path
Global properties class.
int saveProperty(const std::set< std::string > &groups, const std::string &path, const std::string &section, const std::string &attr, const std::string &val)
save a property of the node. The user must have access and edit rights for the node.
int saveProperties(const std::set< std::string > &groups, const std::string &json, const std::string &path)
save the properties of the node. The user must have access and edit rights for the node...
Redirect operations to adequate class.
Reprensents an access tree.
Definition: WsAccessTree.h:24
Properties of a WsNode.
WsAccessTree * getAccessTree(const std::set< std::string > &groups)
Get the access tree starting from rootPath.
handles the update of the FileSystemTree
std::vector< WsResultItem > getSearchResults(const std::set< std::string > &groups, const std::string &terms)
Get the results for searching for "terms".
WsFsTreeConsultation * m_consultation
int renameNode(const std::set< std::string > &groups, const std::string &uid, const string &path, const string &newPath)
renames a node
int getLock(const std::set< std::string > groups, const std::string &uid, const std::string &path)
tries to acquire the lock for the path. @ return ErrorCode::Locked if the lock cannot be aquired beca...
WsNodeProperties * getProperties(const std::set< std::string > &groups, const std::string &p)
get properties of a node corresponding to the path
int getPermissions(const std::set< std::string > &groups, const std::string &p)
Get the permissions for a path for a set of groups.
Encapsulates modification operations on tree.
int deleteNode(const std::set< std::string > &groups, const std::string &uid, const string &path)
delete a node. The user must be an Admin on editor to remove the node
int isLocked(const std::set< std::string > groups, const std::string &uid, const std::string &path, std::string &id)
check is the path is already locked
bool isAdministrator(const std::set< std::string > &groups)
const std::string & getFsTreeStamp()
Get the stamp of the last WsFileSystemTree.
const std::string getRootPath()
WsFsTreeUpdater * m_updater
WsGlobalProperties * m_conf
bool isEditor(const std::set< std::string > &groups)
int createNode(const std::set< std::string > &groups, const std::string &uid, const string &path, int type)
create a directory or File. If the node is a WsDirNode than it will be only accessible to the Admin a...
std::vector< std::string > getTemplatesList(const std::set< std::string > &groups, const std::string &path)
TODO.
Encapsulates consultation of tree (no modification)
int update()
Update the WsFileSystemTree.