View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.tuigwaa.cms.core.wiki;
17  
18  import java.net.URL;
19  import java.util.List;
20  import java.util.Map;
21  
22  import org.seasar.tuigwaa.cms.core.CmsRequest;
23  import org.seasar.tuigwaa.cms.core.Resource;
24  import org.seasar.tuigwaa.system.TgwSecurityException;
25  
26  
27  /***
28   * Defines various platform dependent functions. This is mainly used from
29   * plugin, like to get creation page URL etc.
30   * 
31   * @author someda
32   */
33  public interface WikiContext {
34  
35  	/***
36  	 * Check whether the page specified by pagename exists or not.
37  	 * 
38  	 * @return true if page exists on given request context
39  	 */
40  	public boolean isPageExist(String pagename, CmsRequest request)
41  			throws TgwSecurityException;
42  
43  	/***
44  	 * Provides URL of given pagename.
45  	 */
46  	public URL getURLByName(String pagename, CmsRequest request)
47  			throws TgwSecurityException;
48  
49  	/***
50  	 * Provides URL of given pagename and parameters.
51  	 */
52  	public URL getURLByName(String pagename, CmsRequest request, Map params)
53  			throws TgwSecurityException;
54  
55  	/***
56  	 * Provides [new page] URL for given pagename. URL is absolute path from
57  	 * http,https, also includes port etc.
58  	 * 
59  	 * @param pagename
60  	 *            pagename like "How to Use Tuigwaa" etc, which will be created
61  	 *            newly.
62  	 * @return URL newpage URL
63  	 */
64  	public URL getCreatePageURL(String pagename, CmsRequest request)
65  			throws TgwSecurityException;
66  
67  	public URL getEditPageURL(String pagename, CmsRequest request)
68  			throws TgwSecurityException;
69  
70  	/***
71  	 * Provides URL for given attachment filename.
72  	 */
73  	public URL getAttachedFileURL(String pagename, String filename,
74  			CmsRequest request);
75  
76  	/***
77  	 * Provides page list which is recently modified.
78  	 * 
79  	 * @param request
80  	 *            search path
81  	 * @param size
82  	 *            size of page list to be extracted should be positive.
83  	 */
84  	public List getRecentList(CmsRequest request, int size) throws Exception;
85  
86  	public List getDirectoryList(CmsRequest request, String folder)
87  			throws Exception;
88  
89  	public List getRecursiveDirectoryList(CmsRequest request, String folder)
90  			throws Exception;
91  
92  	/*
93  	 * public URL getDirectoryPageURL(String foldername,CmsRequest request);
94  	 */
95  
96  	public List getResourceList(CmsRequest request, String path)
97  			throws Exception;
98  
99  	public URL getPluginProxyURL(String pluginname, CmsRequest request);
100 
101 	public List getAttachmentFileList(CmsRequest request, String pagePath)
102 			throws TgwSecurityException;
103 
104 	public URL getCompleteURL(String filepath, CmsRequest request);
105 
106 	public Resource getResource(CmsRequest request, String pagePath);
107 
108 	public boolean hasCreatePermission(CmsRequest request);
109 }