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

Last change on this file since 6920 was 6920, checked in by Garth Braithwaite, 6 years ago

view, admin, java - Updated XML output formatting for IP and regular XML docs. IPs need to keep white space for the embedded CRs. All others need to have whitespace stripped. Fixed kendo pie chart config. Fixed published date in the IP xml.

File size: 11.7 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="publishCategorizedIndexXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
69                <description>used by indicator indexes</description>
70                <constructor-arg value="indicator/categorized_index.xml"/>
71        </bean>
72        <bean id="publishOrgUnitsXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
73                <description>used by indicator indexes</description>
74                <constructor-arg value="org_units.xml"/>
75        </bean>
76        <bean id="publishPublishedIndicatorProfilesXMLFilePathAndName" class="org.ibisph.model.StringHolder">
77                <description>used by indicator indexes</description>
78                <constructor-arg value="indicator/published_profiles.xml"/>
79        </bean>
80        <bean id="publishIndicatorProfileXMLPath" class="org.ibisph.model.StringHolder">
81                <constructor-arg value="indicator/profile"/>
82        </bean>
83
84        <bean id="publishBaseXMLPathURL" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
85                <property name="targetObject" ref="commonContextAndPathService"/>
86                <property name="targetMethod" value="getPathURL"/>
87                <property name="arguments"><list><value>#{publishXMLBasePath.string}</value></list></property>
88        </bean>
89
90        <bean id="publisBackupFileDateSerialNumberDateFormat" class="java.text.SimpleDateFormat">
91                <constructor-arg value="yyyy-MM-dd-HH-mm-ss-SS"/>
92                <constructor-arg type="java.util.Locale" ref="commonLocale"/>
93        </bean>
94
95
96        <!--  S E R V I C E S  -->
97        <bean id="publishDocumentDAOService" class="org.ibisph.xml.service.FileStoredDocumentDAO">
98                <description>
99                        Main file service used to persist xml files.
100
101                        XML Text Escaping.  This property controls if the system will escape
102                        known XML reserved characters prior to saving/creating the XML
103                        content.  The default value is true (escape) and is highly
104                        recommended that it be enabled.  Setting this value to false while
105                        using a dumbed down XSLT text block handling template allows HTML
106                        to be embedded within text fields.  It should be noted that any
107                        invalid HTML will break the XML from being able to be generated/
108                        published to the view system.  Also, the [CR] to [BR/] element will
109                        NOT be auto replaced so this will have to be encoded manually
110                        within the text.
111                </description>
112                <property name="basePath"             ref="publishBaseXMLPathURL"/>
113                <property name="outputFormat">
114                        <bean class="org.dom4j.io.OutputFormat">
115                                <description>
116                                        Output format used for publishing.  Defined here because several
117                                        types of publishing beans use this so defined in one spot.
118
119                                        HTML/XML encoding scheme used when creating an XML file and Request
120                                        character encoding.  Both of these should work: "UTF-8", "ISO-8859-1",
121                                        however, UTF-8 had some problems with some data.  ISO-8859-1 is an 8
122                                        bit subset of the 16 bit unicode UTF-8 character set and is used for
123                                        western english characters.
124                                </description>
125                                <property name="encoding"      value="ISO-8859-1"/>
126                                <property name="indentSize"    value="1"/>     <!-- count of indents -->
127                                <property name="indent"        value="&#09;"/> <!-- tab value: &#09; = horizontal tab or spaces etc -->
128                                <property name="newlines"      value="true"/>  <!-- if true puts next element on new line -->
129                                <property name="padText"       value="false"/> <!-- if true just adds extra blank line inbetween... -->
130                                <property name="trimText"      value="true"/>  <!-- cleans up dom4j extra line feeds and white space -->
131                        </bean>
132                </property>
133                <property name="dateFormat"           ref="commonDateFormat"/>
134                <property name="fileBackupFactory"    ref="publishVersionedFileBackupFactory"/>
135                <property name="escapeTextWhenSaving" value="true"/>
136        </bean>
137
138        <bean id="publishVersionedFileBackupFactory" class="org.ibisph.filebackup.VersionedFileBackupFactory">
139                <property name="backupType"               value="1"/>
140                <property name="autoDeleteBackupWhenDone" value="false"/>
141                <property name="backupExtensionPrefix"    value="backup-"/>
142                <property name="backupExtensionSuffixDateFormat" ref="publisBackupFileDateSerialNumberDateFormat"/>
143                <property name="maxBackupVersions"        value="0"/>
144        </bean>
145
146        <bean id="publishPublishedIndicatorsXMLService" class="org.ibisph.indicatorprofile.service.PublishedIndicatorsXML">
147                <property name="publishedIndicatorsFilePathAndName" value="#{publishPublishedIndicatorProfilesXMLFilePathAndName.string}"/>
148                <property name="indicatorProfileFilePath"           value="#{publishIndicatorProfileXMLPath.string}"/>
149                <property name="documentDAOService"                 ref="publishDocumentDAOService"/>
150        </bean>
151
152
153        <!--  C O N T R O L L E R S  -->
154        <bean id="publishDataBeanCollectionToXMLFileProperties" abstract="true">
155                <property name="dataBeanDAOService"   ref="commonDataBeanDAOService"/>
156                <property name="dataBeanToXMLService" ref="commonDataBeanToXMLService"/>
157                <property name="documentDAOService"   ref="publishDocumentDAOService"/>
158        </bean>
159
160        <bean id="publishCategorizedIndexController" 
161                parent="publishDataBeanCollectionToXMLFileProperties" 
162                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
163        >
164                <property name="filePathAndName"    value="#{publishCategorizedIndexXMLFilePathAndName.string}"/>
165                <property name="dataBeanClassName"  value="org.ibisph.indicatorprofile.databean.CategorizedIndex"/>
166                <property name="rootXMLElementName" value="CATEGORIZED_INDEXES"/>
167        </bean>
168
169        <bean id="publishOrgUnitsController" 
170                parent="publishDataBeanCollectionToXMLFileProperties" 
171                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
172        >
173                <property name="filePathAndName"    value="#{publishOrgUnitsXMLFilePathAndName.string}"/>
174                <property name="dataBeanClassName"  value="org.ibisph.indicatorprofile.databean.OrgUnit"/>
175                <property name="rootXMLElementName" value="ORG_UNITS"/>
176        </bean>
177
178
179        <bean id="publishIndicatorToXMLFileProperties" abstract="true">
180                <property name="dataBeanDAOService"            ref="commonDataBeanDAOService"/>
181                <property name="indicatorDataBeanToXMLService" ref="indicatorDataBeanToXMLService"/>
182                <property name="indicatorViewDataBeanToXMLService" ref="indicatorViewDataBeanToXMLService"/>
183                <property name="publishedIndicatorsXMLService" ref="publishPublishedIndicatorsXMLService"/>
184                <property name="filePath"                      value="#{publishIndicatorProfileXMLPath.string}"/>
185                <property name="documentDAOService">
186                        <bean class="org.ibisph.xml.service.FileStoredDocumentDAO">
187                                <description>
188                                        Main file service used to persist IP xml files.  This differs
189                                        from the standard XML output simply in pretty printing and
190                                        escaping.
191                                </description>
192                                <property name="basePath" ref="publishBaseXMLPathURL"/>
193                                <property name="outputFormat">
194                                        <bean class="org.dom4j.io.OutputFormat">
195                                                <description>
196                                                        Output format used for publishing IPs.  Main thing is can't
197                                                        trim text for the embedded CR formatting.
198                                                </description>
199                                                <property name="encoding"      value="ISO-8859-1"/>
200                                                <property name="indentSize"    value="1"/>     <!-- count of indents -->
201                                                <property name="indent"        value="&#09;"/> <!-- tab value: &#09; = horizontal tab or spaces etc -->
202                                                <property name="newlines"      value="true"/>  <!-- if true puts next element on new line -->
203                                                <property name="padText"       value="false"/> <!-- if true just adds extra blank line inbetween... -->
204                                                <property name="trimText"      value="false"/>  <!-- must be false for embedded data CRs -->
205                                        </bean>
206                                </property>
207                                <property name="dateFormat"           ref="commonDateFormat"/>
208                                <property name="fileBackupFactory"    ref="publishVersionedFileBackupFactory"/>
209                                <property name="escapeTextWhenSaving" value="true"/>
210                        </bean>
211                </property>
212        </bean>
213        <bean id="publishIndicatorController"
214                class="org.ibisph.indicatorprofile.springmvc.databean.PublishIndicatorToXMLFileController"
215                parent="publishIndicatorToXMLFileProperties" 
216        />
217        <bean id="publishIndicatorAllApprovedController" 
218                class="org.ibisph.indicatorprofile.springmvc.databean.PublishAllApprovedIndicatorsToXMLFileController"
219                parent="publishIndicatorToXMLFileProperties" 
220        />
221
222</beans>
223
Note: See TracBrowser for help on using the repository browser.