Contentdokter

houdt uw content gezond...

Skip navigation.

CMS Blog

Livesite category

Lscs debug panel

Lscs comes with a debug panel (actually a REST API) that can be very useful if you need to debug your livesite lscs-queries. The manual is very brief on this section so here some usefull urls and remarks.

http: //server:port/lscs/admin/debugpanel/ [default port is 1876, I believe]

This is the most usefull url which gives you access to lscs-status, -diagnostics, -projectsnames and document query.

With the 'document query' you can query lscs for all metadata stored for a document. F.i. if you enter in field 'q' under 'Metadata Search' a query like 'TeamSite/Templating/DCR/Type:category/type' you will see a list of of dcr's of the dct 'category/type' within the project. Enter '*' in field 'q' and *all* documents will be returned. If you leave the project field empty it will use the first project name a listed under 'List project names'.

http: //server:port/lscs/v1/metadata-info

This returns a list of all known metadata fields with lscs.

http: //server:port/lscs/v1/document/path/sites/mysite/default.site?project=myproject

This returns the document (e.g. file contents, NOT the metadata) from the path (in the workarea) sites/mysite/default.site from myproject. Again you can leave the project out to query the default project.

Now, with this info read the manual again for further details.

 

Posted le 24 Jul, 2011 Catégorie:Livesite Ajouter un commentaire

Custom page tokens

Livesite has silently introduced a new feature that could be very helpfull: custom page tokens. Documentation for it is non-existing (and this seems to be a trend at Autonomy. In the Interwoven area documentation was never its strongest point but since Autonomy has taken over the situation has gone worse.)

Page tokens are a well known and documented feature of Livesite. They are used to insert text into the resulting HTML, like livesite-links (URL_PREFIX) or xpath-values (MODEL). This feature is now extended so that you can write your own custom page tokens. Here is how to:

First, add a section like to to TeamSite\local\config\lib\content_center\livesite_customer_src\etc\conf\livesite_customer\resources\customer-resource-config.xml::


<entry key="SAMPLE_TOKEN">
<value>com.interwoven.livesite.external.runtime.example.PageTokenVariableSample</value>
</entry>


in which the key is the name of the token (without the $-prefix!) and the value is your (custom) class that implements the token.

Second, create the class:


public class PageTokenVariableSample extends PageTokenVariable
{
/**
* {@inheritDoc}
*/
public void init(BaseRequestContext context)
{
super.init(context);

// Do additional initialization here or remove this method if there if none
}

/**
* {@inheritDoc}
*/
public void preRender(BaseRequestContext context)
{
super.preRender(context);

// Do additional pre-rendering here or remove this method if there if none
}

/**
* {@inheritDoc}
*/

public void render(PrintWriter writer, BaseRequestContext context) throws Exception
{
// Do some work here
writer.print("$"+mTokenName+" has been replaced with this text");
}
}


Note that the result of the init-method is cached by livesite. Any parameters can be found in the inherited String 'mParameter'.

Run build.bat and you are ready to go.

Posted le 17 Dec, 2010 Catégorie:Livesite Ajouter un commentaire

Custom Page Layouts with LiveSite

LiveSite and Sitepublisher 3.1 have 2 interesting features that greatly enhance the powers of it. Let's have a close look at these.

Custom Page Types


First feature to mention is the 'Custom Page Types' (dubbed 'Doctype Support' in the manual, such a stupid name because it clashes with the well-known html-doctype. Using this mechanism one can define a xsl-stylesheet to use for the master page-html. This is important because I believe that the html that the default page-xsl produces is not very good. It is not accessible, not standard-compliant, fuzzy code is inserted and it uses a css-stylesheet which I don't like. In fact, I think code like this should always be custom-created.

Adding your own custom page type is very easy. Add something like below to livesite_customer_src/etc/conf/livesite_customer/pagetype-config.xml and rebuild the livesite-toolkit:

 

<page-types>
<page-type id="yourid" default="false">
<name>Any name</name>
<output>
<doctype/>
<method>html</method>
<content-type>text/html</content-type>
<omit-xml-declaration>true</omit-xml-declaration>
</output>
<allowed-layouts>
<layout refid="yourlayout"/>
</allowed-layouts>
</page-type>
</page-types>
<layouts>
<layout id="yourlayout">
<name>Your Layout</name>
<stylesheet>nl/contentdokter/xsl/runtime/yourstyle.xsl</stylesheet>
<class>com.interwoven.livesite.layout.impl.DivLayout</class>
</layout>
</layouts>


Now all you need to do is create your own xsl-stylesheet (under livesite_customer_src/etc/classes/nl/contentdokter/xsl/runtime/yourstyle.xsl). Two short tips on this:

1. use one of the xsl-files under httpdwebappscontent_centerWEB-INFclassescominterwovenxslruntime as a reference example

2. if your want to know how the source xml looks use this xsl-template:


<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>


Note that you could even, if you really have the courage, to write your own Layout-class in java. That is, however, not easy and I don't really see a good use for it.

Custom Fixed Layouts


The second feature to mention is the 'Custom Fixed Layouts'. Using this, you stop using the original free-flow layout of SitePublisher and instead divide your page into fixed areas in which your end-users can drop the components. A crucial feature, really, because I don't think I will ever meet a content-editor that can be bothered with placing a component on a pixel-exact detail. Too time-consuming and error-prone.

If you want to try it out yourself, follow the chapter on this in the manual but, important, the given example has 1 or 2 annoying errors that will break it!

A perfect world


Now, in a perfect world one would be able to combine these two features:

1. create a fixed layout matching your sites styleguide

2. create a custom page-stylesheet with clean html and all custom css/js included

Well, that will work but it won't! So yes, you can overwrite the default 'fixed-layout' with your own, and thus define which page-xsl to use. But you can NOT create a second (or third) layout-entry in pagetype-config for a fixed layout.

Thus is due to the fact that the (internal) java-code does a string-match in the layout-id for 'fixed-layout'. It would have been so much better would they have added a boolean attribute to the layout-element like 'is-fixed-layout'. But they haven't.

Typical. :-(

Posted le 22 Feb, 2010 Catégorie:Livesite Ajouter un commentaire
Your language: Nederlands In english Auf deutsch En français