Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsFsTreeConsultation.h
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsFsTreeConsultation.h
4  *
5  * Description:
6  *
7  * Created: 03/21/2013 04:04:50 AM
8  * Revision: none
9  *
10  * Author: Benoit Daccache (BD), ben.daccache@gmail.com
11  * Company:
12  *
13  */
14 
15 #ifndef WS_FSTREE_CONSULTATION_H__
16 #define WS_FSTREE_CONSULTATION_H__
17 
18 #include <Tree/WsAccessTree.h>
19 #include <Search/WsResultItem.h>
21 
22 #include <boost/thread/mutex.hpp>
23 
28 
29 public:
30 
36 
40  int getPermissions( const std::set<std::string>& groups, const std::string& p) ;
41 
45  WsNodeProperties* getProperties ( const std::set<std::string>& groups, const std::string& p) ;
46 
50  std::string getProperty( const std::set<std::string>& groups, const std::string& section, const std::string& p, const std::string& prop) ;
51 
55  int getLock(const std::set<std::string> groups, const std::string& uid, const std::string& path);
56 
60  int putLock(const std::set<std::string> groups, const std::string& uid, const std::string& path);
61 
65  int isLocked(const std::set<std::string> groups, const std::string& uid, const std::string& path, std::string& id);
66 
70  WsAccessTree* getAccessTree( const std::set<std::string>& groups) ;
71 
75  std::vector<WsResultItem> getSearchResults( const std::set<std::string>& groups, const std::string& terms) ;
76  const std::string getRootPath() ;
77 
81  std::vector<std::string> getTemplatesList( const std::set<std::string>& groups, const std::string& path) ;
82 
88  const std::string& getFsTreeStamp();
89 
90 private:
93  boost::mutex m_lockEditMutex;
94 
95  long getTimeMs();
96 
97 
98 };
99 
100 
101 
102 #endif
Reprensents the menu tree of a group. If a group does not have access to a Node, this Node will not s...
const std::string & getFsTreeStamp()
Get the stamp of the last WsFileSystemTree.
std::vector< std::string > getTemplatesList(const std::set< std::string > &groups, const std::string &path)
TODO.
WsGlobalProperties * m_conf
Global properties class.
WsFsTreeUpdater * m_updater
std::vector< WsResultItem > getSearchResults(const std::set< std::string > &groups, const std::string &terms)
Get the results for searching for "terms".
WsNodeProperties * getProperties(const std::set< std::string > &groups, const std::string &p)
get properties of a node corresponding to the path
Reprensents an access tree.
Definition: WsAccessTree.h:24
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...
Properties of a WsNode.
handles the update of the FileSystemTree
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...
const std::string getRootPath()
WsFsTreeConsultation(WsFsTreeUpdater *updater)
Constructor.
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
int getPermissions(const std::set< std::string > &groups, const std::string &p)
Get the permissions for a path for a set of groups.
WsAccessTree * getAccessTree(const std::set< std::string > &groups)
Get the access tree starting from rootPath.
Updates the tree and takes care of unconsistencies with the user.
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
Encapsulates consultation of tree (no modification)