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;
17  
18  import java.text.SimpleDateFormat;
19  import java.util.Locale;
20  
21  /***
22   * @author someda
23   */
24  public class CmsConstants {
25  	
26  	public static final String ATTACHEMENT_SUFFIX = ".attach";
27  	
28  	public static final String PARAM_KEYWORD = "com.isenshi.cms.wiki.core/KEYWORD";
29  
30  	public static final SimpleDateFormat DATEFORMAT = new SimpleDateFormat(
31  			"yyyy/MM/dd HH:mm:ss", Locale.getDefault());
32  
33  	public static final SimpleDateFormat CALENDARFORMAT = new SimpleDateFormat(
34  			"yyyy-MM-dd");
35  
36  	public static final String LINEBREAK_CODE = "\n";
37  
38  	public static final String[] CONTENTTYPE = { "text/x-wiki", "text/html",
39  			"application/pdf", "application/rtf", "text/plain", "text/x-dform",
40  			"text/css","application/x-javascript","image/gif","image/png","image/jpeg"};
41  	
42  	public static final String DEFAULT_CONTENTTYPE = "application/octet-stream";
43  
44  	public static final int OUTPUTTYPE_WIKI = 0;
45  
46  	public static final int OUTPUTTYPE_HTML = 1;
47  
48  	public static final int OUTPUTTYPE_PDF = 2;
49  
50  	public static final int OUTPUTTYPE_RTF = 3;
51  
52  	public static final int OUTPUTTYPE_TEXT = 4;
53  
54  	public static final int OUTPUTTYPE_DFORM = 5;
55  	
56  	public static final int OUTPUTTYPE_CSS = 6;
57  	
58  	public static final int OUTPUTTYPE_JAVASCRIPT = 7;
59  	
60  	public static final int OUTPUTTYPE_GIF = 8;
61  	
62  	public static final int OUTPUTTYPE_PNG = 9;
63  	
64  	public static final int OUTPUTTYPE_JPEG = 10;
65  	
66  	public static final String getContenttype(int idx) {
67  		if (idx >= CONTENTTYPE.length)
68  			throw new IllegalArgumentException("");
69  		return CONTENTTYPE[idx];
70  	}
71  
72  	public static final String CONTENTTYPE_XWIKI = CONTENTTYPE[OUTPUTTYPE_WIKI];
73  
74  	public static final String CONTENTTYPE_HTML = CONTENTTYPE[OUTPUTTYPE_HTML];
75  
76  	public static final String CONTENTTYPE_PDF = CONTENTTYPE[OUTPUTTYPE_PDF];
77  
78  	public static final String CONTENTTYPE_RTF = CONTENTTYPE[OUTPUTTYPE_RTF];
79  
80  	public static final String CONTENTTYPE_TEXT = CONTENTTYPE[OUTPUTTYPE_TEXT];
81  
82  	public static final String CONTENTTYPE_DFORM = CONTENTTYPE[OUTPUTTYPE_DFORM];
83  		
84  	public static final String CONTENTTYPE_CSS = CONTENTTYPE[OUTPUTTYPE_CSS];
85  	
86  	public static final String CONTENTTYPE_JAVASCRIPT = CONTENTTYPE[OUTPUTTYPE_JAVASCRIPT];
87  	
88  	public static final String CONTENTTYPE_PNG = CONTENTTYPE[OUTPUTTYPE_PNG];
89  	
90  	public static final String CONTENTTYPE_GIF = CONTENTTYPE[OUTPUTTYPE_GIF];
91  	
92  	public static final String CONTENTTYPE_JPEG = CONTENTTYPE[OUTPUTTYPE_JPEG];
93  	
94  	// ------ Property names for Resource -----	
95  	public static final String PROPERTY_HIDDEN = "hidden";
96  
97  	public static final String PROPERTY_TRACKBACK = "trackback";
98  
99  	public static final String PROPERTY_PDFSTYLE = "pdfstyle";
100 
101 	public static final String PROPERTY_LOCKUSER = "lockuser";
102 
103 	public static final String PROPERTY_MENUPAGENAME = "menuPagename";
104 
105 	public static final String PROPERTY_RIGHTPAGENAME = "rightPagename";
106 	
107 	public static final String PROPERTY_SKINPAGENAME = "skinPagename";
108 
109 	// ----- HTML View Mode -----
110 	public static final int MODE_NORMAL = 0;
111 
112 	public static final int MODE_FULL = 1;
113 
114 	public static final int MODE_PREVIEW = 2;
115 }