01: /*
02: * Copyright 2006 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 Jun 25, 2005
14: * @author James Dixon
15: *
16: */
17:
18: package org.pentaho.core.solution;
19:
20: /**
21: * The ActionResource interface represents one resource in an ActionSequence.
22: * Resources are elements in a solution that exist outside of the action
23: * sequence document, such as images, icons, additional definition documents,
24: * etc.
25: */
26: public interface IActionResource {
27:
28: // TODO sbarkdull, may want to refactor this list of ints to enum when we move to java 5
29: /**
30: * The Resource is a solution file
31: */
32: public static final int SOLUTION_FILE_RESOURCE = 1;
33:
34: /**
35: * The resource is a URL
36: */
37: public static final int URL_RESOURCE = 2;
38:
39: /**
40: * The resource is an arbitrary file
41: */
42: public static final int FILE_RESOURCE = 3;
43:
44: /**
45: * The resource type is unknown
46: */
47: public static final int UNKNOWN_RESOURCE = 4;
48:
49: /**
50: * The resource type is an embedded string
51: */
52: public static final int STRING = 5;
53:
54: /**
55: * The resource type is embedded xml
56: */
57: public static final int XML = 6;
58:
59: /**
60: * Return the xml node name of the resource
61: *
62: * @return name of the resource
63: */
64: public String getName();
65:
66: /**
67: * Returns the mime type of the resource. Since resources are external, they
68: * can take on many different formats ie., text/xml, image/jpg, etc.
69: *
70: * @return the mime type of the resource
71: */
72: public String getMimeType();
73:
74: /**
75: * Get the type of external resource that this ActionResource is derived
76: * from.
77: * <p>
78: * Valid source types are SOLUTION_FILE_RESOURCE, URL_RESOURCE,
79: * FILE_RESOURCE and UNKNOWN_RESOURCE
80: *
81: * @return the resource source type
82: */
83: public int getSourceType();
84:
85: /**
86: * Depending on the resource source type, returns the address to the
87: * resource as a path or a URL.
88: *
89: * @return address of resource
90: */
91: // public String getLocation();
92: public String getAddress();
93:
94: }
|