001: /*
002: * Copyright 2007 Outerthought bvba and Schaubroeck nv
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.outerj.daisy.frontend.util;
017:
018: /**
019: * Contains configuration information for the generic pipeline (internal/genericPipe)
020: * which is shared for displaying various pages.
021: */
022: public class GenericPipeConfig {
023: private String template = "resources/xml/page.xml";
024: private boolean applyI18n = true;
025: private boolean applyLayout = true;
026: private String stylesheet = null;
027: private String serializer = "html";
028: private boolean transformLinks = false;
029:
030: public GenericPipeConfig() {
031:
032: }
033:
034: public static GenericPipeConfig templatePipe(String template) {
035: GenericPipeConfig conf = new GenericPipeConfig();
036: conf.setTemplate(template);
037: return conf;
038: }
039:
040: public static GenericPipeConfig templateOnlyPipe(String template) {
041: GenericPipeConfig conf = new GenericPipeConfig();
042: conf.setTemplate(template);
043: conf.setApplyLayout(false);
044: return conf;
045: }
046:
047: public static GenericPipeConfig stylesheetPipe(String stylesheet) {
048: GenericPipeConfig conf = new GenericPipeConfig();
049: conf.setStylesheet(stylesheet);
050: return conf;
051: }
052:
053: public void setTemplate(String template) {
054: this .template = template;
055: }
056:
057: public void setStylesheet(String stylesheet) {
058: this .stylesheet = stylesheet;
059: }
060:
061: public void setXmlSerializer() {
062: this .serializer = "xml";
063: }
064:
065: public void setApplyLayout(boolean applyLayout) {
066: this .applyLayout = applyLayout;
067: }
068:
069: public void setApplyI18n(boolean applyI18n) {
070: this .applyI18n = applyI18n;
071: }
072:
073: public boolean getHasStylesheet() {
074: return stylesheet != null;
075: }
076:
077: public boolean getApplyI18n() {
078: return applyI18n;
079: }
080:
081: public boolean getApplyLayout() {
082: return applyLayout;
083: }
084:
085: public String getTemplate() {
086: return template;
087: }
088:
089: public String getSerializer() {
090: return serializer;
091: }
092:
093: public String getStylesheet() {
094: return stylesheet;
095: }
096:
097: public boolean getTransformLinks() {
098: return transformLinks;
099: }
100:
101: public void setTransformLinks(boolean transformLinks) {
102: this.transformLinks = transformLinks;
103: }
104: }
|