KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > schema > FieldType


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
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, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.schema;
17
18 import org.outerj.daisy.repository.ValueType;
19 import org.outerj.daisy.repository.RepositoryException;
20 import org.outerj.daisy.repository.query.SortOrder;
21 import org.outerx.daisy.x10.FieldTypeDocument;
22
23 import java.util.Locale JavaDoc;
24 import java.util.Date JavaDoc;
25
26 public interface FieldType {
27     public long getId();
28
29     public ValueType getValueType();
30
31     public String JavaDoc getName();
32
33     public void setName(String JavaDoc name);
34
35     public String JavaDoc getDescription(Locale JavaDoc locale);
36
37     public String JavaDoc getDescriptionExact(Locale JavaDoc locale);
38
39     /**
40      *
41      * @param description if null, the description for this locale will be removed.
42      */

43     public void setDescription(Locale JavaDoc locale, String JavaDoc description);
44
45     public void clearDescriptions();
46
47     /**
48      * Returns the locales for which a description is set.
49      */

50     public Locale JavaDoc[] getDescriptionLocales();
51
52     /**
53      * Gets the label in the given locale, using the usual locale fallback
54      * mechanisms if not found in the exactly specified locale, and finally
55      * returning the fieldtype's name if no label is available.
56      */

57     public String JavaDoc getLabel(Locale JavaDoc locale);
58
59     public String JavaDoc getLabelExact(Locale JavaDoc locale);
60
61     /**
62      *
63      * @param label if null, the label for this locale will be removed.
64      */

65     public void setLabel(Locale JavaDoc locale, String JavaDoc label);
66
67     public void clearLabels();
68
69     public Locale JavaDoc[] getLabelLocales();
70
71     public boolean isDeprecated();
72
73     public void setDeprecated(boolean deprecated);
74     
75     public int getSize();
76     
77     /**
78      * Sets the size of this FieldType. If this method isn't called,
79      * the size will be 0. The size can be used for presentational purposes,
80      * and doesn't cause any validation to happen.
81      */

82     public void setSize(int size);
83
84     /**
85      * Indicates whether fields of this type can be used in object expressions of ACL rules.
86      * When fields can be used in ACL object expressions, this means that changing the
87      * value of such as field can influence the result of the ACL.
88      */

89     public boolean isAclAllowed();
90
91     public void setAclAllowed(boolean aclAllowed);
92
93     public boolean isMultiValue();
94
95     /**
96      * When was this PartType last changed (persistently). Returns null on newly
97      * created FieldTypes.
98      */

99     public Date JavaDoc getLastModified();
100
101     /**
102      * Who (which user) last changed this PartType (persistently). Returns -1 on
103      * newly created FieldTypes.
104      */

105     public long getLastModifier();
106     
107     /**
108      * Clears(removes) the SelectionList for this FieldType.
109      */

110     public void clearSelectionList();
111     
112     /**
113      * Returns the SelectionList for this FieldType if one has been defined,
114      * null if no SelectionList had been defined (i.e. not set for this FieldType
115      * using the setSelectionList(SelectionList selectionList) method).
116      */

117     public SelectionList getSelectionList();
118
119     /**
120      * Creates and returns a StaticSelectionList. The selection list automatically
121      * becomse the selection list of this field type.
122      */

123     public StaticSelectionList createStaticSelectionList();
124
125     /**
126      * Creates and returns a LinkQuerySelectionList. The selection list automatically
127      * becomse the selection list of this field type.
128      *
129      * <p>This only works for link-type fields.
130      */

131     public LinkQuerySelectionList createLinkQuerySelectionList(String JavaDoc whereClause, boolean filterVariants);
132
133     /**
134      * Creates and returns a QuerySelectionList. The selection list automatically
135      * becomse the selection list of this field type.
136      */

137     public QuerySelectionList createQuerySelectionList(String JavaDoc query, boolean filterVariants, SortOrder sortOrder);
138
139     public boolean getAllowFreeEntry();
140
141     /**
142      * When a field type has a selection list, should the user also be able to
143      * enter other values then those available in the selection list?
144      *
145      * <p>Note that in either case, it is not checked whether the fields' value
146      * occurs in the selection list. This is only a hint towards the editing GUI.
147      */

148     public void setAllowFreeEntry(boolean allowFreeEntry);
149
150     public FieldTypeDocument getXml();
151
152     public void setAllFromXml(FieldTypeDocument.FieldType fieldTypeXml);
153
154     public void save() throws RepositoryException;
155
156     public long getUpdateCount();
157
158 }
159
Popular Tags