alfresco in few points - search tutorial
TRANSCRIPT
![Page 1: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/1.jpg)
Search Tutorial
What is this flower ?
![Page 2: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/2.jpg)
This represents Alfresco !
![Page 3: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/3.jpg)
An ECM Open Source Solution
![Page 4: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/4.jpg)
Where is the Problem ?
![Page 5: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/5.jpg)
Curious people who want to understand Alfresco…
![Page 6: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/6.jpg)
With lots of questions…(To express…)
![Page 7: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/7.jpg)
A possible solution…
![Page 8: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/8.jpg)
Simply a presenter with presentations about Alfresco
![Page 9: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/9.jpg)
with a few answers… (To verify)
![Page 10: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/10.jpg)
Let’s do it !
![Page 11: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/11.jpg)
But before starting, here is a reminder !
![Page 12: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/12.jpg)
The principle is…Everything is a NODE!
I am a beautiful node!
![Page 13: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/13.jpg)
The rule is…Alfresco provides
services to manage Nodes
Even I have a manager…
![Page 14: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/14.jpg)
Now let’s go!
![Page 15: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/15.jpg)
As far as I understand, different language can be possibly used
to do searches…
![Page 16: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/16.jpg)
Indeed!Let’s have a look…
![Page 17: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/17.jpg)
XPath
Lucene
![Page 18: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/18.jpg)
Lucene first!
![Page 19: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/19.jpg)
Lucene ?• Apache Lucene is a high-
performance, full-featured text search engine library written entirely in Java.
• Although Lucene provides the ability to create your own queries through its API, it also provides a rich query language through the Query Parser, a lexer which interprets a string into a Lucene Query using JavaCC.
• Source: Lucene.org
![Page 20: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/20.jpg)
And with Alfresco… How does it work?
![Page 21: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/21.jpg)
Put in a nutshell…
![Page 22: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/22.jpg)
1. Collect
PropertiesAspect
Key words
ID
Type
![Page 23: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/23.jpg)
2. Preserve
Properties
Aspect
Key words
IDType
![Page 24: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/24.jpg)
3. Use
Properties
Key wordsAspect
![Page 25: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/25.jpg)
To push further…
![Page 26: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/26.jpg)
When a node is created, the following actions take place
• Indexing of the whole set of the items properties
• Plain text Indexing of the related content
![Page 27: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/27.jpg)
When a node is created:
• The plain text indexing takes place if the content format is: – Office (Open ou Microsoft)– XML/HTML– PDF– Emails– Texte
![Page 28: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/28.jpg)
To check it…
![Page 29: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/29.jpg)
Have a look into the data model!
File : contentModel.xml
![Page 30: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/30.jpg)
File : contentModel.xml
What does the « tokenize »
principle mean?
![Page 31: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/31.jpg)
Tokenising is to split (or not) a word into
one or many key words.
![Page 32: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/32.jpg)
Here is a PowerPoint presentation regarding Alfresco and its search feature.
Example
![Page 33: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/33.jpg)
Here is a PowerPoint presentation regarding Alfresco and its search feature.
Without « Tokenisation »…
Content
![Page 34: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/34.jpg)
Here is a PowerPoint presentation regarding Alfresco and its search feature.
A copy of the whole sentence is made in
the index
Here is a PowerPoint presentation regarding Alfresco and its search feature.
INDEX
Content
![Page 35: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/35.jpg)
Here is a PowerPoint presentation regarding Alfresco and its search feature.
The search would then be done on the
whole sentence!
Here is a PowerPoint presentation regarding Alfresco and its search feature.
INDEX
Contenu
![Page 36: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/36.jpg)
Here is a PowerPoint presentation regarding Alfresco and its search feature.
However if the sentence is split into
key words…
Contenu
![Page 37: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/37.jpg)
Here is a PowerPoint presentation regarding Alfresco and its search feature.
The serach can be done on those key
words only!
Presentation, PowerPoint, Alfresco, search
INDEX
Contenu
![Page 38: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/38.jpg)
So don’t forget to check your data
model !
![Page 39: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/39.jpg)
![Page 40: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/40.jpg)
OK… Demo time!
![Page 41: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/41.jpg)
A bit of theory
![Page 42: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/42.jpg)
Lucene in Alfresco enables you to query on
Do you work for the secret services ?
• The NodeRef (ID) The NodeRef (ID)
• The TypeThe Type
• The PropertiesThe Properties
• The AspectsThe Aspects
• The key Words The key Words (Content)(Content)
Of a NODE!Of a NODE!
![Page 43: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/43.jpg)
TheQueries
![Page 44: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/44.jpg)
To query on the Noderef
What is the interest of searching for a node we
already know the name of???
ID:" <Mon NodeRef> "ID:" <Mon NodeRef> "
![Page 45: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/45.jpg)
To query on the Type
Hopefully you remember what’s the QName…
TYPE:" <TypeQName> "TYPE:" <TypeQName> "
Otherwise click here
![Page 46: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/46.jpg)
To query on a property
Why is it different than the other queries??
@<QNamePropriété>\:" Value "@<QNamePropriété>\:" Value "
Why is it not upper case ?
![Page 47: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/47.jpg)
To query on an Aspect
AAhh! That’s better!
ASPECT:" <AspectQName> "ASPECT:" <AspectQName> "
![Page 48: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/48.jpg)
To query on a key word included in the content of
the node
Okey… Understood!
TEXT:<value>TEXT:<value>
I am getting bored…
![Page 49: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/49.jpg)
Context
![Page 50: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/50.jpg)
Here is our battle field
![Page 51: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/51.jpg)
Practice
![Page 52: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/52.jpg)
Note
Lucene and Alfresco!According to the Alfresco version you
are working with, you can get completely different results than
those presented in here.
This is the magic of the search feature!
![Page 53: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/53.jpg)
How to make a simple query with Lucene
Connect as « admin » to Alfresco
Click on
Choose the node browser
![Page 54: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/54.jpg)
How to make a simple query with Lucene
Choose the store : workspace://SpacesStore
In the drop down list, choose Lucene
![Page 55: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/55.jpg)
Ready ?
![Page 56: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/56.jpg)
I want the« Folder Test »
![Page 57: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/57.jpg)
![Page 58: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/58.jpg)
I want the « Folder Test »!!!!!
@cm\:name:’’Folder Test’’@cm\:name:’’Folder Test’’
![Page 59: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/59.jpg)
Result
![Page 60: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/60.jpg)
Reminder !
![Page 61: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/61.jpg)
To identify and make a node unique in a store, we use…
AUUID
![Page 62: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/62.jpg)
The concatenation of the protocole, the name of the store
and the UUID of a node is
ANodeRef
![Page 63: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/63.jpg)
In our case
UUIDNodeRef
![Page 64: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/64.jpg)
I want the « Foder Test » with
the UUID ID:"workspace://SpacesStore/ID:"workspace://SpacesStore/
b7ecc8b1-5edb-11dd-b7ecc8b1-5edb-11dd-afdd-79a008cbb404"afdd-79a008cbb404"
![Page 65: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/65.jpg)
![Page 66: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/66.jpg)
What about a search with several criterias ?
![Page 67: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/67.jpg)
You can add Operators !
![Page 68: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/68.jpg)
+ To add a validated criteria - To add a non validated criteria
AND To add a criteria
OR To add a choice between several
criterias
NOT To exclude a criteria
Operators
![Page 69: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/69.jpg)
I want all the spaces with the name « space »
TYPE:"cm:folder" AND @cm\:name:"Space"
TYPE:"cm:folder" +@cm\:name:"Space"
+TYPE:"cm:folder" AND @cm\:name:"Space"
![Page 70: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/70.jpg)
Result
![Page 71: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/71.jpg)
Let’s add a categoryto a space
Context
![Page 72: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/72.jpg)
I want all folders with the name « space » which has a category
TYPE:"cm:folder" AND @cm\:name:"Space"
AND ASPECT:"cm:generalclassifiable"
![Page 73: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/73.jpg)
I want all spaces with the name « space » which
DOES NOT have a categoryTYPE:"cm:folder"
AND @cm\:name:"Space" AND NOT ASPECT:"cm:generalclassifiable"
TYPE:"cm:folder" +@cm\:name:"Space" -ASPECT:"cm:generalclassifiable"
![Page 74: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/74.jpg)
Result
![Page 75: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/75.jpg)
Let’s have a look into the property types
![Page 76: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/76.jpg)
Note
Work Zone!
This section is experimental and results
vary a lot according to the tests!
![Page 77: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/77.jpg)
To search for text properties, you can use specific operators
![Page 78: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/78.jpg)
? Can replace one character
* Can replace one or many
characters
Special Operators
![Page 79: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/79.jpg)
I want all spaces with the name starting with « spa »
TYPE:"cm:folder" AND @cm\:name:"Spa*"
TYPE:"cm:folder" +@cm\:name:"Spa*"
![Page 80: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/80.jpg)
I want all spaces with the name ending with « spa »
TYPE:"cm:folder" AND @cm\:name:"*ace"
TYPE:"cm:folder" +@cm\:name:"*ace"
![Page 81: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/81.jpg)
Note
End of work zone!
This section was experimental!
![Page 82: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/82.jpg)
For more details… Lucene WebSite• http://lucene.apache.org/• http://lucene.apache.org/java/docs/queryparsersyntax.html
Alfresco Wiki• http://wiki.alfresco.com/wiki/Search#Lucene• http://wiki.alfresco.com/wiki/Lucene• http://wiki.alfresco.com/wiki/Lucene_Extensions_and_Issues
![Page 83: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/83.jpg)
Now XPath!
![Page 84: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/84.jpg)
XPath ?• XPath is a language for
addressing parts of an XML document, designed to be used by both XSLT and XPointer.
• Source w3c.org
![Page 85: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/85.jpg)
But we are dealing with nodes… Not with xml…
![Page 86: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/86.jpg)
Yes indeed but…
![Page 87: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/87.jpg)
A Principle…A Node can be identified
as an xmlMirror
XML
What a face I have now…
![Page 88: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/88.jpg)
The proof in Alfresco…
![Page 89: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/89.jpg)
WebApp
ACP
![Page 90: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/90.jpg)
Explorer
ACP
![Page 91: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/91.jpg)
So XPath enables us to browse the nodes…
![Page 92: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/92.jpg)
Indeed !Demo...
![Page 93: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/93.jpg)
A bit of theory
![Page 94: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/94.jpg)
XPath in Alfresco enables to query on…
Why me…
• The TypeThe Type
• The PropertiesThe Properties
• The AspectsThe Aspects
• The AssociationsThe Associations
Of a Node!Of a Node!
![Page 95: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/95.jpg)
Axis
![Page 96: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/96.jpg)
In the Node family, I want to find myself !
selfself
![Page 97: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/97.jpg)
Then my Father!
parentparent
![Page 98: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/98.jpg)
Then my children!
ChildChild
![Page 99: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/99.jpg)
Then my older brothers
preceding-siblingpreceding-sibling
![Page 100: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/100.jpg)
Then my younger sisters
following-siblingfollowing-sibling
![Page 101: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/101.jpg)
Now let’s explore my family further
![Page 102: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/102.jpg)
I want to know my entire lineage!
descendantdescendant
![Page 103: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/103.jpg)
I want to know my ancestors
ancestorancestor
![Page 104: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/104.jpg)
I want to know all the oldest nodes in my family
precedingpreceding
![Page 105: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/105.jpg)
I want all the youngest nodes
followingfollowing
![Page 106: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/106.jpg)
Isn’t my family beautiful?
![Page 107: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/107.jpg)
Unfortunately, all my family are not visible in
Alfresco…
precedingpreceding
followingfollowing
preceding-siblingpreceding-sibling
following-siblingfollowing-sibling
![Page 108: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/108.jpg)
The queries
![Page 109: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/109.jpg)
To query on an axis
I want to know all the nodes on this axis!
Axe::*Axe::*
![Page 110: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/110.jpg)
To query on a property
It remind me of Lucene…
Axe::*[@<QName>:’<Value>’Axe::*[@<QName>:’<Value>’]
![Page 111: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/111.jpg)
To query on an aspect
The aspect doesn’t make the node!
Axe::*[hasAspect(’<QNameAspect>’)Axe::*[hasAspect(’<QNameAspect>’)]
![Page 112: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/112.jpg)
To query on a type
Beware! This means the current and child types!!!
Axe::*[subtypeOf(’<QNameType>’)Axe::*[subtypeOf(’<QNameType>’)]
![Page 113: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/113.jpg)
To query on the entire set of properties and content…
Axe::*[contains(’<Value>’)Axe::*[contains(’<Value>’)]
Beware! This means the current and child types!!!
![Page 114: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/114.jpg)
Context
![Page 115: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/115.jpg)
Here is our battle field
![Page 116: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/116.jpg)
Practice
![Page 117: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/117.jpg)
How to make a simple query with Lucene
Connect as « admin » to Alfresco
Click on
Choose the node browser
![Page 118: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/118.jpg)
How to make a simple query with Lucene
Choose the store : workspace://SpacesStore
In the drop down list, choose Lucene
![Page 119: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/119.jpg)
Why don’t we use XPath ??
![Page 120: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/120.jpg)
It’s exactly the same!Except that…
![Page 121: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/121.jpg)
SelectNodes : Related to the current node
XPath : From the root of
the store
![Page 122: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/122.jpg)
We want to start from a specific folder!
![Page 123: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/123.jpg)
Ready ?
![Page 124: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/124.jpg)
I want the current node
self::*
![Page 125: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/125.jpg)
Result
![Page 126: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/126.jpg)
I want the children of the current node
descendant::*
![Page 127: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/127.jpg)
I want the parent of the current node
parent::*
![Page 128: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/128.jpg)
I want the child which has a description « Space 1.1 Description »
descendant::*[@cm:description='Space 1.1 Description']
![Page 129: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/129.jpg)
Also note that operators are also available in XPath…
![Page 130: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/130.jpg)
I want the child which has a description « Space 1.1 Description » and that is of type
folder
descendant::*[@cm:description='Space 1.1 Description' and
subtypeOf('cm:folder')]
![Page 131: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/131.jpg)
I want the child which has its aspect related to categories and is of type folder
descendant::*[hasAspect('cm:generalclassifiable') and
subtypeOf('cm:folder')]
![Page 132: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/132.jpg)
To go further…• Wikipedia [FR]
• W3Schools[ENG]
• Spécifications W3C : Xpath 1.0[ENG]• Spécifications W3C : XPath 2.0[ENG]
• Developpez.com (A voir!)
![Page 133: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/133.jpg)
I now have many nodes! But where is Wally/Waldo…? Well actually…
where is the good node?
![Page 134: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/134.jpg)
If you are looking for a node, use the services…
![Page 135: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/135.jpg)
First, Think about Alfreso Service Registry !
![Page 136: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/136.jpg)
And then call …ActionService
AttributeServiceAuditService
AuthenticationServiceAuthorityService
AVMService
CategoryService
CheckOutCheckInService
ContentService
CopyService
DictionnaryService
FileFolderService
EditionService
ExporterServiceImporterService
MimeTypeService
MultilangualContentService
NodeService
LockService
RuleService
ScriptService
SearchService
TemplateService
TransactionServiceVersionService
WorkflowService
![Page 137: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/137.jpg)
And then call …ActionService
AttributeServiceAuditService
AuthenticationServiceAuthorityService
AVMService
CategoryService
CheckOutCheckInService
ContentService
CopyService
DictionnaryService
FileFolderService
EditionService
ExporterServiceImporterService
MimeTypeService
MultilangualContentService
NodeService
LockService
RuleService
ScriptService
SearchService
TemplateService
TransactionServiceVersionService
WorkflowService
![Page 138: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/138.jpg)
Or…ActionService
AttributeServiceAuditService
AuthenticationServiceAuthorityService
AVMService
CategoryService
CheckOutCheckInService
ContentService
CopyService
DictionnaryService
FileFolderService
EditionService
ExporterServiceImporterService
MimeTypeService
MultilangualContentService
NodeService
LockService
RuleService
ScriptService
SearchService
TemplateService
TransactionServiceVersionService
WorkflowService
![Page 139: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/139.jpg)
![Page 140: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/140.jpg)
Voilà! Enough for today!
![Page 141: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/141.jpg)
Now your turn!
![Page 142: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/142.jpg)
Questions ???
![Page 143: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/143.jpg)
Another time…
![Page 144: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/144.jpg)
Next…
![Page 145: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/145.jpg)
What if I want to share my nodes ?
![Page 146: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/146.jpg)
You would have to use the protocoles…
![Page 147: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/147.jpg)
To discover…
![Page 148: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/148.jpg)
To go further on…
![Page 149: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/149.jpg)
And to reach our goals…
![Page 150: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/150.jpg)
Choose ECM Open Source
![Page 151: Alfresco in few points - Search Tutorial](https://reader033.vdocument.in/reader033/viewer/2022052523/55580139d8b42a200d8b5267/html5/thumbnails/151.jpg)
Alfresco in few points…
By JM.PASCAL
www.opensourceecm.fr&
www.open-source-ecm.com