01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. The ASF licenses this file to You
04: * under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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. For additional information regarding
15: * copyright in this work, please see the NOTICE file in the top level
16: * directory of this distribution.
17: */
18:
19: package org.apache.roller.business;
20:
21: import java.util.Map;
22: import org.apache.roller.RollerException;
23: import org.apache.roller.pojos.WeblogEntryData;
24: import org.apache.roller.pojos.WebsiteData;
25:
26: /**
27: * Interface for Roller weblog entry plugins.
28: *
29: * Weblog entry plugins are used to make transformations to the entry text.
30: * These plugins affect both the entry summary and entry body.
31: */
32: public interface WeblogEntryPlugin {
33:
34: /**
35: * Returns the display name of this Plugin.
36: */
37: public String getName();
38:
39: /**
40: * Briefly describes the function of the Plugin. May contain HTML.
41: */
42: public String getDescription();
43:
44: /**
45: * Give plugin a chance to initialize and add objects the rendering model.
46: *
47: * @param weblog Weblog being processed
48: * @param model Rendering model where objects can be placed
49: */
50: public void init(WebsiteData weblog) throws RollerException;
51:
52: /**
53: * Apply plugin to the specified text.
54: *
55: * @param entry Entry being rendered.
56: * @param str String to which plugin should be applied.
57: * @return Results of applying plugin to entry.
58: */
59: public String render(WeblogEntryData entry, String str);
60:
61: }
|