Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

{rate} {status:implemented|} [Google-sitemap|
Devstatus
Wiki Markup
Statusimplemented
Target
4.5.3

 

Officialdocu
0Google Sitemap module
1http://

...

wiki.magnolia-cms.com/display/DOCS45/Google+Sitemap+module

Introduction

Migrate the sitemap module in order to support Magnolia 4.5.

Goal

  • Create a standard module with configuration, templates and services (ok).
  • Replace JSP by FTL's (ok).
  • Better configuration (ok).
  • Add Specialized Sitemaps (Specialized Sitemaps) (next module version)
    • Mobiles
    • News
    • Video
    • Geo
    • Code Search
  • Add additional informations (linked to a page) to the SiteMaps (next module version)
    • Images
    • Video
  • Add Junit tests. (ok).
  • Add an AdminCentral Tools menu to access the Edit page (ko)

Global Requirements

Generate XML page(s) containing site informations following the siteMap protocol.

Have an Edit page that allows to add sites/virtualUri as component. The add Dialog should allows to:

  • Add either a new Site or VirtualUri Component.
  • For VirtualUri Component: no additional configuration.
  • For Site Component: a new Dialog is shown:
    • Define the Site root input field.

Have a configuration page (Dialog) that gives the abitiy to define per page the:

  • Change frequence
  • Priority
  • Visibility of the page and children in the SiteMap xml.

Google SiteMap requirements.

Requirements

Points not yet covered (next module version)?

  • A Sitemap file can contain no more than 50,000 URLs and must be no larger than 50MB when uncompressed. If your Sitemap is larger than this, break it into several smaller Sitemaps. These limits help ensure that your web server is not overloaded by serving large files to Google.
  • If you have more than one Sitemap, you can list them in a Sitemap index file and then submit the Sitemap index file to Google. You don't need to submit each Sitemap file individually.
  • As well as basic URL information, Sitemaps can contain detailed information about specific types of content on your site, including video, images, mobile, News, and software source code

Magnolia SiteMap requirements.

Points not yet covered (should we)?

  • Site variations:
  • Multi domains:
    'No. Please list only one version of a URL in your Sitemaps. Including multiple versions of URLs may result in incomplete crawling of your site'...

Google SiteMap Configuration

We should be able to configure:

  • Sites ans subSites to include in the SiteMap Url 
  • Display Virtual Uri or not.

Solutions

  • Create a configuration singleton used by the model and service (configure site to be displayed, date format, ...).
  • Create a Service responsible to perform the nodes search and convert these nodes to beans used for the rendering.
  • Create a new SiteMapModel  that uses the services and configuration singleton.
  • Create FTL's for rendering.

HowTo

Create a new SiteMap page

From the Admin interface, create a new GoogleSiteMap Page. This SiteMap page can be put at any place anywhere in the website tree.

Image Added
Multiple SiteMap definitions are supported (create a SiteMap for DemoProject and one for DemoFeature or one for Both).

Create site and virtualUri components.

Edit the GoogleSiteMap Page. Add a Site or VirtualUri component by clicking the add (plus) button on component area.
Image Added

SiteComponent

Selecting this component will open a new Dialog that allows to select the site(s), page(s), or subpage(s) to include in the sitemap.
Add one to n path.
Image Added
If no entries are selected, nothing will be added to the sitemap.

SiteComponent entries Edit Properties:

Hide in Sitemap. If this checkbox is selected

  • This page will not be included in the sitemap XML.
  • Subpages are included to the sitemap.xml.

Hide all children... If this checkbox is selected

  • This page will be included in the sitemap XML.
  • Subpages are not included to the sitemap.xml.

If both checkbox are selected:

  • This page will not be included in the sitemap XML.
  • Subpages are not included to the sitemap.xml.

Image Added

VirtualUriComponent.

No dialog is associated to this component. This will directly render all virtualUri defined into this instance.

SiteComponent entry Edit Properties

By selecting Hide in Sitemap, this virtualUri will not be displayed in the sitemap.xml

Access the sitemap xml

Just change the extension of the SiteMap page from .html to .xml.

(warning) Note that no duplicates url's (loc) are displayed. A filter mechanism is responsible to remove all duplicates.

Improvements

New functionalities to add

  • Support file creation
  • Support size and max url's contained in a sitemap.xml
  • Support sitemap index file
  • Support specific sitemap like mobile/images/video sitemap
  • Support images/video information's in a standard sitemap

Most of these functionalities are supported by an external java library (Apache License 2.0)

Code Block
modules/google-sitemap.html]  module . {status}

