16 #include <boost/lexical_cast.hpp>
26 refresh = boost::lexical_cast<
int>(m_conf->get(
"global",
"refresh_delay",
"30"));
29 }
catch (boost::bad_lexical_cast&) {
30 LOG(
ERROR) <<
"WsFsDaemon::bind() : Cannot cast refresh delay to int. Check conf value. Assuming delay is 3600s";
35 if (m_conf->get(
"global",
"monitoring",
"false") ==
"true")
40 m_updater =
new WsFsTreeUpdater(m_conf->get(
"global",
"root_path",
"."), refresh, monitoring);
49 return m_consultation->getPermissions(groups, p);
54 return m_consultation->getProperties(groups, p);
59 return m_consultation->getProperty(groups, section, p, prop);
64 return m_consultation->getLock(groups, uid, path);
69 return m_consultation->putLock(groups, uid, path);
74 return m_consultation->isLocked(groups, uid, path,
id);
79 return m_consultation->getAccessTree(groups);;
85 return m_consultation->getSearchResults(groups, terms);
91 return m_consultation->getRootPath();
96 return m_consultation->getTemplatesList(groups, path);
101 return m_modification->saveProperties(groups, json, path);
104 int WsFsTreeOperations::saveProperty(
const std::set<std::string>& groups,
const std::string& path,
const std::string& section,
const std::string& attr,
const std::string& val)
106 return m_modification->saveProperty(groups, path, section, attr, val);
111 return m_modification->createNode( groups, uid, path, type);
116 return m_modification->deleteNode(groups, uid, path);
121 return m_modification->renameNode(groups, uid, path, newPath);
126 return m_modification->isAdministrator(groups);
131 return m_modification->isEditor(groups);
136 return m_updater->update();
141 return m_consultation->getFsTreeStamp();
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 §ion, const std::string &p, const std::string &prop)
get a property for a node corresponding to the path
int saveProperty(const std::set< std::string > &groups, const std::string &path, const std::string §ion, 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...
Reprensents an access tree.
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".
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()
static WsGlobalProperties * instance()
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.