org.zkoss.zk.ui.sys.SEORenderer.class"

From Documentation
m ((via JWB))
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{ZKConfigurationReferencePageHeader}}
 
{{ZKConfigurationReferencePageHeader}}
 +
 +
{{Old Version
 +
|url=http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_listener_Element/The_org.zkoss.zk.ui.sys.SEORenderer_interface
 +
|}}
  
 
'''Preference:'''
 
'''Preference:'''
Line 5: Line 9:
  
 
  Default: ''none''
 
  Default: ''none''
[since 5.0.6]
+
{{versionSince|5.0.6}}
  
 
It  specifies the class name of the application-specific SEO renderer. A SEO renderer is used to generate application-specific SEO content that will be indexed by the search engine, but not visible to the end users.
 
It  specifies the class name of the application-specific SEO renderer. A SEO renderer is used to generate application-specific SEO content that will be indexed by the search engine, but not visible to the end users.
Line 21: Line 25:
 
</source>
 
</source>
  
Also notice that, if specified, this class will be instantiated and invoked even if [[ZK Configuration Reference/zk.xml/The system-config Element/The crawlable Element|the crawlable option]] is not enabled.
+
You could generate anything that you'd like the search engine to index in <javadoc type="interface" method="render(org.zkoss.zk.ui.Page,  java.io.Writer)">org.zkoss.zk.ui.sys.SEORenderer</javadoc>:
 +
 
 +
<source lang="java">
 +
package foo;
 +
import org.zkoss.zk.ui.sys.SEORenderer;
 +
import org.zkoss.zk.ui.Page;
 +
public class MySEORenderer implements SEORenderer {
 +
    public void render(Page page, java.io.Writer out)
 +
    throws java.io.IOException {
 +
        out.write("<a href=\"whatever\">whatever</a>");
 +
    }
 +
}
 +
</source>
 +
 
 +
Notice that, if specified, this class will be instantiated and invoked even if [[ZK Configuration Reference/zk.xml/The system-config Element/The crawlable Element|the crawlable option]] is not enabled.
  
 
<blockquote>
 
<blockquote>

Latest revision as of 09:34, 14 March 2022


org.zkoss.zk.ui.sys.SEORenderer.class


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.

Preference:

org.zkoss.zk.ui.sys.SEORenderer.class
Default: none

Since 5.0.6

It specifies the class name of the application-specific SEO renderer. A SEO renderer is used to generate application-specific SEO content that will be indexed by the search engine, but not visible to the end users.

Notice that the class must implement SEORenderer. SEORenderer.render(Page, Writer) will be invoked each time the main page of a desktop has been rendered and sent to the client[1].

For example, assume you have an implementation called foo.MySEORenderer, then

<!-- in WEB-INF/zk.xml -->
<preference>
    <name>org.zkoss.zk.ui.sys.SEORenderer.class</name>
    <value>foo.MySEORenderer</value>
</preference>

You could generate anything that you'd like the search engine to index in SEORenderer.render(Page, Writer):

package foo;
import org.zkoss.zk.ui.sys.SEORenderer;
import org.zkoss.zk.ui.Page;
public class MySEORenderer implements SEORenderer {
    public void render(Page page, java.io.Writer out)
    throws java.io.IOException {
        out.write("<a href=\"whatever\">whatever</a>");
    }
}

Notice that, if specified, this class will be instantiated and invoked even if the crawlable option is not enabled.


  1. It also means it won't be called in AU requests.

Version History

Last Update : 2022/03/14


Version Date Content
5.0.6 Feburary, 2011 Introduced



Last Update : 2022/03/14

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.