View Javadoc
1   /*
2    * Copyright (C) 2003-2007 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.ecm.webui.presentation;
18  
19  import java.util.List;
20  
21  import javax.jcr.Node;
22  
23  import org.exoplatform.web.application.Parameter;
24  
25  import org.exoplatform.webui.core.UIComponent;
26  import org.exoplatform.webui.core.UIPopupContainer;
27  
28  /**
29   * Created by The eXo Platform SARL Author : Dang Van Minh
30   * minh.dang@exoplatform.com May 8, 2008 3:22:08 PM
31   */
32  
33  public interface NodePresentation {
34    
35    public static final String MEDIA_STATE_DISPLAY = "DISPLAY";
36    public static final String MEDIA_STATE_NONE = "NONE";
37  
38    /**
39     * Sets enable vote
40     *
41     * @param value value to set
42     */
43    public void setEnableVote(boolean value);
44  
45    /**
46     * checks if enable vote
47     *
48     */
49    public boolean isEnableVote();
50  
51    /**
52     * Sets enable comment
53     *
54     * @param value value to set
55     */
56    public void setEnableComment(boolean value);
57  
58    /**
59     * checks if enable comment
60     *
61     */
62    public boolean isEnableComment();
63  
64    /**
65     * Sets the node.
66     *
67     * @param node the new node
68     */
69    public void setNode(Node node);
70  
71    /**
72     * Gets the node.
73     *
74     * @return the node
75     * @throws Exception the exception
76     */
77    public Node getNode() throws Exception;
78  
79    /**
80     * Gets the original node.
81     *
82     * @return the original node
83     * @throws Exception the exception
84     */
85    public Node getOriginalNode() throws Exception;
86  
87    /**
88     * Gets the node type.
89     *
90     * @return the node type
91     * @throws Exception the exception
92     */
93    public String getNodeType() throws Exception;
94  
95    /**
96     * Checks if is node type supported.
97     *
98     * @return true, if is node type supported
99     */
100   public boolean isNodeTypeSupported();
101 
102   /**
103    * Gets the template path.
104    *
105    * @return the template path
106    * @throws Exception the exception
107    */
108   public String getTemplatePath() throws Exception;
109 
110   /**
111    * Gets the relations.
112    *
113    * @return the relations
114    * @throws Exception the exception
115    */
116   public List<Node> getRelations() throws Exception;
117 
118   /**
119    * Gets the attachments.
120    *
121    * @return the attachments
122    * @throws Exception the exception
123    */
124   public List<Node> getAttachments() throws Exception;
125   
126   /**
127    * Gets the viewable link.
128    *
129    * @return the viewable URL
130    * @throws Exception the exception
131    */
132   public String getViewableLink(Node attNode, Parameter[] params) throws Exception;
133 
134 
135   /**
136    * Checks if is rss link.
137    *
138    * @return true, if is rss link
139    */
140   public boolean isRssLink();
141 
142   /**
143    * Gets the rss link.
144    *
145    * @return the rss link
146    */
147   public String getRssLink();
148 
149   /**
150    * Gets the supported localise.
151    *
152    * @return the supported localise
153    * @throws Exception the exception
154    */
155   public List getSupportedLocalise() throws Exception;
156 
157   /**
158    * Sets the language.
159    *
160    * @param language the new language
161    */
162   public void setLanguage(String language);
163 
164   /**
165    * Gets the language.
166    *
167    * @return the language
168    */
169   public String getLanguage();
170 
171   /**
172    * Gets the component instance of type.
173    *
174    * @param className the class name
175    * @return the component instance of type
176    */
177   public Object getComponentInstanceOfType(String className);
178 
179   /**
180    * Gets the web dav server prefix.
181    *
182    * @return the web dav server prefix
183    * @throws Exception the exception
184    */
185   public String getWebDAVServerPrefix() throws Exception;
186 
187   /**
188    * Gets the image.
189    *
190    * @param node the node
191    * @return the image
192    * @throws Exception the exception
193    */
194   public String getImage(Node node) throws Exception;
195 
196   /**
197    * Gets the portal name.
198    *
199    * @return the portal name
200    */
201   public String getPortalName();
202 
203   /**
204    * Gets the repository.
205    *
206    * @return the repository
207    * @throws Exception the exception
208    */
209   public String getRepository() throws Exception;
210 
211   /**
212    * Gets the workspace name.
213    *
214    * @return the workspace name
215    * @throws Exception the exception
216    */
217   public String getWorkspaceName() throws Exception;
218 
219   /**
220    * Gets the view template.
221    *
222    * @param nodeTypeName the node type name
223    * @param templateName the template name
224    * @return the view template
225    * @throws Exception the exception
226    */
227   public String getViewTemplate(String nodeTypeName, String templateName) throws Exception;
228 
229   /**
230    * Get the skin of template if it's existing
231    * @param nodeTypeName The node type name
232    * @param skinName  Skin name
233    * @return The skin template
234    * @throws Exception
235    */
236   public String getTemplateSkin(String nodeTypeName, String skinName) throws Exception;
237 
238   /**
239    * Get UIComponent for comment
240    * @return
241    * @throws Exception
242    */
243   public UIComponent getCommentComponent() throws Exception;
244 
245   /**
246    * Get UIComponent to remove attachment in document
247    * @return
248    * @throws Exception
249    */
250   public UIComponent getRemoveAttach() throws Exception;
251 
252   /**
253    * Get UIComponent to remove comment in document
254    * @return
255    * @throws Exception
256    */
257 
258   public UIComponent getRemoveComment() throws Exception;
259 
260   /**
261    * Gets the comments.
262    *
263    * @return the comments
264    * @throws Exception the exception
265    */
266   public List<Node> getComments() throws Exception;
267 
268   /**
269    * Gets the download link.
270    *
271    * @param node the node
272    * @return the download link
273    * @throws Exception the exception
274    */
275   public String getDownloadLink(Node node) throws Exception;
276 
277   /**
278    * Encode html.
279    *
280    * @param text the text
281    * @return the string
282    * @throws Exception the exception
283    */
284   public String encodeHTML(String text) throws Exception;
285 
286   /**
287    * Gets the icons.
288    *
289    * @param node the node
290    * @param size the size
291    * @return the icons
292    * @throws Exception the exception
293    */
294   public String getIcons(Node node, String size) throws Exception;
295 
296   /**
297    * Get the UIComponent which to display file
298    * @param mimeType
299    * @return
300    * @throws Exception
301    */
302   public UIComponent getUIComponent(String mimeType) throws Exception;
303   
304   /**
305   * @param orgNode         Processed node
306   * @param propertyName    which property used for editing
307   * @param inputType       input type for editing: TEXT, TEXTAREA, WYSIWYG
308   * @param cssClass        class name for CSS, should implement: cssClass, [cssClass]Title
309   *                        Edit[cssClass] as relative css
310   *                        Should create the function: InlineEditor.presentationRequestChange[cssClass] 
311   *                        to request the rest-service
312   * @param isGenericProperty  set as true to use generic javascript function, other wise, must create 
313   *                        the correctspond function InlineEditor.presentationRequestChange[cssClass]
314   * @param arguments       Extra parameter for Input component (toolbar, width, height,.. for CKEditor/TextArea)
315   * @return                String that can be put on groovy template
316   * @throws                Exception
317   */
318   public String getInlineEditingField(Node orgNode, String propertyName, String defaultValue, String inputType, 
319       String idGenerator, String cssClass, boolean isGenericProperty, String... arguments) throws Exception;
320   public String getInlineEditingField(Node orgNode, String propertyName) throws Exception;
321   
322   /**
323    * gets the status of display audio description for accessible media
324    * @return status of display audio description for accessible media
325    */
326   public String getMediaState();
327   
328   /**
329    * switches the status of display audio description for accessible media
330    */
331   public void switchMediaState();
332   
333   /**
334    * 
335    * @return true if node can display audio description
336    */
337   public boolean isDisplayAlternativeText();
338   
339   /**
340    * 
341    * @return true if can switch to play audio description of the media
342    */
343   public boolean playAudioDescription();
344   
345   /**
346    * 
347    * @return true if can switch back from original node from audio description
348    */
349   public boolean switchBackAudioDescription();
350   
351   public String getActionOpenDocInDesktop() throws Exception;
352   
353   public UIPopupContainer getPopupContainer() throws Exception;
354   
355 }