001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.search;
018:
019: import java.util.Map;
020: import java.net.URL;
021:
022: /**
023: * Contract for implementing a specific parsed object.
024: *
025: * @author <a href="mailto:morciuch@apache.org">Mark Orciuch</a>
026: * @version $Id: ParsedObject.java 516448 2007-03-09 16:25:47Z ate $
027: */
028: public interface ParsedObject {
029:
030: public static final String FIELDNAME_KEY = "fieldname.key";
031: public static final String FIELDNAME_KEY_DEFAULT = "Key";
032: public static final String FIELDNAME_TYPE = "fieldname.type";
033: public static final String FIELDNAME_TYPE_DEFAULT = "Type";
034: public static final String FIELDNAME_CONTENT = "fieldname.content";
035: public static final String FIELDNAME_CONTENT_DEFAULT = "Content";
036: public static final String FIELDNAME_DESCRIPTION = "fieldname.description";
037: public static final String FIELDNAME_DESCRIPTION_DEFAULT = "Description";
038: public static final String FIELDNAME_TITLE = "fieldname.title";
039: public static final String FIELDNAME_TITLE_DEFAULT = "Title";
040: public static final String FIELDNAME_LANGUAGE = "fieldname.language";
041: public static final String FIELDNAME_LANGUAGE_DEFAULT = "Language";
042: public static final String FIELDNAME_FIELDS = "fieldname.fields";
043: public static final String FIELDNAME_FIELDS_DEFAULT = "Fields";
044: public static final String FIELDNAME_KEYWORDS = "fieldname.keywords";
045: public static final String FIELDNAME_KEYWORDS_DEFAULT = "Keywords";
046: public static final String FIELDNAME_URL = "fieldname.url";
047: public static final String FIELDNAME_URL_DEFAULT = "URL";
048: public static final String FIELDNAME_SCORE = "fieldname.score";
049: public static final String FIELDNAME_SCORE_DEFAULT = "Score";
050: public static final String FIELDNAME_CLASSNAME = "fieldname.className";
051: public static final String FIELDNAME_CLASSNAME_DEFAULT = "ClassName";
052:
053: // Known object types
054: public static final String OBJECT_TYPE_URL = "url";
055: public static final String OBJECT_TYPE_PORTLET = "portlet";
056: public static final String OBJECT_TYPE_PORTLET_APPLICATION = "portlet_application";
057: public static final String OBJECT_TYPE_PDF = "pdf";
058:
059: /**
060: * Returns parsed object key (cannot be null)
061: *
062: * @return
063: */
064: public String getKey();
065:
066: /**
067: * Sets parsed object key (cannot be null)
068: *
069: * @param type
070: */
071: public void setKey(String key);
072:
073: /**
074: * Returns parsed object type (cannot be null)
075: *
076: * @return
077: */
078: public String getType();
079:
080: /**
081: * Sets parsed object type (cannot be null)
082: *
083: * @param type
084: */
085: public void setType(String type);
086:
087: /**
088: * Returns parsed object content (cannot be null)
089: *
090: * @return
091: */
092: public String getContent();
093:
094: /**
095: * Sets parsed object content (cannot be null)
096: *
097: * @param content
098: */
099: public void setContent(String content);
100:
101: /**
102: * Returns parsed object description (cannot be null)
103: *
104: * @return
105: */
106: public String getDescription();
107:
108: /**
109: * Sets parsed object description (cannot be null)
110: *
111: * @param description
112: */
113: public void setDescription(String description);
114:
115: /**
116: *
117: * Returns parsed object keywords
118: *
119: * @return
120: */
121: public String[] getKeywords();
122:
123: /**
124: *
125: * Sets parsed object keywords
126: *
127: * @param keywords
128: */
129: public void setKeywords(String[] keywords);
130:
131: /**
132: * Returns parsed object title (cannot be null)
133: *
134: * @return
135: */
136: public String getTitle();
137:
138: /**
139: * Sets parsed object title (cannot be null)
140: *
141: * @param title
142: */
143: public void setTitle(String title);
144:
145: /**
146: * Returns parsed object language (cannot be null)
147: *
148: * @return
149: */
150: public String getLanguage();
151:
152: /**
153: * Sets parsed object language (cannot be null)
154: *
155: * @param language
156: */
157: public void setLanguage(String language);
158:
159: /**
160: *
161: * Returns parsed object searchable fields
162: *
163: * @return
164: */
165: public Map getFields();
166:
167: /**
168: *
169: * Sets parsed object searchable fields
170: *
171: * @param fields
172: */
173: public void setFields(Map fields);
174:
175: /**
176: * @return
177: */
178: public Map getKeywordsMap();
179:
180: /**
181: * @param multiKeywords
182: */
183: public void setKeywordsMap(Map keywordsMap);
184:
185: /**
186: * Returns parsed object URL
187: *
188: * @return
189: */
190: public URL getURL();
191:
192: /**
193: * Sets parsed object URL
194: *
195: * @param url
196: */
197: public void setURL(URL url);
198:
199: /**
200: * Getter for property score.
201: *
202: * @return Value of property score.
203: */
204: public float getScore();
205:
206: /**
207: * Setter for property score.
208: *
209: * @param score New value of property score.
210: */
211: public void setScore(float score);
212:
213: /**
214: * Getter for property className.
215: *
216: * @return Value of property className.
217: */
218: public String getClassName();
219:
220: /**
221: * Setter for property className.
222: *
223: * @param className New value of property className.
224: */
225: public void setClassName(String className);
226:
227: }
|