Follow sidelabs on Twitter

WebScripts data

From SIDE-Labs.org


Contents

Introduction

To access simply to data stored by Alfresco, we generate many web scripts to get data. We can specify the type that we want. For each type, we generate web scripts to access by :

We can access to all attributes and all associations.

RSS

RSS (Really Simple Syndication) is a family of Web feed formats used to publish frequently updated content such as blog entries, news headlines or podcasts. An RSS document, which is called a "feed," "web feed," or "channel," contains either a summary of content from an associated web site or the full text. RSS makes it possible for people to keep up with their favorite web sites in an automated manner that's easier than checking them manually.

Source : Wikipedia

URL example :

http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact.rss

Result example :

<?xml version="1.0"?>
Failed to load RSS feed from
  
    Contact
    Contact
http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact.rss
    Alfresco
    
       Brice PAJOT
http://localhost:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82
       dfc72442-d58c-11dc-b3ee-c965ee51fb82
7 févr. 2008
       
               Nom de famille:PAJOT;
               Prénom:Brice;
               Surnom:;
               Salutation:M.;
               Téléphone:;
               Assistance téléphonique:;
               Fax:;
               Portable:;
               E-Mail:;
       
       admin
    
    
       Prénom Nom
http://localhost:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e
       6701a184-d62b-11dc-97c5-c32c1316ff3e
8 févr. 2008
       
               Nom de famille:Nom;
               Prénom:Prénom;
               Surnom:;
               Salutation:M.;
               Langue:espagnol,;
               Téléphone:;
               Assistance téléphonique:;
               Fax:;
               Portable:;
               E-Mail:;
       
       admin
    
  
!

XML

The Extensible Markup Language (XML) is a general-purpose markup language.It is classified as an extensible language because it allows its users to define their own elements. Its primary purpose is to facilitate the sharing of structured data across different information systems, particularly via the Internet, and it is used both to encode documents and to serialize data. In the latter context, it is comparable with other text-based serialization languages such as JSON and YAML.

Source : Wikipedia

URL example :

http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact.xml

Result example :

