001: package org.obe.client.api.repository;
002:
003: import org.obe.xpdl.model.data.ExternalReference;
004: import org.xml.sax.EntityResolver;
005:
006: /**
007: * @author Adrian Price
008: */
009: public class DocumentHandlerMetaData extends ToolAgentMetaData {
010: private static final long serialVersionUID = -3003775733188776748L;
011: private static final String IMPL_CLASS = "org.obe.runtime.tool.DocumentHandler";
012: private static final String[] IMPL_CTOR_SIG = { DocumentHandlerMetaData.class
013: .getName() };
014: // N.B. Only FileDataSources can use file extension mapping.
015: // URLDataSources call URLConnection.getContentType().
016: private String _url;
017: private int _height;
018: private int _width;
019: private boolean _status;
020: private boolean _toolbar;
021: private boolean _menubar;
022: private boolean _location;
023: private boolean _scrollbars;
024: private String _title;
025: private String _contentType;
026: private String _commandName;
027:
028: public DocumentHandlerMetaData() {
029: }
030:
031: public DocumentHandlerMetaData(String id, String displayName,
032: String description, String docUrl, String author,
033: boolean threadsafe) {
034:
035: super (id, displayName, description, docUrl, author, threadsafe);
036: }
037:
038: public ToolAgentMetaData introspect(ExternalReference extRef,
039: EntityResolver entityResolver) throws RepositoryException {
040:
041: // TODO: query JAF CommandMap to see whether content type is supported.
042: return null;//this;
043: }
044:
045: public String getUrl() {
046: return _url != null ? _url
047: : _type == null || !allowInheritance ? null
048: : ((DocumentHandlerMetaData) _type).getUrl();
049: }
050:
051: public void setUrl(String url) {
052: _url = url;
053: }
054:
055: public String getTitle() {
056: return _title != null ? _title : _type == null
057: || !allowInheritance ? null
058: : ((DocumentHandlerMetaData) _type).getTitle();
059: }
060:
061: public void setTitle(String title) {
062: _title = title;
063: }
064:
065: public int getHeight() {
066: return _height == 0 ? _type == null || !allowInheritance ? 0
067: : ((DocumentHandlerMetaData) _type).getHeight()
068: : _height;
069: }
070:
071: public void setHeight(int height) {
072: _height = height;
073: }
074:
075: public int getWidth() {
076: return _width == 0 ? _type == null || !allowInheritance ? 0
077: : ((DocumentHandlerMetaData) _type).getWidth() : _width;
078: }
079:
080: public void setWidth(int width) {
081: _width = width;
082: }
083:
084: public boolean getStatus() {
085: return _status;
086: }
087:
088: public void setStatus(boolean status) {
089: _status = status;
090: }
091:
092: public boolean getToolbar() {
093: return _toolbar;
094: }
095:
096: public void setToolbar(boolean toolbar) {
097: _toolbar = toolbar;
098: }
099:
100: public boolean getMenubar() {
101: return _menubar;
102: }
103:
104: public void setMenubar(boolean menubar) {
105: _menubar = menubar;
106: }
107:
108: public boolean getLocation() {
109: return _location;
110: }
111:
112: public void setLocation(boolean location) {
113: _location = location;
114: }
115:
116: public boolean getScrollbars() {
117: return _scrollbars;
118: }
119:
120: public void setScrollbars(boolean scrollbars) {
121: _scrollbars = scrollbars;
122: }
123:
124: public String getContentType() {
125: return _contentType != null ? _contentType : _type == null
126: || !allowInheritance ? null
127: : ((DocumentHandlerMetaData) _type).getContentType();
128: }
129:
130: public void setContentType(String contentType) {
131: _contentType = contentType;
132: }
133:
134: public String getCommandName() {
135: return _commandName != null ? _commandName : _type == null
136: || !allowInheritance ? null
137: : ((DocumentHandlerMetaData) _type).getCommandName();
138: }
139:
140: public void setCommandName(String commandName) {
141: _commandName = commandName;
142: }
143:
144: protected String getImplClass() {
145: return IMPL_CLASS;
146: }
147:
148: protected String[] getImplCtorSig() {
149: return IMPL_CTOR_SIG;
150: }
151: }
|