- Main Page
- Data Structures
- Files

- File List
- Globals

# jasperserver/repository.h

Go to the documentation of this file.

    00001 /*
    00002  * Copyright (C) 2007 JasperSoft http://www.jaspersoft.com
    00003  *
    00004  * This program is free software; you can redistribute it and/or modify
    00005  * it under the terms of the GNU General Public License as published by
    00006  * the Free Software Foundation; either version 2 of the License, or
    00007  * (at your option) any later version.
    00008  *
    00009  * This program is distributed WITHOUT ANY WARRANTY; and without the
    00010  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00011  * See the GNU General Public License for more details.
    00012  *
    00013  * You should have received a copy of the GNU General Public License
    00014  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
    00015  * or write to:
    00016  *
    00017  * Free Software Foundation, Inc.,
    00018  * 59 Temple Place - Suite 330,
    00019  * Boston, MA  USA  02111-1307
    00020  */
    00021
    00022 #ifndef jasperserver_repository_H
    00023 #define jasperserver_repository_H
    00024
    00025 #include "stringbuffer.h"
    00026
    00027 #define         JS_TYPE_FOLDER  "folder"
    00028 #define         JS_TYPE_REPORTUNIT  "reportUnit"
    00029 #define         JS_TYPE_DATASOURCE  "datasource"
    00030 #define         JS_TYPE_DATASOURCE_JDBC  "jdbc"
    00031 #define         JS_TYPE_DATASOURCE_JNDI  "jndi"
    00032 #define         JS_TYPE_DATASOURCE_BEAN  "bean"
    00033 #define         JS_TYPE_IMAGE  "img"
    00034 #define         JS_TYPE_FONT  "font"
    00035 #define         JS_TYPE_JRXML  "jrxml"
    00036 #define         JS_TYPE_CLASS_JAR  "jar"
    00037 #define         JS_TYPE_RESOURCE_BUNDLE  "prop"
    00038 #define         JS_TYPE_REFERENCE  "reference"
    00039 #define         JS_TYPE_INPUT_CONTROL  "inputControl"
    00040 #define         JS_TYPE_DATA_TYPE  "dataType"
    00041 #define         JS_TYPE_OLAP_MONDRIAN_CONNECTION  "olapMondrianCon"
    00042 #define         JS_TYPE_OLAP_XMLA_CONNECTION  "olapXmlaCon"
    00043 #define         JS_TYPE_MONDRIAN_SCHEMA  "olapMondrianSchema"
    00044 #define         JS_TYPE_XMLA_CONNTCTION  "xmlaConnection"
    00045 #define         JS_TYPE_UNKNOW  "unknow"
    00046 #define         JS_TYPE_LOV  "lov" // List of values...
    00047 #define         JS_TYPE_QUERY  "query" // Query...
    00048
    00049
    00053 #define         JS_DT_TYPE_TEXT  1
    00054 #define         JS_DT_TYPE_NUMBER  2
    00055 #define         JS_DT_TYPE_DATE  3
    00056 #define         JS_DT_TYPE_DATE_TIME  4
    00057
    00061 #define         JS_IC_TYPE_BOOLEAN  1
    00062 #define         JS_IC_TYPE_SINGLE_VALUE  2
    00063 #define         JS_IC_TYPE_SINGLE_SELECT_LIST_OF_VALUES  3
    00064 #define         JS_IC_TYPE_SINGLE_SELECT_QUERY  4
    00065 #define         JS_IC_TYPE_MULTI_VALUE  5
    00066 #define         JS_IC_TYPE_MULTI_SELECT_LIST_OF_VALUES  6
    00067 #define         JS_IC_TYPE_MULTI_SELECT_QUERY  7
    00068
    00069 #define         JS_IC_TYPE_SINGLE_SELECT_LIST_OF_VALUES_RADIO  8
    00070 #define         JS_IC_TYPE_SINGLE_SELECT_QUERY_RADIO  9
    00071 #define         JS_IC_TYPE_MULTI_SELECT_LIST_OF_VALUES_CHECKBOX  10
    00072 #define         JS_IC_TYPE_MULTI_SELECT_QUERY_CHECKBOX  11
    00073
    00074 #define         JS_PROP_VERSION  "PROP_VERSION"
    00075 #define         JS_PROP_PARENT_FOLDER  "PROP_PARENT_FOLDER"
    00076 #define         JS_PROP_RESOURCE_TYPE  "PROP_RESOURCE_TYPE"
    00077 #define         JS_PROP_CREATION_DATE  "PROP_CREATION_DATE"
    00078 #define         JS_PROP_REFERENCE_URI  "PROP_REFERENCE_URI"
    00079
    00080 // File resource properties
    00081 #define         JS_PROP_FILERESOURCE_HAS_DATA  "PROP_HAS_DATA"
    00082 #define         JS_PROP_FILERESOURCE_IS_REFERENCE  "PROP_IS_REFERENCE"
    00083 #define         JS_PROP_FILERESOURCE_REFERENCE_URI  "PROP_REFERENCE_URI"
    00084 #define         JS_PROP_FILERESOURCE_WSTYPE  "PROP_WSTYPE"
    00085
    00086 // Datasource properties
    00087 #define         JS_PROP_DATASOURCE_DRIVER_CLASS  "PROP_DATASOURCE_DRIVER_CLASS"
    00088 #define         JS_PROP_DATASOURCE_CONNECTION_URL  "PROP_DATASOURCE_CONNECTION_URL"
    00089 #define         JS_PROP_DATASOURCE_USERNAME  "PROP_DATASOURCE_USERNAME"
    00090 #define         JS_PROP_DATASOURCE_PASSWORD  "PROP_DATASOURCE_PASSWORD"
    00091 #define         JS_PROP_DATASOURCE_JNDI_NAME  "PROP_DATASOURCE_JNDI_NAME"
    00092 #define         JS_PROP_DATASOURCE_BEAN_NAME  "PROP_DATASOURCE_BEAN_NAME"
    00093 #define         JS_PROP_DATASOURCE_BEAN_METHOD  "PROP_DATASOURCE_BEAN_METHOD"
    00094
    00095
    00096 // ReportUnit resource properties
    00097 #define         JS_PROP_RU_DATASOURCE_TYPE  "PROP_RU_DATASOURCE_TYPE"
    00098 #define         JS_PROP_RU_IS_MAIN_REPORT  "PROP_RU_IS_MAIN_REPORT"
    00099 #define         JS_PROP_RU_INPUTCONTROL_RENDERING_VIEW  "PROP_RU_INPUTCONTROL_RENDERING_VIEW"
    00100 #define         JS_PROP_RU_REPORT_RENDERING_VIEW  "PROP_RU_REPORT_RENDERING_VIEW"
    00101
    00102 // DataType resource properties
    00103 #define         JS_PROP_DATATYPE_STRICT_MAX  "PROP_DATATYPE_STRICT_MAX"
    00104 #define         JS_PROP_DATATYPE_STRICT_MIN  "PROP_DATATYPE_STRICT_MIN"
    00105 #define         JS_PROP_DATATYPE_MIN_VALUE  "PROP_DATATYPE_MIN_VALUE"
    00106 #define         JS_PROP_DATATYPE_MAX_VALUE  "PROP_DATATYPE_MAX_VALUE"
    00107 #define         JS_PROP_DATATYPE_PATTERN  "PROP_DATATYPE_PATTERN"
    00108 #define         JS_PROP_DATATYPE_TYPE  "PROP_DATATYPE_TYPE"
    00109
    00110  // ListOfValues resource properties
    00111 #define         JS_PROP_LOV  "PROP_LOV"
    00112 #define         JS_PROP_LOV_LABEL  "PROP_LOV_LABEL"
    00113 #define         JS_PROP_LOV_VALUE  "PROP_LOV_VALUE"
    00114
    00115
    00116 // InputControl resource properties
    00117 #define         JS_PROP_INPUTCONTROL_TYPE  "PROP_INPUTCONTROL_TYPE"
    00118 #define         JS_PROP_INPUTCONTROL_IS_MANDATORY  "PROP_INPUTCONTROL_IS_MANDATORY"
    00119 #define         JS_PROP_INPUTCONTROL_IS_READONLY  "PROP_INPUTCONTROL_IS_READONLY"
    00120
    00121 // SQL resource properties
    00122 #define         JS_PROP_QUERY  "PROP_QUERY"
    00123 #define         JS_PROP_QUERY_VISIBLE_COLUMNS  "PROP_QUERY_VISIBLE_COLUMNS"
    00124 #define         JS_PROP_QUERY_VISIBLE_COLUMN_NAME  "PROP_QUERY_VISIBLE_COLUMN_NAME"
    00125 #define         JS_PROP_QUERY_VALUE_COLUMN  "PROP_QUERY_VALUE_COLUMN"
    00126 #define         JS_PROP_QUERY_LANGUAGE  "PROP_QUERY_LANGUAGE"
    00127
    00128
    00129 // SQL resource properties
    00130 #define         JS_PROP_QUERY_DATA  "PROP_QUERY_DATA"
    00131 #define         JS_PROP_QUERY_DATA_ROW  "PROP_QUERY_DATA_ROW"
    00132 #define         JS_PROP_QUERY_DATA_ROW_COLUMN  "PROP_QUERY_DATA_ROW_COLUMN"
    00133
    00134
    00135 // OLAP XMLA Connection
    00136 #define         JS_PROP_XMLA_URI  "PROP_XMLA_URI"
    00137 #define         JS_PROP_XMLA_CATALOG  "PROP_XMLA_CATALOG"
    00138 #define         JS_PROP_XMLA_DATASOURCE  "PROP_XMLA_DATASOURCE"
    00139 #define         JS_PROP_XMLA_USERNAME  "PROP_XMLA_USERNAME"
    00140 #define         JS_PROP_XMLA_PASSWORD  "PROP_XMLA_PASSWORD"
    00141
    00142 /* Argument constants */
    00143 #define         JS_ARG_MODIFY_REPORTUNIT  "MODIFY_REPORTUNIT_URI"
    00144 #define         JS_ARG_CREATE_REPORTUNIT  "CREATE_REPORTUNIT_BOOLEAN"
    00145 #define         JS_ARG_LIST_DATASOURCES   "LIST_DATASOURCES"
    00146 #define         JS_ARG_IC_GET_QUERY_DATA   "IC_GET_QUERY_DATA"
    00147 #define         JS_ARG_VALUE_TRUE  "true"
    00148 #define         JS_ARG_VALUE_FALSE  "false"
    00149 #define         JS_ARG_RUN_OUTPUT_FORMAT  "RUN_OUTPUT_FORMAT"
    00150 #define         JS_ARG_RUN_OUTPUT_FORMAT_PDF  "PDF"
    00151 #define         JS_ARG_RUN_OUTPUT_FORMAT_JRPRINT  "JRPRINT"
    00152 #define         JS_ARG_RUN_OUTPUT_FORMAT_HTML  "HTML"
    00153 #define         JS_ARG_RUN_OUTPUT_FORMAT_XLS  "XLS"
    00154 #define         JS_ARG_RUN_OUTPUT_FORMAT_XML  "XML"
    00155 #define         JS_ARG_RUN_OUTPUT_FORMAT_CSV  "CSV"
    00156 #define         JS_ARG_RUN_OUTPUT_FORMAT_RTF  "RTF"
    00157 #define         JS_ARG_RUN_OUTPUT_IMAGES_URI  "IMAGES_URI"
    00158 #define         JS_ARG_RUN_OUTPUT_PAGE  "PAGE"
    00159
    00160 /* types of operations */
    00161 #define         JS_OPERATION_RUN_REPORT  "runReport"
    00162 #define         JS_OPERATION_LIST  "list"
    00163 #define         JS_OPERATION_PUT  "put"
    00164 #define         JS_OPERATION_GET  "get"
    00165 // #define         JS_OPERATION_LOGIN  "login"  // this operation is deprecated.
    00166 #define         JS_OPERATION_CHECK_DEPENDS  "checkForDependentResources"
    00167
    00168
    00173 typedef struct jasperserver_server
    00174 {
    00175     jasperserver_string_t* url;
    00176     jasperserver_string_t* username;
    00177     jasperserver_string_t* password;
    00178 } jasperserver_server_t;
    00179
    00180
    00185 typedef struct jasperserver_resource_property
    00186 {
    00187    struct jasperserver_resource_property *next;
    00188    jasperserver_string_t* name;
    00189    jasperserver_string_t* value;
    00190    struct jasperserver_resource_property *properties;     /***<Pointer to the first child ResourceProperty (NULL means no children are available) */
    00191 } jasperserver_resource_property_t;
    00192
    00197 typedef struct jasperserver_parameter
    00198 {
    00199    struct jasperserver_parameter *next;
    00200    jasperserver_string_t* name;
    00201    jasperserver_string_t* value;
    00202    int   isListItem;
    00203 } jasperserver_parameter_t;
    00204
    00210 typedef jasperserver_parameter_t jasperserver_list_item_t;
    00211
    00217 typedef jasperserver_parameter_t jasperserver_argument_t;
    00218
    00223 typedef struct jasperserver_resource_descriptor
    00224 {
    00225     struct jasperserver_resource_descriptor *next;
    00226     jasperserver_string_t* name;
    00227     jasperserver_string_t* label;
    00228     jasperserver_string_t* description;
    00229     int   isNew;
    00230     jasperserver_string_t* wsType;
    00231     jasperserver_string_t* uriString;
    00233     struct jasperserver_resource_property *properties;
    00234     struct jasperserver_resource_descriptor *children;
    00235     struct jasperserver_parameter *parameters;
    00236 } jasperserver_resource_descriptor_t;
    00237
    00242 typedef struct jasperserver_request
    00243 {
    00244    jasperserver_resource_descriptor_t *resource;
    00245    jasperserver_string_t* opertation;
    00246    jasperserver_string_t* locale;
    00247    jasperserver_argument_t *arguments;
    00248 } jasperserver_request_t;
    00249
    00254 typedef struct jasperserver_operation_result
    00255 {
    00256    int returnCode;
    00257    jasperserver_string_t* returnMessage;
    00258    jasperserver_string_t* version;
    00259    jasperserver_resource_descriptor_t *resources;
    00260 } jasperserver_operation_result_t;
    00261
    00262
    00270 typedef struct jasperserver_list
    00271 {
    00272   struct jasperserver_list *next;
    00273 } jasperserver_list_t;
    00274
    00284 void jasperserver_list_append( jasperserver_list_t **list, jasperserver_list_t *node);
    00285
    00298 void jasperserver_list_free(jasperserver_list_t *list, void (*freeFunc)(void *) );
    00299
    00313 jasperserver_request_t * jasperserver_request_new();
    00314
    00326 void jasperserver_request_free(jasperserver_request_t *request);
    00327
    00340 jasperserver_argument_t *jasperserver_argument_new();
    00341
    00351 void jasperserver_argument_free(void *argument); //
    00352
    00365 jasperserver_resource_descriptor_t *jasperserver_resource_descriptor_new();
    00366
    00378 void jasperserver_resource_descriptor_free(void *resource_descriptor);
    00379
    00392 jasperserver_resource_property_t * jasperserver_resource_property_new();
    00393
    00405 void jasperserver_resource_property_free(void *resource_property);
    00406
    00419 jasperserver_parameter_t * jasperserver_parameter_new();
    00420
    00432 void jasperserver_parameter_free(void *parameter); // jasperserver_parameter_t * assumed
    00433
    00446 jasperserver_operation_result_t * jasperserver_operation_result_new();
    00447
    00459 void jasperserver_operation_result_free(void *op_ptr);
    00460
    00473 jasperserver_server_t * jasperserver_server_new();
    00474 void jasperserver_server_free(void *op_ptr);
    00475
    00484 void jasperserver_print_resource_descriptor(jasperserver_resource_descriptor_t *rd, int depth);
    00485
    00486
    00498 jasperserver_string_t *jasperserver_get_property_value(jasperserver_resource_descriptor_t *resource, char *propName);
    00499
    00510 jasperserver_resource_property_t *jasperserver_get_property(jasperserver_resource_descriptor_t *resource, char *propName);
    00511 #endif