<records>
  <type>com_bluexml_sem_crm_Contact</type>
  <qName>crm:com_bluexml_sem_crm_Contact</qName>
  <totalCount>2</totalCount>
  <items>
    <item>
       <id>dfc72442-d58c-11dc-b3ee-c965ee51fb82</id>
       <url>/d/d/workspace/SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82/dfc72442-d58c-11dc-b3ee-c965ee51fb82</url>
       <downloadUrl>/d/a/workspace/SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82/dfc72442-d58c-11dc-b3ee-c965ee51fb82</downloadUrl>
       <displayPath>/Alfresco/Espace invité</displayPath>
       <icon16>/images/filetypes/_default.gif</icon16>
       <icon32>/images/filetypes32/_default.gif</icon32>
       <nodeRef>workspace://SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82</nodeRef>
       <parent>workspace://SpacesStore/335135d2-d3df-11dc-b09e-27b02e9f4ea6</parent>
       <com_bluexml_sem_crm_Contact_lastName>PAJOT</com_bluexml_sem_crm_Contact_lastName>
       <com_bluexml_sem_crm_Contact_firstName>Brice</com_bluexml_sem_crm_Contact_firstName>
       <com_bluexml_sem_crm_Contact_surname></com_bluexml_sem_crm_Contact_surname>
       <com_bluexml_sem_crm_Contact_title>M.</com_bluexml_sem_crm_Contact_title>
       <com_bluexml_sem_crm_Contact_language/>
       <com_bluexml_sem_crm_CommunicationInformation_phone></com_bluexml_sem_crm_CommunicationInformation_phone>
       <com_bluexml_sem_crm_CommunicationInformation_hotline></com_bluexml_sem_crm_CommunicationInformation_hotline>
       <com_bluexml_sem_crm_CommunicationInformation_fax></com_bluexml_sem_crm_CommunicationInformation_fax>
       <com_bluexml_sem_crm_CommunicationInformation_mobile></com_bluexml_sem_crm_CommunicationInformation_mobile>
       <com_bluexml_sem_crm_CommunicationInformation_email></com_bluexml_sem_crm_CommunicationInformation_email>
       <com_bluexml_sem_crm_Call_contacts></com_bluexml_sem_crm_Call_contacts>
       <com_bluexml_sem_crm_Project_linkedTo>Projet New Projet Projet Happy </com_bluexml_sem_crm_Project_linkedTo>
       <com_bluexml_sem_crm_BroadcastList_includesContact></com_bluexml_sem_crm_BroadcastList_includesContact>
       <com_bluexml_sem_crm_RelationBetweenContact_relateTo></com_bluexml_sem_crm_RelationBetweenContact_relateTo>
       <com_bluexml_sem_crm_Subscription_refersTo></com_bluexml_sem_crm_Subscription_refersTo>
       <com_bluexml_sem_crm_content_contents></com_bluexml_sem_crm_content_contents>
       <com_bluexml_sem_crm_Directory_containsContact></com_bluexml_sem_crm_Directory_containsContact>
       <com_bluexml_sem_crm_Role_hasRoles></com_bluexml_sem_crm_Role_hasRoles>
       <com_bluexml_sem_crm_RelationBetweenContact_haveLinks></com_bluexml_sem_crm_RelationBetweenContact_haveLinks>
       <com_bluexml_sem_crm_Event_organizedBy></com_bluexml_sem_crm_Event_organizedBy>
    </item>
    <item>
       <id>6701a184-d62b-11dc-97c5-c32c1316ff3e</id>
       <url>/d/d/workspace/SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e/Pr%c3%a9nom_Nom</url>
       <downloadUrl>/d/a/workspace/SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e/Pr%c3%a9nom_Nom</downloadUrl>
       <displayPath>/Alfresco/Espace invité</displayPath>
       <icon16>/images/filetypes/_default.gif</icon16>
       <icon32>/images/filetypes32/_default.gif</icon32>
       <nodeRef>workspace://SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e</nodeRef>
       <parent>workspace://SpacesStore/335135d2-d3df-11dc-b09e-27b02e9f4ea6</parent>
       <com_bluexml_sem_crm_Contact_lastName>Nom</com_bluexml_sem_crm_Contact_lastName>
       <com_bluexml_sem_crm_Contact_firstName>Prénom</com_bluexml_sem_crm_Contact_firstName>
       <com_bluexml_sem_crm_Contact_surname></com_bluexml_sem_crm_Contact_surname>
       <com_bluexml_sem_crm_Contact_title>M.</com_bluexml_sem_crm_Contact_title>
       <com_bluexml_sem_crm_Contact_language>espagnol </com_bluexml_sem_crm_Contact_language>
       <com_bluexml_sem_crm_CommunicationInformation_phone></com_bluexml_sem_crm_CommunicationInformation_phone>
       <com_bluexml_sem_crm_CommunicationInformation_hotline></com_bluexml_sem_crm_CommunicationInformation_hotline>
       <com_bluexml_sem_crm_CommunicationInformation_fax></com_bluexml_sem_crm_CommunicationInformation_fax>
       <com_bluexml_sem_crm_CommunicationInformation_mobile></com_bluexml_sem_crm_CommunicationInformation_mobile>
       <com_bluexml_sem_crm_CommunicationInformation_email></com_bluexml_sem_crm_CommunicationInformation_email>
       <com_bluexml_sem_crm_Call_contacts></com_bluexml_sem_crm_Call_contacts>
       <com_bluexml_sem_crm_Project_linkedTo>Projet New Projet </com_bluexml_sem_crm_Project_linkedTo>
       <com_bluexml_sem_crm_BroadcastList_includesContact></com_bluexml_sem_crm_BroadcastList_includesContact>
       <com_bluexml_sem_crm_RelationBetweenContact_relateTo></com_bluexml_sem_crm_RelationBetweenContact_relateTo>
       <com_bluexml_sem_crm_Subscription_refersTo></com_bluexml_sem_crm_Subscription_refersTo>
       <com_bluexml_sem_crm_content_contents></com_bluexml_sem_crm_content_contents>
       <com_bluexml_sem_crm_Directory_containsContact></com_bluexml_sem_crm_Directory_containsContact>
       <com_bluexml_sem_crm_Role_hasRoles></com_bluexml_sem_crm_Role_hasRoles>
       <com_bluexml_sem_crm_RelationBetweenContact_haveLinks></com_bluexml_sem_crm_RelationBetweenContact_haveLinks>
       <com_bluexml_sem_crm_Event_organizedBy></com_bluexml_sem_crm_Event_organizedBy>
    </item>
 </records>

JSON

JSON (JavaScript Object Notation) (pronounced /ˈdʒeɪsən/, like Jason) is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects). The JSON format is specified in RFC 4627 by Douglas Crockford. The official Internet media type for JSON is application/json. The JSON file extension is .json.

Source : Wikipedia

URL example :

http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact.json

