C# Class DrutNET.Services

enable to connect to drupal services using XML RPC
Inheritance: DrutNETBase, IConnection
Afficher le fichier Open project: bricel/DrutNet Class Usage Examples

Méthodes publiques

Méthode Description
AttachFileToNode ( string fileFieldName, int fid, int fileIndex, CookComputing.XmlRpc.XmlRpcStruct node ) : bool

Add an already upload file to cck file field, without saving the node

AttachFileToNode ( string fileFieldName, int fid, int fileIndex, int nid ) : bool

Add an already upload file to cck file field, also saving node

FileGet ( int fid ) : CookComputing.XmlRpc.XmlRpcStruct

Get file structure information

FileSave ( string filePath, string serverPath ) : string

Save file structure

FileUpload ( string filePath, string fieldName, int fileIndex, int nodeID ) : bool
FileUpload ( string filePath, string fieldName, int fileIndex, int nodeID, string serverDirectory ) : bool

Upload and attach a file to an existing NODE.

Login ( string user, string password ) : bool
Login ( string user, string password, string debugURL ) : bool
Logout ( ) : bool
NodeGet ( int nid ) : CookComputing.XmlRpc.XmlRpcStruct

Return node structure

NodeGet ( int nid, string fields ) : XmlRpcStruct
NodeSave ( XmlRpcStruct node ) : int
OGgetVocab ( int ogID ) : XmlRpcStruct
ParseField ( Enum fieldName, XmlRpcStruct nodeStruct ) : string
ParseField ( Enum fieldName, XmlRpcStruct nodeStruct, int arrayIndex ) : string
ParseField ( string fieldName, XmlRpcStruct nodeStruct ) : string
ParseFieldArray ( Enum arrayfieldName, Enum fieldName, XmlRpcStruct parentStruct ) : string
ReLogin ( ) : bool
Services ( ServicesSettings settings ) : System

Single Tone constructor

TaxonomyGetTree ( int vid ) : XmlRpcStruct[]
UserGet ( ) : XmlRpcStruct

Get logged in user information

UserGet ( int nid ) : XmlRpcStruct
ViewsGet ( string viewName, int limit ) : XmlRpcStruct[]
ViewsGet ( string viewName, int limit, object args ) : XmlRpcStruct[]
ViewsGet ( string viewName, string args ) : XmlRpcStruct[]

Private Methods

Méthode Description
GetHMAC ( string message, string key ) : string
GetNonce ( int length ) : string
GetUnixTimestamp ( ) : string
buildFileStruct ( string filePath, string serverPath ) : XmlRpcStruct

Create a drupal file structure

errorMessage ( string msg ) : void
handleExeption ( Exception ex ) : XmlRpcStruct
handleExeption ( Exception ex, string functionName ) : XmlRpcStruct
handleExeptionStr ( Exception ex, string functionName ) : string

Method Details

AttachFileToNode() public méthode

Add an already upload file to cck file field, without saving the node
public AttachFileToNode ( string fileFieldName, int fid, int fileIndex, CookComputing.XmlRpc.XmlRpcStruct node ) : bool
fileFieldName string CCK field name
fid int File ID to attach
fileIndex int file index in case of multiple file field, for single file use 0
node CookComputing.XmlRpc.XmlRpcStruct Node to attach file to (alresdy load with node load)
Résultat bool

AttachFileToNode() public méthode

Add an already upload file to cck file field, also saving node
public AttachFileToNode ( string fileFieldName, int fid, int fileIndex, int nid ) : bool
fileFieldName string CCK field name
fid int File ID to attach
fileIndex int file index in case of multiple file field, for single file use 0
nid int
Résultat bool

FileGet() public méthode

Get file structure information
public FileGet ( int fid ) : CookComputing.XmlRpc.XmlRpcStruct
fid int file id
Résultat CookComputing.XmlRpc.XmlRpcStruct

FileSave() public méthode

Save file structure
public FileSave ( string filePath, string serverPath ) : string
filePath string
serverPath string
Résultat string

FileUpload() public méthode

public FileUpload ( string filePath, string fieldName, int fileIndex, int nodeID ) : bool
filePath string
fieldName string
fileIndex int
nodeID int
Résultat bool

FileUpload() public méthode

Upload and attach a file to an existing NODE.
public FileUpload ( string filePath, string fieldName, int fileIndex, int nodeID, string serverDirectory ) : bool
filePath string Local path to file
fieldName string CCK field name of the file field in the node
fileIndex int file index in case of multiple file field, for single file use 0
nodeID int Node ID to attache file to
serverDirectory string Server directory path e.g: sites/default/files/
Résultat bool

Login() public méthode

public Login ( string user, string password ) : bool
user string
password string
Résultat bool

Login() public méthode

public Login ( string user, string password, string debugURL ) : bool
user string
password string
debugURL string
Résultat bool

Logout() public méthode

public Logout ( ) : bool
Résultat bool

NodeGet() public méthode

Return node structure
public NodeGet ( int nid ) : CookComputing.XmlRpc.XmlRpcStruct
nid int Node ID
Résultat CookComputing.XmlRpc.XmlRpcStruct

NodeGet() public méthode

public NodeGet ( int nid, string fields ) : XmlRpcStruct
nid int
fields string
Résultat XmlRpcStruct

NodeSave() public méthode

public NodeSave ( XmlRpcStruct node ) : int
node XmlRpcStruct
Résultat int

OGgetVocab() public méthode

public OGgetVocab ( int ogID ) : XmlRpcStruct
ogID int
Résultat XmlRpcStruct

ParseField() public méthode

public ParseField ( Enum fieldName, XmlRpcStruct nodeStruct ) : string
fieldName Enum
nodeStruct XmlRpcStruct
Résultat string

ParseField() public méthode

public ParseField ( Enum fieldName, XmlRpcStruct nodeStruct, int arrayIndex ) : string
fieldName Enum
nodeStruct XmlRpcStruct
arrayIndex int
Résultat string

ParseField() public méthode

public ParseField ( string fieldName, XmlRpcStruct nodeStruct ) : string
fieldName string
nodeStruct XmlRpcStruct
Résultat string

ParseFieldArray() public méthode

public ParseFieldArray ( Enum arrayfieldName, Enum fieldName, XmlRpcStruct parentStruct ) : string
arrayfieldName Enum
fieldName Enum
parentStruct XmlRpcStruct
Résultat string

ReLogin() public méthode

public ReLogin ( ) : bool
Résultat bool

Services() public méthode

Single Tone constructor
public Services ( ServicesSettings settings ) : System
settings ServicesSettings
Résultat System

TaxonomyGetTree() public méthode

public TaxonomyGetTree ( int vid ) : XmlRpcStruct[]
vid int
Résultat XmlRpcStruct[]

UserGet() public méthode

Get logged in user information
public UserGet ( ) : XmlRpcStruct
Résultat XmlRpcStruct

UserGet() public méthode

public UserGet ( int nid ) : XmlRpcStruct
nid int
Résultat XmlRpcStruct

ViewsGet() public méthode

public ViewsGet ( string viewName, int limit ) : XmlRpcStruct[]
viewName string
limit int
Résultat XmlRpcStruct[]

ViewsGet() public méthode

public ViewsGet ( string viewName, int limit, object args ) : XmlRpcStruct[]
viewName string
limit int
args object
Résultat XmlRpcStruct[]

ViewsGet() public méthode

public ViewsGet ( string viewName, string args ) : XmlRpcStruct[]
viewName string
args string
Résultat XmlRpcStruct[]