source: main/trunk/ibisph-admin/src/main/webapp/WEB-INF/config/spring/publish.xml @ 17155

Last change on this file since 17155 was 17155, checked in by Garth Braithwaite, 9 months ago

db, admin, view - Added the proxy flag to dimension definitions. Updated the admin and view apps to auto build the published ip xml file. Removed suppress warning message. Removed filebackup code and handlers.

File size: 17.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!--
4        This file contains bean controller definitions for publishing content
5        directly to XML files.  This mechanism can be used when the admin and view
6        apps exist on the same server or if the admin app and view app have access
7        to a shared/common file server.  Direct file publishing offers several key
8        advantages when compared to the remote publishing mechanism:
9        1) Easiest to configure as no URL addresses are needed to be configured
10           (if remote need to configure both admin and view apps to talk).
11        2) Fast as the controller writes the file directly and does not use the 2
12           phase net request cycle.
13        3) Provides a solution that can be combined with a repository.   
14
15        If the applications are on separate app servers then the remote publishing
16        mechanism should be used.  Note that the dispatcher servlet URL to
17        controller mapping should not need to be touched.  For the admin app the
18        publish controllers are named the same so no changes are needed (nor are any
19        changes needed for the web.xml mappings).  For the view app, the publish
20        controllers are never invoked by the direct file admin publishing objects/
21        controllers so again no need to update those properties or bean definitions
22        (unless a sys admin does not want those objects loaded into memory).
23
24        Direct XML file Publishing Usage:
25        1) make sure that this Spring application context (this bean definition file)
26        is specified in the WEB-INF/web.xml file - in place of remote publishing (it
27        does NOT matter how the view app is configured as this writes directly). 
28        2) adjust XML paths as needed.  IF the admin and view applications are
29        deployed as peers to each other (same directory level) and the view app is
30        deployed as "ibisph-view" then you will not need to edit any of the below
31        paths.  Otherwise edit the path's and system ID's below to match the enviro
32        where you want your admin app to save the published XML files to.
33-->
34
35<beans default-lazy-init="false" default-autowire="no"
36        xmlns="http://www.springframework.org/schema/beans"
37        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
38        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
39>
40
41        <!--  R E S O U R C E S  -->
42        <!-- Used when app wired for publishing IPs directly to dir.  This bean
43          provides published_indicators.xml file management.
44        -->
45        <bean id="publishXMLEncodingScheme" class="org.ibisph.model.StringHolder">
46                <description>
47                        XML encoding scheme used when creating an XML file and Request character
48                        encoding.  Both of these should work: "UTF-8", "ISO-8859-1", however, UTF-8
49                        had some problems with some data.  ISO-8859-1 is an 8 bit subset of the 16
50                        bit unicode UTF-8 character set and is used for western english characters.
51                </description>
52                <constructor-arg value="ISO-8859-1"/>
53        </bean>
54
55        <bean id="publishXMLBasePath" class="org.ibisph.model.StringHolder">
56                <description>
57                        XML base file path used by most XML path type bean configurations. 
58                        This provides a mechanism to easily locate files to a directory
59                        outside of the webapp.  If the value is set relative to this app
60                        e.g. "xml" then the view app will need to be configured to get the
61                        IP XML from this app's "xml" dir.  The default is to use a relative
62                        path to the assumed ibisph-view/xml directory.  This value is easily
63                        overridden via the ss.props or ss.xml config mechanisms and can be
64                        a complete file path or relative to this admin webapp's context.
65                </description>
66                <constructor-arg value="../ibisph-view/xml"/>
67        </bean>
68        <bean id="publishBaseXMLPathURL" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
69                <property name="targetObject" ref="commonContextAndPathService"/>
70                <property name="targetMethod" value="getPathURL"/>
71                <property name="arguments"><list><value>#{publishXMLBasePath.string}</value></list></property>
72        </bean>
73
74        <bean id="publishAncillaryValuesXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
75                <constructor-arg value="ancillary_values.xml"/>
76        </bean>
77        <bean id="publishChartsXMLFilePathAndName" class="org.ibisph.model.StringHolder">       
78                <constructor-arg value="charts.xml"/>
79        </bean>
80        <bean id="publishDataSourcesXMLFilePathAndName" class="org.ibisph.model.StringHolder"> 
81                <constructor-arg value="data_sources.xml"/>
82        </bean>
83        <bean id="publishDimensionsXMLFilePathAndName" class="org.ibisph.model.StringHolder">   
84                <constructor-arg value="dimensions.xml"/>
85        </bean>
86        <bean id="publishIndicatorSetsXMLFilePathAndName" class="org.ibisph.model.StringHolder">       
87                <constructor-arg value="indicator/indicator_sets.xml"/>
88        </bean>
89        <bean id="publishMapsXMLFilePathAndName" class="org.ibisph.model.StringHolder"> 
90                <constructor-arg value="maps.xml"/>
91        </bean>
92        <bean id="publishMeasuresXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
93                <constructor-arg value="measures.xml"/>
94        </bean>
95        <bean id="publishOrgUnitsXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
96                <constructor-arg value="org_units.xml"/>
97        </bean>
98        <bean id="publishTopicsXMLFilePathAndName" class="org.ibisph.model.StringHolder">       
99                <constructor-arg value="topics.xml"/>
100        </bean>
101        <bean id="publishValueAttributesXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
102                <constructor-arg value="value_attributes.xml"/>
103        </bean>
104        <bean id="publishValueTypesXMLFilePathAndName" class="org.ibisph.model.StringHolder">   
105                <constructor-arg value="value_types.xml"/>
106        </bean>
107
108        <bean id="publishPublishedIndicatorsXMLFilePathAndName" class="org.ibisph.model.StringHolder">
109                <description>used by indicator indexes</description>
110                <constructor-arg value="indicator/published_indicators.xml"/>
111        </bean>
112        <bean id="publishIndicatorProfileXMLPath" class="org.ibisph.model.StringHolder">
113                <constructor-arg value="indicator/profile"/>
114        </bean>
115
116
117        <bean id="publisBackupFileDateSerialNumberDateFormat" class="java.text.SimpleDateFormat">
118                <constructor-arg value="yyyy-MM-dd-HH-mm-ss-SS"/>
119                <constructor-arg type="java.util.Locale" ref="commonLocale"/>
120        </bean>
121
122
123        <!--  S E R V I C E S  -->
124        <bean id="publishDocumentDAOService" class="org.ibisph.xml.service.FileStoredDocumentDAO">
125                <description>
126                        Main file service used to persist xml files.
127
128                        XML Text Escaping.  This property controls if the system will escape
129                        known XML reserved characters prior to saving/creating the XML
130                        content.  The default value is true (escape) and is highly
131                        recommended that it be enabled.  Setting this value to false while
132                        using a dumbed down XSLT text block handling template allows HTML
133                        to be embedded within text fields.  It should be noted that any
134                        invalid HTML will break the XML from being able to be generated/
135                        published to the view system.  Also, the [CR] to [BR/] element will
136                        NOT be auto replaced so this will have to be encoded manually
137                        within the text.
138                </description>
139                <property name="basePath" ref="publishBaseXMLPathURL"/>
140                <property name="outputFormat">
141                        <bean class="org.dom4j.io.OutputFormat">
142                                <description>
143                                        Output format used for publishing.  Defined here because several
144                                        types of publishing beans use this so defined in one spot.
145
146                                        HTML/XML encoding scheme used when creating an XML file and Request
147                                        character encoding.  Both of these should work: "UTF-8", "ISO-8859-1",
148                                        however, UTF-8 had some problems with some data.  ISO-8859-1 is an 8
149                                        bit subset of the 16 bit unicode UTF-8 character set and is used for
150                                        western english characters.
151                                </description>
152                                <property name="encoding"      value="#{publishXMLEncodingScheme.string}"/>
153                                <property name="indentSize"    value="1"/>     <!-- count of indents -->
154                                <property name="indent"        value="&#09;"/> <!-- tab value: &#09; = horizontal tab or spaces etc -->
155                                <property name="newlines"      value="true"/>  <!-- if true puts next element on new line -->
156                                <property name="padText"       value="false"/> <!-- if true just adds extra blank line inbetween... -->
157                                <property name="trimText"      value="true"/>  <!-- cleans up dom4j extra line feeds and white space -->
158                        </bean>
159                </property>
160                <property name="dateFormat"           ref="commonDateFormat"/>
161                <property name="escapeTextWhenSaving" value="true"/>
162        </bean>
163
164        <bean id="publishPublishedIndicatorsXMLService" class="org.ibisph.indicatorprofile.service.PublishedIndicatorsXML">
165                <property name="publishedIndicatorsFilePathAndName" value="#{publishPublishedIndicatorsXMLFilePathAndName.string}"/>
166                <property name="indicatorProfileFilePath"           value="#{publishIndicatorProfileXMLPath.string}"/>
167                <property name="documentDAOService"                 ref="publishDocumentDAOService"/>
168        </bean>
169
170
171        <!-- This method invoke call verifies the existance of the published
172                indicators XML file.  If it does not exist then creates it based on the
173                existing IP XML files.  This is useful for new deployments or if the XML
174                is corrupt etc.  Typically used when the adopter wants to rebuild the
175                XML (1. delete the published IPs XML file, 2. restart the app).  The
176                admin app is responsible to maintain the published IPs XML file via an
177                IP publish request so this call should not be needed.  It is provided as
178                a safety feature that some direct content adopters may want to include.
179        -->
180        <bean id="publishVerifyPublishedIndicatorsXMLFileService" 
181                class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"
182        >
183                <property name="targetObject" ref="publishPublishedIndicatorsXMLService"/>
184                <property name="targetMethod" value="verifyPublishedIndicatorsXMLFile"/>
185        </bean>
186
187
188
189        <!--  C O N T R O L L E R S  -->
190        <bean id="publishDataBeanCollectionToXMLFileProperties" abstract="true">
191                <property name="dataBeanDAOService"   ref="commonDataBeanDAOService"/>
192                <property name="dataBeanToXMLService" ref="commonDataBeanToXMLService"/>
193                <property name="documentDAOService"   ref="publishDocumentDAOService"/>
194        </bean>
195
196        <bean id="publishAncillaryValuesController" 
197                parent="publishDataBeanCollectionToXMLFileProperties" 
198                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
199        >
200                <property name="filePathAndName"         value="#{publishAncillaryValuesXMLFilePathAndName.string}"/>
201                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.AncillaryValue"/>
202                <property name="containerXMLElementName" value="ANCILLARY_VALUES"/>
203        </bean>
204
205        <bean id="publishDataSourcesController" 
206                parent="publishDataBeanCollectionToXMLFileProperties" 
207                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
208        >
209                <property name="filePathAndName"         value="#{publishDataSourcesXMLFilePathAndName.string}"/>
210                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.DataSource"/>
211                <property name="containerXMLElementName" value="DATA_SOURCES"/>
212        </bean>
213
214        <bean id="publishDimensionsController" 
215                parent="publishDataBeanCollectionToXMLFileProperties" 
216                class="org.ibisph.indicatorprofile.springmvc.databean.PublishDimensionsToXMLFileController"
217        >
218                <property name="filePathAndName"    value="#{publishDimensionsXMLFilePathAndName.string}"/>
219        </bean>
220
221        <bean id="publishChartsController" 
222                parent="publishDataBeanCollectionToXMLFileProperties" 
223                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
224        >
225                <property name="filePathAndName"         value="#{publishChartsXMLFilePathAndName.string}"/>
226                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.Chart"/>
227                <property name="containerXMLElementName" value="CHARTS"/>
228        </bean>
229
230        <bean id="publishMapsController" 
231                parent="publishDataBeanCollectionToXMLFileProperties" 
232                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
233        >
234                <property name="filePathAndName"         value="#{publishMapsXMLFilePathAndName.string}"/>
235                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.Map"/>
236                <property name="containerXMLElementName" value="MAPS"/>
237        </bean>
238
239        <bean id="publishMeasuresController" 
240                parent="publishDataBeanCollectionToXMLFileProperties" 
241                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
242        >
243                <property name="filePathAndName"         value="#{publishMeasuresXMLFilePathAndName.string}"/>
244                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.Measure"/>
245                <property name="containerXMLElementName" value="MEASURES"/>
246        </bean>
247
248        <bean id="publishOrgUnitsController" 
249                parent="publishDataBeanCollectionToXMLFileProperties" 
250                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
251        >
252                <property name="filePathAndName"         value="#{publishOrgUnitsXMLFilePathAndName.string}"/>
253                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.OrgUnit"/>
254                <property name="containerXMLElementName" value="ORG_UNITS"/>
255        </bean>
256
257        <bean id="publishValueAttributesController" 
258                parent="publishDataBeanCollectionToXMLFileProperties" 
259                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
260        >
261                <property name="filePathAndName"         value="#{publishValueAttributesXMLFilePathAndName.string}"/>
262                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.ValueAttribute"/>
263                <property name="containerXMLElementName" value="VALUE_ATTRIBUTES"/>
264        </bean>
265
266        <bean id="publishValueTypesController" 
267                parent="publishDataBeanCollectionToXMLFileProperties" 
268                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
269        >
270                <property name="filePathAndName"         value="#{publishValueTypesXMLFilePathAndName.string}"/>
271                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.ValueType"/>
272                <property name="containerXMLElementName" value="VALUE_TYPES"/>
273        </bean>
274
275        <bean id="publishTopicsController" 
276                parent="publishDataBeanCollectionToXMLFileProperties" 
277                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
278        >
279                <property name="filePathAndName"         value="#{publishTopicsXMLFilePathAndName.string}"/>
280                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.Topic"/>
281                <property name="containerXMLElementName" value="TOPICS"/>
282        </bean>
283
284
285        <bean id="publishIndicatorSetsController" 
286                parent="publishDataBeanCollectionToXMLFileProperties" 
287                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
288        >
289                <property name="filePathAndName"         value="#{publishIndicatorSetsXMLFilePathAndName.string}"/>
290                <property name="dataBeanClassName"       value="org.ibisph.indicatorprofile.databean.IndicatorSet"/>
291                <property name="containerXMLElementName" value="INDICATOR_SETS"/>
292                <property name="primrayKeyFieldName" value="NAME"/>
293
294                <property name="childDataBeanClassName"  value="org.ibisph.indicatorprofile.databean.IndicatorToIndicatorSet"/>
295                <property name="childParentKeyFieldName" value="INDICATOR_SET_NAME"/>
296                <property name="childDataBeanCollectionFieldName" value="INDICATOR_TO_INDICATOR_SETS"/>
297        </bean>
298
299        <bean id="publishIndicatorToXMLFileProperties" abstract="true">
300                <property name="dataBeanDAOService"            ref="commonDataBeanDAOService"/>
301                <property name="indicatorDataBeanToXMLService" ref="indicatorDataBeanToXMLService"/>
302                <property name="indicatorViewDataBeanToXMLService" ref="indicatorViewDataBeanToXMLService"/>
303                <property name="publishedIndicatorsXMLService" ref="publishPublishedIndicatorsXMLService"/>
304                <property name="filePath"                      value="#{publishIndicatorProfileXMLPath.string}"/>
305                <property name="documentDAOService">
306                        <bean class="org.ibisph.xml.service.FileStoredDocumentDAO">
307                                <description>
308                                        Main file service used to persist IP xml files.  This differs
309                                        from the standard XML output simply in pretty printing and
310                                        escaping.
311                                </description>
312                                <property name="basePath" ref="publishBaseXMLPathURL"/>
313                                <property name="outputFormat">
314                                        <bean class="org.dom4j.io.OutputFormat">
315                                                <description>
316                                                        Output format used for publishing IPs.  Main thing is can't
317                                                        trim text for the embedded CR formatting.
318                                                </description>
319                                                <property name="encoding"      value="#{publishXMLEncodingScheme.string}"/>
320                                                <property name="indentSize"    value="1"/>     <!-- count of indents -->
321                                                <property name="indent"        value="&#09;"/> <!-- tab value: &#09; = horizontal tab or spaces etc -->
322                                                <property name="newlines"      value="true"/>  <!-- if true puts next element on new line -->
323                                                <property name="padText"       value="false"/> <!-- if true just adds extra blank line inbetween... -->
324                                                <property name="trimText"      value="false"/>  <!-- must be false for embedded data CRs -->
325                                        </bean>
326                                </property>
327                                <property name="dateFormat" ref="commonDateFormat"/>
328                                <property name="escapeTextWhenSaving" value="true"/>
329                        </bean>
330                </property>
331        </bean>
332
333        <bean id="publishIndicatorController"
334                class="org.ibisph.indicatorprofile.springmvc.databean.PublishIndicatorToXMLFileController"
335                parent="publishIndicatorToXMLFileProperties" 
336        />
337
338        <bean id="publishIndicatorAllApprovedController" 
339                class="org.ibisph.indicatorprofile.springmvc.databean.PublishAllApprovedIndicatorsToXMLFileController"
340                parent="publishIndicatorToXMLFileProperties" 
341        />
342
343</beans>
344
Note: See TracBrowser for help on using the repository browser.