A filter is used to retrieve contents matching properties among :
A filter can be restrict to a context. A context defines the context search among :
Each filter is linked to a view used to display matching contents :
A filter can define its own sort criteria.
A static content filter is a extension point of type org.ametys.cms.filter.ContentFilterExtensionPoint.
It can be defined in a plugin.xml file like bellow :
The filter bellow :
<extensions> <extension point="org.ametys.cms.filter.ContentFilterExtensionPoint" class="org.ametys.web.filter.StaticWebContentFilter" id="org.ametys.web.article.RSS"> <title i18n="false">Les articles de mon site</title> <description i18n="false">Le flux RSS des articles</description> <content-types> <type id="org.ametys.web.default.Content.article"/> </content-types> <view>abstract</view> <context type="current-site"/> <max-result>10</max-result> <sort-information> <sort metadataId="publication-date" ascending="true"/> <sort metadataId="title" ascending="false"/> </sort-information> </extension> </extensions>
The filter bellow :
<extensions> <extension point="org.ametys.cms.filter.ContentFilterExtensionPoint" class="org.ametys.web.filter.StaticWebContentFilter" id="org.ametys.web.new.RSS"> <title i18n="false">A la Une</title> <description i18n="false">Les actualités à la une</description> <content-types> <type id="org.ametys.plugins.news.Content.news"/> </content-types> <tags> <tag key="HOME_NEWS"/> <tag key="IMPORTANT_NEWS"/> </tags> <view>abstract</view> <context type="current-site"/> <max-result>10</max-result> </extension> </extensions>
The filter bellow :
<extensions> <extension point="org.ametys.cms.filter.ContentFilterExtensionPoint" class="org.ametys.web.filter.StaticWebContentFilter" id="org.ametys.web.new.RSS"> <title i18n="false">Les focus</title> <description i18n="false">Les focus</description> <content-types> <type id="org.ametys.web.default.Content.article"/> <type id="org.ametys.plugins.news.Content.news"/> </content-types> <tags> <tag key="FOCUS"/> </tags> <metadata> <author>laurence</author> </metadata> <view>link</view> <context type="child-pages" depth="5"/> <max-result>10</max-result> </extension> </extensions>
Each template of the skin can define filters to be used in the template. Those filters must be written in the default.xml file in the directory filters of the template directory.
Here bellow an example of such a file :
<?xml version="1.0" encoding="UTF-8"?> <filters> <filter id="focus" target="content"> <content-types> <type id="org.ametys.web.default.Content.article"/> </content-types> <tags> <tag key="FOCUS"/> </tags> <view>abstract</view> <context type="current-site"/> <max-result>5</max-result> </filter> </filters>
The definition of a filter in this file is closed to the definition of a same filter in a plugin.xml file (see above). Do not forget the id of the filter, it will be use in SAX events generating by the input data. You can define as many filters you want in this file.
The inputdata org.ametys.web.tags.inputdata.FilteredContentsInputData reads this file to generate the following SAX events with the contents matching the filters. The defined filter for example will be lead to the following XML :
<inputData> <Model> <focus> <content name="" id="defaultContent://"> <html> <head><!-- Here head of the content --> </head> <body> <!-- Here HTML view of the content --> </body> </html> </content> <content name="" id="defaultContent://"> <html> <head><!-- Here head of the content --> </head> <body> <!-- Here HTML view of the content --> </body> </html> </content> </focus> </Model> </inputData>
This service allows to aggregate contents matching a defined filter. The filter is created by the contributor while creating or modifying the service parameters.
The contributor can choose :
Each filter is associated with a RSS feed.
There are two kind of public URL for a filter's RSS feed :
http://[server_name]/plugins/web/[site_name]/[language]/[page_path]/filter/[filter_id]/rss.xml
http://[server_name]/plugins/web/[site_name]/[language]/filter/[filter_id]/rss.xml
For each "Filtered contents aggregator" service, an internal RSS feed url is available. The url looks like this :
http://[server_name]/plugins/web/[zoneitem_protocol]/[zoneitem_id]/rss.xml
Example : http://monserver.com/plugins/web/zoneItem/7d3fb6d3-24de-435e-9071-6702e8540447/rss.xml.