alfresco in few points - nodeservice tutorial
TRANSCRIPT
What’s this Flower ?
Services Tutorial
It’s Alfresco !
An Open Source ECM Solution
Where is the Problem ?
Curious people who want to understand Alfresco…
With lots of questions…(To express…)
A possible solution…
Simply a presenter with presentations about Alfresco
with a few answers… (To verify)
Let’s do it !
But before, don’t forget…
…THE principle…Everything is NODE
What a beautifulNode!!!
Now, let’s go!
OK, nodes are really cool… But what if I want to manage them ?
Let's explore the notion of service…
A Service ?
• Activity, carried out by someone or something, that serve a cause or help a person.
What kind of services does Alfresco offer ?
Services for managingNODES
Who are you to manage me ?
How to access
services?
With the Service Registry !
Service Registry ?
Yes ! THE service registry ! Introduction…
Alfreso Service Registry
…
OK…Explanation…
a registry ?• Official service or
place where you can find and call/use the services
• NB : an equivalent would be your phone book or directory!
Hello, I’m Alfresco Service Registry
I know and I have all Alfresco services !
I’m NodeService !
Me, My name is dictionnaryService !
I am…
I am…ActionService
AttributeServiceAuditService
AuthenticationServiceAuthorityService
AVMService
CategoryService
CheckOutCheckInService
ContentService
CopyService
DictionnaryService
FileFolderService
EditionService
ExporterServiceImporterService
MimeTypeService
MultilangualContentService
NodeService
LockService
RuleService
ScriptService
SearchService
TemplateService
TransactionServiceVersionService
WorkflowService
All right… Could you give us an example ?
The NodeService of course !
NodeService allows to…
Des propriétés
Des métadonnéesCREATE
NodeService allows to…
Des propriétés
Des métadonnéesSET
NodeService allows to…
Des propriétés
Des métadonnéesGET
NodeService allows to…
Des propriétés
Des métadonnéesDELETE
Properties
AssociationsNODES
Aspects
Let’s Practice
Calling Service Registry…
Calling NodeService…
NS
Using NodeService…
NS
Call me King of the Nodes
NS
My skills
CREATE
DELETE GET
SET
NS
On the first day, create a store
Workspace, SpaceStore
Yes, I am THE legendary RootNode!
ServiceRegistry.getNodeService.createStore(protocol,identifier)Java Code
TypeQname sys:store_root
Here you are, Junior!
ServiceRegistry.getNodeService.createNode(parentRef, assocTypeQname, assocQname, nodeTypeQname, properties)
Java Code
Daddy!!!TypeQname cm:foldercm:Name Alfrescocm:title Alfresco
AssocTypeQname cm:containsAssocQName app:company_home
NS
Next, create a node
ServiceRegistry.getNodeService.createNode(parentRef, assocTypeQname, assocQname, nodeTypeQname, properties)
Java Code
NS
Let’s go faster…
The proof in Alfresco!
Java Code
NS
Now, let’s take a closer look into it...
But before, don’t forget…
To identify and report a single node in a store, we
used…
UUID
The concatenation of the store protocol, store name and node UUID creates…
ANodeRef
ServiceRegistry.getNodeService.getStores ()Java Code
NS
So I was saying, let’s take a closer look!!!!!
Store
ServiceRegistry.getNodeService.getRootNode (StoreRef)Java Code
NS
I’m sure…Somebody’s
watching me…
Now, the root node !
RootNode
ServiceRegistry.getNodeService.getChildAssocs (NodeRef)Java Code
NS
Next, Childassociation…
ChildAssocs
ParentRef
ChildRef
ServiceRegistry.getNodeService.getChildAssocs(NodeRef)Java Code
NS
Another childAssociation…
ChildAssocs
0 1 2 3
ParentRef
ChildRef
ServiceRegistry.getNodeService.getParentAssocs(NodeRef)Java Code
NS
And if we look the other way round…
ParentAssocs
ParentRef
ChildRef
ServiceRegistry.getNodeService.getParentAssocs(NodeRef)Java Code
NS
Again… the other way round…
ParentAssocs
And me? I’m not enough interesting
for you ?
ServiceRegistry.getNodeService.getProperties(NodeRef)Java Code
NS
Now, let’s look at this presumptuous node in more details…
Properties
Finally !! My moment of glory !
ServiceRegistry.getNodeService.getProperty(NodeRef,QName)Java Code
NS
The value of title property…
QName cm:title
ServiceRegistry.getNodeService.getProperty(NodeRef,QName)Java Code
NS
Node Type…
QName cm:type
Have you the right to do this ?
ServiceRegistry.getNodeService.setProperty(NodeRef,QName)Java Code
NS
Now, have some fun! Let’s change!
QName cm:description
What ?????
The proof in Alfresco
ServiceRegistry.getNodeService.removeChildAssociation(ChildAssociationRef)
Java Code
NS
Eh eh… DESTRUCTION!!!
I feel that I will find myself all alone…
ServiceRegistry.getNodeService.addChild(parentRef, childRef, assocTypeQname, qname)
Java Code
NS
And reconstruction…
You are my dad ??
Ok, we are done for today !
Now , it’s up to you to discover the rest of
services!
And go your own way.
A last question please….!
So finally Alfresco is a package of services to manage nodes?
Yes !! It’s as simple as that…If we see it as a bigger picture
Any questions ???
For the next meeting maybe…
To be continued…
What if I want to share the content?
You can use protocols …
So if you want to learn…
…To go fast…
…and to reach your goals …
Choose Open Source ECM
Alfresco in few points…
By JM.PASCAL
www.opensourceecm.fr&
www.open-source-ecm.com