Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
WsAbstractFsClient Class Referenceabstract

Abstract Interface between the WsUser class and the operation on the tree. More...

#include <WsAbstractFsClient.h>

Inheritance diagram for WsAbstractFsClient:
Inheritance graph
Collaboration diagram for WsAbstractFsClient:
Collaboration graph

Public Member Functions

virtual ~WsAbstractFsClient ()
 
virtual int load ()=0
 loads the user info More...
 
virtual int getPermissions (const std::string &p)=0
 Load infos of the user. More...
 
virtual const WsNodePropertiesgetProperties (const std::string &p)=0
 return the permissions on specific node More...
 
virtual std::string getProperty (const std::string &section, const std::string &p, const std::string &prop)=0
 returns the properties of a node More...
 
virtual const std::string & getSurname () const =0
 return the surname of the person More...
 
virtual const std::string & getFirstName () const =0
 return the name of the person More...
 
virtual const std::string & getEmail () const =0
 return the email of the person More...
 
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 because is detented by someone else. ErrorCode::Failure if an error occured. ErrorCode::NotFound if the path does not exist and a positive value with the duration in seconds of the lock is returned otherwise. More...
 
virtual int putLock (const std::string &path)=0
 releases the lock for the path. More...
 
virtual int isLocked (const std::string &path, std::string &uid)=0
 check is the path is already locked More...
 
virtual NodePtr getAccessRoot (const bool &forceUpdate=false)=0
 return the root node of the access tree starting from the root More...
 
virtual std::vector< WsResultItemgetSearchResults (const std::string &terms)=0
 search for all matching results of terms using WsSearch class More...
 
virtual std::set< string > getAllGroups ()=0
 
virtual const std::string getRootPath ()=0
 return the root path of the filesystem tree, example : /var/www/demo_site More...
 
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. More...
 
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. More...
 
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 and the editor who created the node More...
 
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, all the contents of the directory and the directory will be deleted More...
 
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 moved More...
 
virtual bool isAdministrator ()=0
 
virtual bool isEditor ()=0
 
virtual std::vector< std::string > getTemplatesList (const std::string &path)=0
 

Detailed Description

Abstract Interface between the WsUser class and the operation on the tree.

Definition at line 26 of file WsAbstractFsClient.h.

Constructor & Destructor Documentation

WsAbstractFsClient::~WsAbstractFsClient ( )
virtual

Definition at line 16 of file WsAbstractFsClient.cpp.

Member Function Documentation

virtual int WsAbstractFsClient::createNode ( const string &  path,
int  type 
)
pure virtual

create a directory or File. If the node is a WsDirNode than it will be only accessible to the Admin and the editor who created the node

Parameters
paththe relative path starting from root
typea NodeType enum { File, Directory }
Returns
ErrorCode::Success if ok, ErrorCode::NotFound if path is not found, ErrorCode::NoAccess if access denied and ErrorCode::Failure otherwise

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::deleteNode ( const string &  path)
pure virtual

delete a node. The user must be an Admin on editor to remove the node In case of a WsDirNode, all the contents of the directory and the directory will be deleted

Parameters
paththe path to the node
Returns
ErrorCode::Success if ok, ErrorCode::NotFound if path is not found, ErrorCode::NoAccess if access denied and ErrorCode::Failure otherwise

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual NodePtr WsAbstractFsClient::getAccessRoot ( const bool &  forceUpdate = false)
pure virtual

return the root node of the access tree starting from the root

Returns
NULL if the path is incorrect or if the user does not have access rights to it otherwise a NodePtr to the rootNode is returned

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual std::set<string> WsAbstractFsClient::getAllGroups ( )
pure virtual

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual const std::string& WsAbstractFsClient::getEmail ( ) const
pure virtual

return the email of the person

Returns
the email or an empty string if not found

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual const std::string& WsAbstractFsClient::getFirstName ( ) const
pure virtual

return the name of the person

Returns
the name or an empty string if not found

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::getLock ( const std::string &  path)
pure virtual

