cancel
Showing results for 
Search instead for 
Did you mean: 

fileFolderservice VS nodeService

mrsaqib
Champ in-the-making
Champ in-the-making
I am very confused in fileFolderService,  nodeService and searchService. for example:

nodeService.createNode    VS  fileFolderService.create

nodeService.deleteNode    VS  fileFolderService.delete

and similarly

fileFolderService.searchSimple   VS  searchService.query

Can any one please explain or is there any reference book or article available on internet?

Regards
8 REPLIES 8

lotharmärkle
Champ in-the-making
Champ in-the-making
As far as I understood, the fileFolderService tries to make the alfresco developers life a litte bit easier. It is basicly a wrapper around the nodeService methods regarding tasks that have to do with file and folders: create files, remove files, lookup files by filename and the like.

Regards,
  lothar

mitpatoliya
Star Collaborator
Star Collaborator
Yes,exactly Its like if you are manipulating the node which is irrespective of file of folder then you should use nodeservice.
Each file and folder are node after all.
Where if you are working at file folder lever where you need to have APIs for listing all the files under folder etc. you have to use FileFolderservice.
So,Its self explanatory names given by alfresco to all those services.

mrsaqib
Champ in-the-making
Champ in-the-making
Yes,exactly Its like if you are manipulating the node which is irrespective of file of folder then you should use nodeservice.
Each file and folder are node after all.
Where if you are working at file folder lever where you need to have APIs for listing all the files under folder etc. you have to use FileFolderservice.
So,Its self explanatory names given by alfresco to all those services.


Thanks, but both the statements

nodeService.createNode AND  fileFolderService.create

both creates a node eventually in alfresco, am i right.?

lotharmärkle
Champ in-the-making
Champ in-the-making
both creates a node eventually in alfresco, am i right.?

…they do for sure! :wink:

mrsaqib
Champ in-the-making
Champ in-the-making
both creates a node eventually in alfresco, am i right.?

…they do for sure! :wink:


Then whats the difference ? Smiley Happy
which is better to use?

mitpatoliya
Star Collaborator
Star Collaborator
in nodeservice create API you can also pass the property map which will be attached to the newly created node.
It will be more clear once you start using those services and APIs.
nodeservice is more of a lower level service then filefolderservice.

mrogers
Star Contributor
Star Contributor
In general you should use the FileFolder service.   Only drop down to the lower level Node service if you are doing something special.

mrsaqib
Champ in-the-making
Champ in-the-making
In general you should use the FileFolder service.   Only drop down to the lower level Node service if you are doing something special.


Thanks