XsltApplication Content Type

From Sense/Net Wiki
Jump to: navigation, search
  •  
  •  
  •  
  •  
  • 100%
  • 6.0
  • Enterprise
  • Community
  • Planned

Overview

The XsltApplication is an Application that renders the requested Content's (context Content) xml using a specified XSLT transformation. The output is cached by default.

Details

This type of application renders a custom response output for the requested Content: the XML representation of the Content is processed using anXSLT transformation that is given as a string property of the Application (Xslt template).

Caching

The output of the XsltApplication can be cached - and cache is switched on by default.

It is strongly advised to use the cache functionality of XsltApplication on live sites. XsltApplications that are not being cached may cause pages to be less responsive even at small visitor rates.

This functionality is controlled by the following properties:

  • Application is cached (Cacheable)
  • Application is cached for logged in users (CacheableForLoggedInUser)
  • Request path influences caching (CacheByPath)
  • Url query params influence caching (CacheByParams)
  • Language influences caching (CacheByLanguage)
  • Absolute expiration (AbsoluteExpiration)
  • Sliding expiration (SlidingExpirationMinutes)
  • Custom cache key (CustomCacheKey)

See detailed description below (#Fields). By default requested Content path is used as cache key. Besides this, output cache works the exact same way as portlet cache for Cacheable Portlets. See detailed info at Cacheable Portlet#Parameters and Cacheable Portlet#Sliding and Absolute expiration. Please note, that the url parameter ?disablecache=true can be used for debugging to temporarily switch off caching (see Cacheable Portlet#Debugging).

Built-in apps

  • /Root/(apps)/GenericContent/Xml
Usage: /mycontent?action=Xml (ie.: http://localhost/NewsDemo?action=Xml This link works only if you have a live demo install on your localhost! (Don't forget! Some feature needs authentication and/or admin rights!))
This application uses a simple copy xslt to generate the content xml as an xml output. After request viewing the page source will give us the Content xml. Useful for debugging and when creating custom XSLT for views.

Parent type

Content handler

  • SenseNet.Portal.Handlers.XsltApplication

The content handler of the XsltApplication Content Type handles the following:

  • it implements IHttpHandler interface to render custom output using the given XSLT transformation
  • it caches the rendered output using the given cache parameters

Example/Tutorials

There are no examples for this article.

Related links

References

There are no external references for this article.