tries to acquire the lock for the path. @ return ErrorCode::Locked if the lock cannot be aquired because is detented by someone else. ErrorCode::Failure if an error occured. ErrorCode::NotFound if the path does not exist and a positive value with the duration in seconds of the lock is returned otherwise.

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::getPermissions ( const std::string &  p)
pure virtual

Load infos of the user.

Loads the name, surname, email, groups ..

Returns
ErrorCode::Success if load is completed successfully, ErrorCode::Failure otherwise

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual const WsNodeProperties* WsAbstractFsClient::getProperties ( const std::string &  p)
pure virtual

return the permissions on specific node

Parameters
pthe node path (relative)
Returns
GlobalConfig::Read if only read GlobalConfig::ReadWrite if read write perm or ErrorCode::NoAccess
ErrorCode::NotFound if path not found

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual std::string WsAbstractFsClient::getProperty ( const std::string &  section,
const std::string &  p,
const std::string &  prop 
)
pure virtual

returns the properties of a node

Parameters
pthe path to the node
Returns
a NodePtr containing a WsAbstractNode

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual const std::string WsAbstractFsClient::getRootPath ( )
pure virtual

return the root path of the filesystem tree, example : /var/www/demo_site

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual std::vector<WsResultItem> WsAbstractFsClient::getSearchResults ( const std::string &  terms)
pure virtual

search for all matching results of terms using WsSearch class

Parameters
termsthe terms to match results where found or if an error occured during the process.
Returns
a vector containing the results as WsResultItem or an empty vector if no results found

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual const std::string& WsAbstractFsClient::getSurname ( ) const
pure virtual

return the surname of the person

Returns
the surname or an empty string if not found

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual std::vector<std::string> WsAbstractFsClient::getTemplatesList ( const std::string &  path)
pure virtual

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual bool WsAbstractFsClient::isAdministrator ( )
pure virtual

Returns
true if the actual user is an admin

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual bool WsAbstractFsClient::isEditor ( )
pure virtual

Returns
true if actual user is an editor

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::isLocked ( const std::string &  path,
std::string &  uid 
)
pure virtual

check is the path is already locked

Returns
1 if the path is unlocked
ErrorCode::Locked if the file is locked and the uid of the user who locked it will be stored in uid
ErrorCode::NotFound if the path does not exist
ErrorCode::Failure if an error occured

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::load ( )
pure virtual

loads the user info

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::putLock ( const std::string &  path)
pure virtual

releases the lock for the path.

Returns
ErrorCode::Locked if path cannot be unlocked, ErrorCode::Failure if error. ErrorCode::NotFound if the path does not exist and ErrorCode::Success if unlock successful

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::renameNode ( const string &  path,
const string &  newPath 
)
pure virtual

renames a node In case of a WsDirNode, all the contents of the directory and the directory will be moved

Parameters
paththe path to the node from the root
newPathnew path from the root
Returns
ErrorCode::Success if ok, ErrorCode::NotFound if path is not found, ErrorCode::NoAccess if access denied and ErrorCode::Failure otherwise

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::saveProperties ( WsNodeProperties props,
const std::string &  path 
)
pure virtual

save the properties of the node on disk. The user must have access and edit rights for the node.

Parameters
propsthe properties to save
paththe path to the node (relative path)
Returns
ErrorCode::Success if ok, ErrorCode::NotFound if path is not found, ErrorCode::NoAccess if access denied and ErrorCode::Failure otherwise

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:

virtual int WsAbstractFsClient::saveProperty ( const std::string &  path,
const std::string &  section,
const std::string &  attr,
const std::string &  val 
)
pure virtual

sets one property of the node and save it on disk.

Parameters
paththe path to the node (relative path)
sectionthe section of the property
attrthe key of the property
valthe value to set
Returns
ErrorCode::Success if ok, ErrorCode::NotFound if path is not found, ErrorCode::NoAccess if access denied and ErrorCode::Failure otherwise

Implemented in WsFsDaemonClient, and WsFsTreeClient.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: