Most of the services are based upon the service protocol when they reference resources such as xslt files.
Here is the declaration of the sitemap service from the web plugin
<map:match pattern="service/sitemap.html"> <map:generate type="service-sitemap"/> <map:transform type="xslt" src="service://pages/services/sitemap/sitemap.xsl"> <map:parameter name="contextPath" value="{request:contextPath}"/> </map:transform> <map:serialize type="xml"/> </map:match>
This protocol has the following behavior :
In the preceding example, the file will be searched in the following order
Since Ametys 3.1, most of the services defined a parameter named 'xslt' to allow the contributor to choose the xslt file to use when rendering.
(note that the src of the xsl is then "service://@xslt")
The list of proposed files depends on the service declaration, but mostly is the '*.xsl' files in the service directory.
For example, the sitemap service will allow the contributor to choose its xsl file between thoses in the directories:
You can give a human readle name to your xsl file, by putting by its side a .xml file (with the same name).
Here is the sitemap.xml file
<?xml version="1.0" encoding="UTF-8"?> <service> <label i18n="true">PLUGINS_WEB_SERVICE_SITEMAP_XSLT_SITEMAP_LABEL</label> </service>
where the i18n key is in the plugin by default. You have then to specify: skin.MySkin:MYKEY when adding new xsl in your skin.
Here is the list of files for services in the kernel.
Service Name | Overriding directory | Default file | Other file (Ametys 3.1) | Support views (Ametys 3.1) |
---|---|---|---|---|
Attachment | skins/MYSKIN/services/web/pages/services/attach | attachments.xsl | attachments-tree.xsl | *.xsl |
Content digest | skins/MYSKIN/services/web/pages/services/filtered-contents | list.xsl |
| *.xsl |
IFrame | skins/MYSKIN/services/web/pages/services/iframe | iframe.xsl |
| - |
Insert content | skins/MYSKIN/services/web/pages/services/insert-content | view.xsl |
| *.xsl |
Revamping | skins/MYSKIN/services/web/pages/services/revamping | apply-skin.xsl |
| *.xsl |
Search | skins/MYSKIN/services/web/pages/services/search | search.xsl |
| *.xsl |
Sitemap | skins/MYSKIN/services/web/pages/services/sitemap | sitemap.xsl |
| *.xsl |
Events Calendar | skins/MYSKIN/services/news/pages/services/calendar | calendar.xsl |
| *.xsl |
This mean, that
When you create your file, you can import the default file if you want to change only a small part.
<xsl:import href="plugin:web://pages/services/sitemap.xsl"/>