h3. Introduction

Migrate the sitemap module in order to support Magnolia 4.5.

h3. Goal

* Create a standard module with configuration, templates and services {color:#008000}*(ok)*{color}.
* Replace JSP by FTL's {color:#008000}*(ok)*{color}.
* Better configuration {color:#008000}*(ok)*{color}.
* {color:#000000}Add Specialized Sitemaps{color} ([Specialized Sitemaps|http://support.google.com/webmasters/bin/topic.py?hl=en&topic=20986&parent=8476&ctx=topic]) {color:#ff0000}*(next module version)*{color}
** Mobiles
** News
** Video
** Geo
** Code Search
* {color:#000000}Add additional informations{color} (linked to a page) to the SiteMaps {color:#ff0000}*(next module version)*{color}
** Images
** Video
* Add Junit tests. {color:#008000}*(ok)*{color}.
* {color:#000000}Add an AdminCentral Tools menu to access the Edit page{color} {color:#ff0000}*(ko)*{color}

h3. Global Requirements

Generate XML page(s) containing site informations following the [siteMap protocol|http://www.sitemaps.org/protocol.html].

Have an Edit page that allows to add sites/virtualUri as component. The add Dialog should allows to:

* Add either a new Site or VirtualUri Component.
* For VirtualUri Component: no additional configuration.
* For Site Component: a new Dialog is shown:
** Define the Site root input field.



Have a configuration page (Dialog) that gives the abitiy to define per page the:
* Change frequence
* Priority
* Visibility of the page and children in the SiteMap xml.

h4. Google SiteMap requirements.

[Requirements|http://support.google.com/webmasters/bin/answer.py?hl=en&answer=183668#1]

Points not yet covered {color:#ff0000}*(next module version)*{color}?
* A Sitemap file can contain no more than 50,000 URLs and must be no  larger than 50MB when uncompressed. If your Sitemap is larger than this,  break it into several smaller Sitemaps. These limits help ensure that  your web server is not overloaded by serving large files to Google.
* If you have more than one Sitemap, you can list them in a [Sitemap index file|http://support.google.com/webmasters/bin/answer.py?answer=71453] and then submit the Sitemap index file to Google. You don't need to submit each Sitemap file individually.
* As well as basic URL information, Sitemaps can contain detailed  information about specific types of content on your site, including [video|http://support.google.com/webmasters/bin/answer.py?answer=80471], [images|http://support.google.com/webmasters/bin/answer.py?answer=178636], [mobile|http://support.google.com/webmasters/bin/answer.py?answer=34627], [News|http://www.google.com/support/news_pub/bin/answer.py?answer=75717], and [software source code|http://support.google.com/webmasters/bin/answer.py?answer=75225]

h4. Magnolia SiteMap requirements.

Points not yet covered ({color:#ff0000}{*}should we{*}{color})?
* Site variations:
* Multi domains:
'No. Please list only one version of a URL in your Sitemaps. Including multiple versions                  of URLs may result in incomplete crawling of your site'[...|http://www.sitemaps.org/faq.html#faq_xml_encoding]

h4. Google SiteMap Configuration

We should be able to configure:
* Sites ans subSites to include in the SiteMap Url 
* Display Virtual Uri or not.





h3. Solutions

* Create a configuration singleton used by the model and service (configure site to be displayed, date format, ...).
* Create a Service responsible to perform the nodes search and convert these nodes to beans used for the rendering.
* Create a new SiteMapModel  that uses the services and configuration singleton.
* Create FTL's for rendering.

h3. HowTo


h4. Create a new SiteMap page

From the Admin interface, create a new GoogleSiteMap Page. This SiteMap page can be put at any place anywhere in the website tree.

 !CreateASiteMapPage.png|width=568,height=200!
Multiple SiteMap definitions are supported (create a SiteMap for DemoProject and one for DemoFeature or one for Both).


h4. Create site and virtualUri components.

Edit the GoogleSiteMap Page. Add a Site or VirtualUri component by clicking the add (+) button on component area.
!AddNewComponents.png|width=565,height=275!

h5. SiteComponent

Selecting this component will open a new Dialog that allows to select the site(s), page(s), or subpage(s) to include in the sitemap.
Add one to n path.
!SiteComponent.png|width=637,height=411!
If no entries are selected, nothing will be added to the sitemap.

h6. SiteComponent entries Edit Properties:

*Hide in Sitemap*. If this checkbox is selected

* This page will not be included in the sitemap XML.
* Subpages are included to the sitemap.xml.

*Hide all children...* If this checkbox is selected

* This page will be included in the sitemap XML.
* Subpages are not included to the sitemap.xml.

If *both* checkbox are selected:
* This page will not be included in the sitemap XML.
* Subpages are not included to the sitemap.xml.

!SiteComponentPorperties.png|width=977,height=336!


h5. VirtualUriComponent.


No dialog is associated to this component. This will directly render all virtualUri defined into this instance.


h6. SiteComponent entry Edit Properties


By selecting Hide in Sitemap, this virtualUri will not be displayed in the sitemap.xml


h4. Access the sitemap xml


Just change the extension of the SiteMap page from .html to .xml.

(!) Note that no duplicates url's (loc) are displayed. A filter mechanism is responsible to remove all duplicates.


h3. Improvements


h4. New functionalities to add

* Support file creation
* Support size and max url's contained in a sitemap.xml
* Support sitemap index file
* Support specific sitemap like mobile/images/video sitemap
* Support images/video information's in a standard sitemap


Most of these functionalities are supported by an [external java library|http://code.google.com/p/sitemapgen4j/] ([Apache License 2.0|http://www.apache.org/licenses/LICENSE-2.0])
{code}
     <!-- For site map generation  -->
	<dependency>
		<groupId>com.google.code</groupId>
		<artifactId>sitemapgen4j</artifactId>
		<version>1.0.1</version>
	</dependency>
{code}

Unfortunately

...

this

...

library

...

has

...

to

...

be

...

forked

...

in

...

order

...

to:

...

  • Not

...

  • only

...

  • be

...

  • able

...

  • to

...

  • create

...

  • xml

...

  • files,

...

  • but

...

  • also

...

  • to

...

  • redirect

...

  • the

...

  • xml

...

  • stream

...

  • to

...

  • an

...

  • outputStream

...

  • or

...

  • printwriter

...

  • (extend

...

  • SitemapGenerator

...

  • class)

...

  • Add

...

  • tag

...

  • support

...

  • for

...

  • images

...

  • and

...

  • videos

...

  • in

...

  • a

...

  • standard

...

  • sitemap

...

  • (extend

...

  • Renderer

...

  • of

...

  • the

...

  • WebSitemapGenerator

...

  • class)

...

Task:

...

  • Create

...

  • new

...

  • pages

...

  • template

...

  • for

...

  • Mobile,

...

  • News,

...

  • Video....

...

  • SiteMap

...

  • Create

...

  • page's

...

  • dialog

...

  • in

...

  • order

...

  • to

...

  • define

...

  • the

...

  • output

...

  • format

...

  • (generate

...

  • files,

...

  • render

...

  • xml,

...

  • ...)

...

  • Modify

...

  • the

...

  • siteMap

...

  • property

...

  • dialog

...

  • in

...

  • order

...

  • to

...

  • support

...

  • images

...

  • and

...

  • videos

...

  • informations

...

  • Fork

...

  • the

...

  • external

...

  • java

...

  • library.

...

References

Google SiteMap About

Google SiteMap Errors

Best Practices