KickJava   Java API By Example, From Geeks To Geeks.

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


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.RepositoryException;
19 import org.outerx.daisy.x10.PartTypeDocument;
20
21 import java.util.Locale JavaDoc;
22 import java.util.Date JavaDoc;
23
24 public interface PartType {
25     public long getId();
26
27     public String JavaDoc getName();
28
29     public void setName(String JavaDoc name);
30
31     /**
32      * Gets the label in the given locale, using the usual locale fallback
33      * mechanisms if not found in the exactly specified locale, and finally
34      * returning the parttype's name if no label is available.
35      */

36     public String JavaDoc getLabel(Locale JavaDoc locale);
37
38     public String JavaDoc getLabelExact(Locale JavaDoc locale);
39
40     /**
41      *
42      * @param label if null, the label for this locale will be removed.
43      */

44     public void setLabel(Locale JavaDoc locale, String JavaDoc label);
45
46     public void clearLabels();
47
48     public Locale JavaDoc[] getLabelLocales();
49
50     public String JavaDoc getDescription(Locale JavaDoc locale);
51
52     public String JavaDoc getDescriptionExact(Locale JavaDoc locale);
53
54     /**
55      *
56      * @param description if null, the description for this locale will be removed.
57      */

58     public void setDescription(Locale JavaDoc locale, String JavaDoc description);
59
60     public void clearDescriptions();
61
62     /**
63      * Returns the locales for which a description is set.
64      */

65     public Locale JavaDoc[] getDescriptionLocales();
66
67     /**
68      * Returns a string describing limitations on the allowed mime-types.
69      * An empty string means no restrictions. Otherwise, the string contains
70      * a comma-separated list of allowed mime-types.
71      */

72     public String JavaDoc getMimeTypes();
73
74     /**
75      * Specify the type of data that is allowed in parts of this type based
76      * on the mime-type.
77      *
78      * @param mimeTypes A comma-separated list of mime-types. If empty, all mime-types are allowed.
79      */

80     public void setMimeTypes(String JavaDoc mimeTypes);
81
82     public boolean mimeTypeAllowed(String JavaDoc mimeType);
83
84     /**
85      * Indicates if the content of the part is Daisy HTML (well-formed
86      * XML using HTML elements).
87      */

88     public boolean isDaisyHtml();
89
90     /**
91      * Sets the Daisy-HTML flag.
92      *
93      * <p>Note: when the argument daisyHTML is true, the link extractor will be forced
94      * to "daisy-html", for reasons of back-compatibility (in the past, link extractors
95      * were not explicitely configurable, and link extraction always happened for
96      * daisy-html parts). It is possible to override this again by calling
97      * setLinkExtractor after setDaisyHtml.
98      */

99     public void setDaisyHtml(boolean daisyHtml);
100
101     /**
102      *
103      * @param name allowed to be null
104      */

105     public void setLinkExtractor(String JavaDoc name);
106
107     /**
108      * Returns the name of the link extractor to use for parts of this type, can be null.
109      */

110     public String JavaDoc getLinkExtractor();
111
112     public boolean isDeprecated();
113
114     public void setDeprecated(boolean deprecated);
115
116     /**
117      * When was this PartType last changed (persistently). Returns null on newly
118      * created PartTypes.
119      */

120     public Date JavaDoc getLastModified();
121
122     /**
123      * Who (which user) last changed this PartType (persistently). Returns -1 on
124      * newly created PartTypes.
125      */

126     public long getLastModifier();
127
128     public PartTypeDocument getXml();
129
130     /**
131      * Changes the state of this object to match the given XML. Note that this will
132      * only change properties otherwise changeable through methods of this interface,
133      * and not internal properties like id or lastModified.
134      */

135     public void setAllFromXml(PartTypeDocument.PartType partTypeXml);
136
137     public void save() throws RepositoryException;
138
139     public long getUpdateCount();
140 }
141
Popular Tags