View Javadoc
1   package org.exoplatform.services.seo;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   import java.util.Locale;
6   
7   import javax.jcr.Node;
8   
9   /**
10   * Supplies APIs to manage SEO data of pages or content.
11   * This service includes some major functions that allow you to add, store,
12   * get or remove metadata of pages or content.
13   *
14   * @LevelAPI Experimental
15   */
16  public interface SEOService {
17   
18    /**
19     * Stores metadata of a given page/content.
20     * 
21     * @param metaModel Metadata of the page/content.
22     * @param portalName Name of the site that contains the given page/content.
23     * @param onContent Indicates whether the current page is content or portal.
24     * @throws Exception The exception
25     */
26    public void storeMetadata(PageMetadataModel metaModel, String portalName, boolean onContent, String language) throws Exception;
27  
28    /**
29     * Gets metadata of a portal or content page.
30     *
31     * @param params The parameters list of a content page.
32     * @param pageReference Reference of the page.
33     * @param language Language of the page.
34     * @return The page metadata.
35     * @throws Exception The exception
36     */
37    public PageMetadataModel getMetadata(ArrayList<String> params, String pageReference, String language) throws Exception;
38  
39    /**
40     * Gets metadata of a portal page.
41     *
42     * @param pageReference Reference of the page.
43     * @param language Language of the page.
44     * @return The page metadata.
45     * @throws Exception The exception
46     */
47    public PageMetadataModel getPageMetadata(String pageReference, String language) throws Exception;
48  
49    /**
50     * Gets metadata of a content page.
51     * 
52     * @param params The parameters list of a content page.
53     * @param language Language of the page.
54     * @return The page metadata.
55     * @throws Exception The exception
56     */  
57    public PageMetadataModel getContentMetadata(ArrayList<String> params, String language) throws Exception;
58  
59    /**
60     * Removes metadata from a given page.
61     *
62     * @param metaModel Metadata of the given page.
63     * @param portalName Name of the site that contains the given page.
64     * @param onContent Indicates whether the current page is content or portal.
65     * @param language Language of the given page.
66     * @throws Exception The exception
67     */
68    public void removePageMetadata(PageMetadataModel metaModel, String portalName, boolean onContent, String language) 
69        throws Exception;
70  
71    /**
72     * Gets the content node by a given path.
73     * 
74     * @param contentPath The given path.
75     * @throws Exception The exception
76     */
77    public Node getContentNode(String contentPath) throws Exception;
78  
79    /**
80     * Creates a hash key from the page reference or the UUID of the node.
81     *
82     * @param uri The page reference of the node.
83     * @return The hash key.
84     * @throws Exception The exception
85     */
86    public String getHash(String uri) throws Exception ;
87  
88    /**
89     * Gets a sitemap of a given site.
90     * 
91     * @param portalName Name of the given site.
92     * @return The sitemap.
93     * @throws Exception The exception
94     */
95    public String getSitemap(String portalName) throws Exception;
96  
97    /**
98     * Gets robots content of a given site.
99     * 
100    * @param portalName Name of the given site.
101    * @return The robots content.
102    * @throws Exception The exception
103    */
104   public String getRobots(String portalName) throws Exception;
105 
106   /**
107    * Gets a list of options (INDEX and NOINDEX) for robots to index.
108    * 
109    * @return The list of options (INDEX and NOINDEX).
110    * @throws Exception The exception
111    */
112   public List<String> getRobotsIndexOptions() throws Exception;
113 
114   /**
115    * Gets a list of options (FOLLOW and NOFOLLOW) for robots to follow.
116    * 
117    * @return The list of options (FOLLOW and NOFOLLOW).
118    * @throws Exception The exception
119    */
120   public List<String> getRobotsFollowOptions() throws Exception;
121 
122   /**
123    * Gets a list of options for frequency.
124    *
125    * @return The list of options.
126    * @throws Exception The exception
127    */
128   public List<String> getFrequencyOptions() throws Exception;
129 
130   /**
131    * Gets state of a page for its language of a given page.
132    *
133    * @param path Path of the page.
134    * @param language Language of the page.
135    * @param onContent Indicates whether the given page is content or portal.
136    * @return The page state.
137    * @throws Exception The exception
138    */
139   public String getState(String path, String language, boolean onContent) throws Exception;
140 
141   /**
142    * Gets all SEO languages of a given page.
143    *
144    * @param portalName Name of the site that contains the given page.
145    * @param seoPath Path of the page.
146    * @param onContent Indicates whether the given page is content or portal.
147    * @return The list of SEO languages.
148    * @throws Exception The exception
149    */
150   public List<Locale> getSEOLanguages(String portalName, String seoPath, boolean onContent) throws Exception;
151 }