Result example :

 {
    "type":"com_bluexml_sem_crm_Contact",
    "qName":"crm:com_bluexml_sem_crm_Contact",
    "totalCount":2,
    "records":[
       {
         "id":"dfc72442-d58c-11dc-b3ee-c965ee51fb82",
         "url":"/d/d/workspace/SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82/dfc72442-d58c-11dc-b3ee-c965ee51fb82",
         "downloadUrl":"/d/a/workspace/SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82/dfc72442-d58c-11dc-b3ee-c965ee51fb82",
         "displayPath":"/Alfresco/Espace invité",
         "icon16":"/images/filetypes/_default.gif",
         "icon32":"/images/filetypes32/_default.gif",
         "nodeRef":"workspace://SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82",
         "parent":"workspace://SpacesStore/335135d2-d3df-11dc-b09e-27b02e9f4ea6",
         "com_bluexml_sem_crm_Contact_lastName":"PAJOT",
         "com_bluexml_sem_crm_Contact_firstName":"Brice",
         "com_bluexml_sem_crm_Contact_surname":"",
         "com_bluexml_sem_crm_Contact_title":"M.",
         "com_bluexml_sem_crm_Contact_language":"",
         "com_bluexml_sem_crm_CommunicationInformation_phone":"",
         "com_bluexml_sem_crm_CommunicationInformation_hotline":"",
         "com_bluexml_sem_crm_CommunicationInformation_fax":"",
         "com_bluexml_sem_crm_CommunicationInformation_mobile":"",
         "com_bluexml_sem_crm_CommunicationInformation_email":"",
         "com_bluexml_sem_crm_Call_contacts":"",
         "com_bluexml_sem_crm_Project_linkedTo":"Projet New Projet Projet Happy ",
         "com_bluexml_sem_crm_BroadcastList_includesContact":"",
         "com_bluexml_sem_crm_RelationBetweenContact_relateTo":"",
         "com_bluexml_sem_crm_Subscription_refersTo":"",
         "com_bluexml_sem_crm_content_contents":"",
         "com_bluexml_sem_crm_Directory_containsContact":"",
         "com_bluexml_sem_crm_Role_hasRoles":"",
         "com_bluexml_sem_crm_RelationBetweenContact_haveLinks":"",
         "com_bluexml_sem_crm_Event_organizedBy":"",
         "alfresco_actions":"<a href=\"javascript:void(0)\" 
                   onclick=\"AlfNodeInfoMgr.toggle('workspace://SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82',this);\">
                   <img src='/alfresco/images/icons/popup.gif' border=0/></a>"	
      },{
         "id":"6701a184-d62b-11dc-97c5-c32c1316ff3e",
         "url":"/d/d/workspace/SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e/Pr%c3%a9nom_Nom",
         "downloadUrl":"/d/a/workspace/SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e/Pr%c3%a9nom_Nom",
         "displayPath":"/Alfresco/Espace invité",
         "icon16":"/images/filetypes/_default.gif",
         "icon32":"/images/filetypes32/_default.gif",
         "nodeRef":"workspace://SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e",
         "parent":"workspace://SpacesStore/335135d2-d3df-11dc-b09e-27b02e9f4ea6",
         "com_bluexml_sem_crm_Contact_lastName":"Nom",
         "com_bluexml_sem_crm_Contact_firstName":"Prénom",
         "com_bluexml_sem_crm_Contact_surname":"",
         "com_bluexml_sem_crm_Contact_title":"M.",
         "com_bluexml_sem_crm_Contact_language":"espagnol ",
         "com_bluexml_sem_crm_CommunicationInformation_phone":"",
         "com_bluexml_sem_crm_CommunicationInformation_hotline":"",
         "com_bluexml_sem_crm_CommunicationInformation_fax":"",
         "com_bluexml_sem_crm_CommunicationInformation_mobile":"",
         "com_bluexml_sem_crm_CommunicationInformation_email":"",
         "com_bluexml_sem_crm_Call_contacts":"",
         "com_bluexml_sem_crm_Project_linkedTo":"Projet New Projet ",
         "com_bluexml_sem_crm_BroadcastList_includesContact":"",
         "com_bluexml_sem_crm_RelationBetweenContact_relateTo":"",
         "com_bluexml_sem_crm_Subscription_refersTo":"",
         "com_bluexml_sem_crm_content_contents":"",
         "com_bluexml_sem_crm_Directory_containsContact":"",
         "com_bluexml_sem_crm_Role_hasRoles":"",
         "com_bluexml_sem_crm_RelationBetweenContact_haveLinks":"",
         "com_bluexml_sem_crm_Event_organizedBy":"",
         "alfresco_actions":"<a href=\"javascript:void(0)\"                         
                   onclick=\"AlfNodeInfoMgr.toggle('workspace://SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e',this);\">
                   <img src='/alfresco/images/icons/popup.gif' border=0/></a>"	
      }
  ]					]
}

HTML

HTML, an initialism of HyperText Markup Language, is the predominant markup language for web pages. It provides a means to describe the structure of text-based information in a document — by denoting certain text as links, headings, paragraphs, lists, and so on — and to supplement that text with interactive forms, embedded images, and other objects. HTML is written in the form of tags, surrounded by angle brackets. HTML can also describe, to some degree, the appearance and semantics of a document, and can include embedded scripting language code (such as JavaScript) which can affect the behavior of web browsers and other HTML processors.

Source : Wikipedia

