info.magnolia.module.googlesitemap.service
Class SiteMapService

java.lang.Object
  extended by info.magnolia.module.googlesitemap.service.SiteMapService

@Singleton
public class SiteMapService
extends Object

Main SiteMapService. This service is responsible for: Searching the appropriate nodes (pages or VirtualUri) that should be displayed (for XML rendering or Editing). From the search nodes, create SiteMapEntrys (POJO containing preformated infos used for the rendering).


Constructor Summary
SiteMapService(info.magnolia.module.templatingkit.sites.SiteManager siteManager, GoogleSiteMapConfiguration configuration, QueryUtil queryUtil)
          Constructor for injection.
 
Method Summary
 Iterator<SiteMapEntry> getSiteMapBeans(javax.jcr.Node siteMapNode)
          Get Site and virtualUri informations if they are defined as components.
 List<SiteMapEntry> getSiteMapBeans(javax.jcr.Node siteMapNode, boolean isForVirtualUri, boolean isForEdit)
          Create the SiteMapEntry List corresponding to
- uriMapping if isForVirtualUri = true or
- for all child's of the rootNode that are of type MgnlNodeType.NT_CONTENT otherwise.
 javax.jcr.Node updatePageNode(SiteMapEntry entry)
          Based on a SiteMapEntry bean, update the related page property.
 javax.jcr.Node updateVirtualUriNode(SiteMapEntry entry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteMapService

@Inject
public SiteMapService(info.magnolia.module.templatingkit.sites.SiteManager siteManager,
                             GoogleSiteMapConfiguration configuration,
                             QueryUtil queryUtil)
Constructor for injection.

Parameters:
siteManager: - Injected.
Method Detail

getSiteMapBeans

public List<SiteMapEntry> getSiteMapBeans(javax.jcr.Node siteMapNode,
                                          boolean isForVirtualUri,
                                          boolean isForEdit)
                                   throws javax.jcr.RepositoryException
Create the SiteMapEntry List corresponding to
- uriMapping if isForVirtualUri = true or
- for all child's of the rootNode that are of type MgnlNodeType.NT_CONTENT otherwise.

Throws:
javax.jcr.RepositoryException

getSiteMapBeans

public Iterator<SiteMapEntry> getSiteMapBeans(javax.jcr.Node siteMapNode)
                                       throws javax.jcr.RepositoryException
Get Site and virtualUri informations if they are defined as components. Notice that by using a HashSet, a single object will be keeped in case of equality of the location.

Throws:
javax.jcr.RepositoryException

updatePageNode

public javax.jcr.Node updatePageNode(SiteMapEntry entry)
                              throws javax.jcr.RepositoryException
Based on a SiteMapEntry bean, update the related page property.
Update the page last modification date in order to visualize that the changes has to be published
in order to be visible on the public instance.

Throws:
javax.jcr.RepositoryException

updateVirtualUriNode

public javax.jcr.Node updateVirtualUriNode(SiteMapEntry entry)
                                    throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException


Copyright © 2014 Magnolia International Ltd.. All rights reserved.