01: /*
02: * Copyright 2005 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: *
13: * Created Mar 14, 2006
14: * @author wseyler
15: */
16:
17: package org.pentaho.ui.component;
18:
19: import java.util.List;
20: import org.apache.commons.logging.Log;
21: import org.apache.commons.logging.LogFactory;
22: import org.dom4j.Document;
23: import org.dom4j.DocumentHelper;
24: import org.pentaho.core.session.IPentahoSession;
25: import org.pentaho.core.ui.IPentahoUrlFactory;
26: import org.pentaho.ui.XmlComponent;
27:
28: public class PropertiesEditorUIComponent extends XmlComponent {
29:
30: private static final long serialVersionUID = 1L;
31:
32: private static final Log logger = LogFactory
33: .getLog(PropertiesEditorUIComponent.class);
34:
35: private Document document = null;
36:
37: protected IPentahoSession session = null;
38:
39: protected String baseUrl = null;
40:
41: public PropertiesEditorUIComponent(IPentahoUrlFactory urlFactory,
42: List messages, IPentahoSession session) {
43: super (urlFactory, messages, null);
44: this .session = session;
45: setXsl("text/html", "PropertiesEditor.xsl"); //$NON-NLS-1$ //$NON-NLS-2$
46: setXslProperty(
47: "baseUrl", urlFactory.getDisplayUrlBuilder().getUrl()); //$NON-NLS-1$
48: }
49:
50: public Document getXmlContent() {
51:
52: if (document == null) {
53: document = DocumentHelper.createDocument();
54: document.addElement("root"); //$NON-NLS-1$
55: }
56: return document;
57: }
58:
59: public Log getLogger() {
60: return logger;
61: }
62:
63: public boolean validate() {
64: return true;
65: }
66:
67: }
|