001    /*
002    // $Id: //open/mondrian/src/main/mondrian/xmla/PropertyDefinition.java#17 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 2003-2007 Julian Hyde
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    //
010    // jhyde, May 2, 2003
011    */
012    package mondrian.xmla;
013    
014    import mondrian.olap.Util;
015    import mondrian.olap.MondrianServer;
016    
017    import java.util.Set;
018    
019    /**
020     * Defines an XML for Analysis Property.
021     *
022     * @author jhyde
023     * @since May 2, 2003
024     * @version $Id: //open/mondrian/src/main/mondrian/xmla/PropertyDefinition.java#17 $
025     */
026    enum PropertyDefinition {
027        AxisFormat(
028            RowsetDefinition.Type.Enumeration,
029            Util.enumSetAllOf(Enumeration.AxisFormat.class),
030            Enumeration.Access.Write,
031            "",
032            Enumeration.Methods.execute,
033            "Determines the format used within an MDDataSet result set to describe the axes of the multidimensional dataset. This property can have the values listed in the following table: TupleFormat (default), ClusterFormat, CustomFormat."),
034    
035        BeginRange(
036            RowsetDefinition.Type.Integer,
037            null,
038            Enumeration.Access.Write,
039            "-1",
040            Enumeration.Methods.execute,
041            "Contains a zero-based integer value corresponding to a CellOrdinal attribute value. (The CellOrdinal attribute is part of the Cell element in the CellData section of MDDataSet.)\n" +
042                "Used together with the EndRange property, the client application can use this property to restrict an OLAP dataset returned by a command to a specific range of cells. If -1 is specified, all cells up to the cell specified in the EndRange property are returned.\n" +
043                "The default value for this property is -1."),
044    
045        Catalog(
046            RowsetDefinition.Type.String,
047            null,
048            Enumeration.Access.ReadWrite,
049            "",
050            Enumeration.Methods.discoverAndExecute,
051            "When establishing a session with an Analysis Services instance to send an XMLA command, this property is equivalent to the OLE DB property, DBPROP_INIT_CATALOG.\n" +
052                "When you set this property during a session to change the current database for the session, this property is equivalent to the OLE DB property, DBPROP_CURRENTCATALOG.\n" +
053                "The default value for this property is an empty string."),
054    
055        Content(
056            RowsetDefinition.Type.EnumString,
057            Util.enumSetAllOf(Enumeration.Content.class),
058            Enumeration.Access.Write,
059            XmlaConstants.CONTENT_DEFAULT.name(),
060            Enumeration.Methods.discoverAndExecute,
061            "An enumerator that specifies what type of data is returned in the result set.\n" +
062                "None: Allows the structure of the command to be verified, but not executed. Analogous to using Prepare to check syntax, and so on.\n" +
063                "Schema: Contains the XML schema (which indicates column information, and so on) that relates to the requested query.\n" +
064                "Data: Contains only the data that was requested.\n" +
065                "SchemaData: Returns both the schema information as well as the data."),
066    
067        Cube(
068            RowsetDefinition.Type.String,
069            null,
070            Enumeration.Access.ReadWrite,
071            "",
072            Enumeration.Methods.execute,
073            "The cube context for the Command parameter. If the command contains a cube name (such as an MDX FROM clause) the setting of this property is ignored."),
074    
075        DataSourceInfo(
076            RowsetDefinition.Type.String,
077            null,
078            Enumeration.Access.ReadWrite,
079            "",
080            Enumeration.Methods.discoverAndExecute,
081            "A string containing provider specific information, required to access the data source."),
082    
083        EndRange(
084            RowsetDefinition.Type.Integer,
085            null,
086            Enumeration.Access.Write,
087            "-1",
088            Enumeration.Methods.execute,
089            "An integer value corresponding to a CellOrdinal used to restrict an MDDataSet returned by a command to a specific range of cells. Used in conjunction with the BeginRange property. If unspecified, all cells are returned in the rowset. The value -1 means unspecified."),
090    
091        Format(
092            RowsetDefinition.Type.EnumString,
093            Util.enumSetAllOf(Enumeration.Format.class),
094            Enumeration.Access.Write,
095            "Native",
096            Enumeration.Methods.discoverAndExecute,
097            "Enumerator that determines the format of the returned result set. Values include:\n" +
098                "Tabular: a flat or hierarchical rowset. Similar to the XML RAW format in SQL. The Format property should be set to Tabular for OLE DB for Data Mining commands.\n" +
099                "Multidimensional: Indicates that the result set will use the MDDataSet format (Execute method only).\n" +
100                "Native: The client does not request a specific format, so the provider may return the format  appropriate to the query. (The actual result type is identified by namespace of the result.)"),
101    
102        LocaleIdentifier(
103            RowsetDefinition.Type.UnsignedInteger,
104            null,
105            Enumeration.Access.ReadWrite,
106            "None",
107            Enumeration.Methods.discoverAndExecute,
108            "Use this to read or set the numeric locale identifier for this request. The default is provider-specific.\n" +
109                "For the complete hexadecimal list of language identifiers, search on \"Language Identifiers\" in the MSDN Library at http://www.msdn.microsoft.com."),
110    
111        MDXSupport(
112            RowsetDefinition.Type.EnumString,
113            Util.enumSetAllOf(Enumeration.MDXSupport.class),
114            Enumeration.Access.Read,
115            "Core",
116            Enumeration.Methods.discover,
117            "Enumeration that describes the degree of MDX support. At initial release Core is the only value in the enumeration. In future releases, other values will be defined for this enumeration."),
118    
119        Password(
120            RowsetDefinition.Type.String,
121            null,
122            Enumeration.Access.Read,
123            "",
124            Enumeration.Methods.discoverAndExecute,
125            "This property is deprecated in XMLA 1.1. To support legacy applications, the provider accepts but ignores the Password property setting when it is used with the Discover and Execute method"),
126    
127        ProviderName(
128            RowsetDefinition.Type.String,
129            null,
130            Enumeration.Access.Read,
131            "Mondrian XML for Analysis Provider",
132            Enumeration.Methods.discover,
133            "The XML for Analysis Provider name."),
134    
135        ProviderVersion(
136            RowsetDefinition.Type.String,
137            null,
138            Enumeration.Access.Read,
139            MondrianServer.forConnection(null).getVersion().getVersionString(),
140            Enumeration.Methods.discover,
141            "The version of the Mondrian XMLA Provider"),
142    
143        StateSupport(
144            RowsetDefinition.Type.EnumString,
145            Util.enumSetAllOf(Enumeration.StateSupport.class),
146            Enumeration.Access.Read,
147            "None",
148            Enumeration.Methods.discover,
149            "Property that specifies the degree of support in the provider for state. For information about state in XML for Analysis, see \"Support for Statefulness in XML for Analysis.\" Minimum enumeration values are as follows:\n" +
150                "None - No support for sessions or stateful operations.\n" +
151                "Sessions - Provider supports sessions."),
152    
153        Timeout(
154            RowsetDefinition.Type.UnsignedInteger,
155            null, Enumeration.Access.ReadWrite,
156            "Undefined",
157            Enumeration.Methods.discoverAndExecute,
158            "A numeric time-out specifying in seconds the amount of time to wait for a request to be successful."),
159    
160        UserName(
161            RowsetDefinition.Type.String,
162            null, Enumeration.Access.Read,
163            "",
164            Enumeration.Methods.discoverAndExecute,
165            "Returns the UserName the server associates with the command.\n" +
166                "This property is deprecated as writeable in XMLA 1.1. To support legacy applications, servers accept but ignore the password setting when it is used with the Execute method."),
167    
168        VisualMode(
169            RowsetDefinition.Type.Enumeration,
170            Util.enumSetAllOf(Enumeration.VisualMode.class),
171            Enumeration.Access.Write,
172            Integer.toString(Enumeration.VisualMode.Visual.ordinal()),
173            Enumeration.Methods.discoverAndExecute,
174            "This property is equivalent to the OLE DB property, MDPROP_VISUALMODE.\n" +
175                "The default value for this property is zero (0), equivalent to DBPROPVAL_VISUAL_MODE_DEFAULT."),
176    
177        // mondrian-specific property for advanced drill-through
178        TableFields(
179            RowsetDefinition.Type.String,
180            null,
181            Enumeration.Access.Read,
182            "",
183            Enumeration.Methods.discoverAndExecute,
184            "List of fields to return for drill-through.\n" +
185                "The default value of this property is the empty string,"  +
186                "in which case, all fields are returned."),
187    
188        // mondrian-specific property for advanced drill-through
189        AdvancedFlag(
190            RowsetDefinition.Type.Boolean,
191            null,
192            Enumeration.Access.Read,
193            "false",
194            Enumeration.Methods.discoverAndExecute,
195            "");
196    
197        final RowsetDefinition.Type type;
198        final Set<? extends Enum> enumSet;
199        final Enumeration.Access access;
200        final Enumeration.Methods usage;
201        final String value;
202        final String description;
203    
204        PropertyDefinition(
205            RowsetDefinition.Type type,
206            Set<? extends Enum> enumSet, Enumeration.Access access,
207            String value, Enumeration.Methods usage, String description)
208        {
209            // Line endings must be UNIX style (LF) not Windows style (LF+CR).
210            // Thus the client will receive the same XML, regardless
211            // of the server O/S.
212            assert description.indexOf('\r') == -1;
213            assert value.indexOf('\r') == -1;
214            assert (enumSet != null) == type.isEnum();
215            this.type = type;
216            this.enumSet = enumSet;
217            this.access = access;
218            this.usage = usage;
219            this.value = value;
220            this.description = description;
221        }
222    
223        /**
224         * Returns the description of this PropertyDefinition.
225         *
226         * @return description
227         */
228        public String getDescription() {
229            return description;
230        }
231    }
232    
233    // End PropertyDefinition.java