URL example :

http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact.html

Result example :

 <div id="information" style="visibility:hidden">
    <type>com_bluexml_sem_crm_Contact</type>
    <qName>crm:com_bluexml_sem_crm_Contact</qName>
    <totalCount>28</totalCount>
 </div>
 <ul>
    <ul>
	    <li>id:dfc72442-d58c-11dc-b3ee-c965ee51fb82</li>
	    <li>url:/d/d/workspace/SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82/dfc72442-d58c-11dc-b3ee-c965ee51fb82</li>
	    <li>downloadUrl:/d/a/workspace/SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82/dfc72442-d58c-11dc-b3ee-c965ee51fb82</li>
	    <li>displayPath:/Alfresco/Espace invité</li>
	    <li>icon16:/images/filetypes/_default.gif</li>
	    <li>icon32:/images/filetypes32/_default.gif</li>
	    <li>nodeRef:workspace://SpacesStore/dfc72442-d58c-11dc-b3ee-c965ee51fb82</li>
	    <li>parent:workspace://SpacesStore/335135d2-d3df-11dc-b09e-27b02e9f4ea6</li>
	    <li>com_bluexml_sem_crm_Contact_lastName:PAJOT</li>
	    <li>com_bluexml_sem_crm_Contact_firstName:Brice</li>
	    <li>com_bluexml_sem_crm_Contact_surname:</li>
	    <li>com_bluexml_sem_crm_Contact_title:M.</li>
	    <li>com_bluexml_sem_crm_Contact_language:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_phone:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_hotline:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_fax:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_mobile:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_email:</li>
	    <li>com_bluexml_sem_crm_Call_contacts:</li>
	    <li>com_bluexml_sem_crm_Project_linkedTo:Projet New Projet Projet Happy </li>
	    <li>com_bluexml_sem_crm_BroadcastList_includesContact:</li>
	    <li>com_bluexml_sem_crm_RelationBetweenContact_relateTo:</li>
	    <li>com_bluexml_sem_crm_Subscription_refersTo:</li>
	    <li>com_bluexml_sem_crm_content_contents:</li>
	    <li>com_bluexml_sem_crm_Directory_containsContact:</li>
	    <li>com_bluexml_sem_crm_Role_hasRoles:</li>
	    <li>com_bluexml_sem_crm_RelationBetweenContact_haveLinks:</li>
	    <li>com_bluexml_sem_crm_Event_organizedBy:</li>
    </ul>
	<ul>
	    <li>id:6701a184-d62b-11dc-97c5-c32c1316ff3e</li>
	    <li>url:/d/d/workspace/SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e/Pr%c3%a9nom_Nom</li>
	    <li>downloadUrl:/d/a/workspace/SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e/Pr%c3%a9nom_Nom</li>
	    <li>displayPath:/Alfresco/Espace invité</li>
	    <li>icon16:/images/filetypes/_default.gif</li>
	    <li>icon32:/images/filetypes32/_default.gif</li>
	    <li>nodeRef:workspace://SpacesStore/6701a184-d62b-11dc-97c5-c32c1316ff3e</li>
	    <li>parent:workspace://SpacesStore/335135d2-d3df-11dc-b09e-27b02e9f4ea6</li>
	    <li>com_bluexml_sem_crm_Contact_lastName:Nom</li>
	    <li>com_bluexml_sem_crm_Contact_firstName:Prénom</li>
	    <li>com_bluexml_sem_crm_Contact_surname:</li>
	    <li>com_bluexml_sem_crm_Contact_title:M.</li>
	    <li>com_bluexml_sem_crm_Contact_language:espagnol </li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_phone:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_hotline:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_fax:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_mobile:</li>
	    <li>com_bluexml_sem_crm_CommunicationInformation_email:</li>
	    <li>com_bluexml_sem_crm_Call_contacts:</li>
	    <li>com_bluexml_sem_crm_Project_linkedTo:Projet New Projet </li>
	    <li>com_bluexml_sem_crm_BroadcastList_includesContact:</li>
	    <li>com_bluexml_sem_crm_RelationBetweenContact_relateTo:</li>
	    <li>com_bluexml_sem_crm_Subscription_refersTo:</li>
	    <li>com_bluexml_sem_crm_content_contents:</li>
	    <li>com_bluexml_sem_crm_Directory_containsContact:</li>
	    <li>com_bluexml_sem_crm_Role_hasRoles:</li>
	    <li>com_bluexml_sem_crm_RelationBetweenContact_haveLinks:</li>
	    <li>com_bluexml_sem_crm_Event_organizedBy:</li>
    </ul>
 </ul>

Recent content

We can select all contents modified or created since a period.

URL example :

http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact?days=7
http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact?hours=24
http://localhost:8080/alfresco/service/com_bluexml_sem_crm_Contact?minutes=15