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

Last change on this file since 13418 was 13418, checked in by Garth Braithwaite, 3 years ago

admin, view - finished initiatives xml, dataset and view dimension xml structs. Before moving datasets into IP xml. View added default attribution for maps.

File size: 11.3 KB
1<?xml version="1.0" encoding="UTF-8"?>
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.   
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).
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.
35<beans default-lazy-init="false" default-autowire="no"
36        xmlns=""
37        xmlns:xsi=""
38        xsi:schemaLocation=""
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>
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>
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>
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>
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.
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="">
115                                <description>
116                                        Output format used for publishing.  Defined here because several
117                                        types of publishing beans use this so defined in one spot.
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>
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>
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>
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>
160        <bean id="publishOrgUnitsController" 
161                parent="publishDataBeanCollectionToXMLFileProperties" 
162                class="org.ibisph.databean.springmvc.PublishCollectionToXMLFileController"
163        >
164                <property name="filePathAndName"    value="#{publishOrgUnitsXMLFilePathAndName.string}"/>
165                <property name="dataBeanClassName"  value="org.ibisph.indicatorprofile.databean.OrgUnit"/>
166                <property name="rootXMLElementName" value="ORG_UNITS"/>
167        </bean>
170        <bean id="publishIndicatorToXMLFileProperties" abstract="true">
171                <property name="dataBeanDAOService"            ref="commonDataBeanDAOService"/>
172                <property name="indicatorDataBeanToXMLService" ref="indicatorDataBeanToXMLService"/>
173                <property name="indicatorDatasetDataBeanToXMLService" ref="indicatorDatasetDataBeanToXMLService"/>
174                <property name="indicatorViewDataBeanToXMLService" ref="indicatorViewDataBeanToXMLService"/>
175                <property name="publishedIndicatorsXMLService" ref="publishPublishedIndicatorsXMLService"/>
176                <property name="filePath"                      value="#{publishIndicatorProfileXMLPath.string}"/>
177                <property name="documentDAOService">
178                        <bean class="org.ibisph.xml.service.FileStoredDocumentDAO">
179                                <description>
180                                        Main file service used to persist IP xml files.  This differs
181                                        from the standard XML output simply in pretty printing and
182                                        escaping.
183                                </description>
184                                <property name="basePath" ref="publishBaseXMLPathURL"/>
185                                <property name="outputFormat">
186                                        <bean class="">
187                                                <description>
188                                                        Output format used for publishing IPs.  Main thing is can't
189                                                        trim text for the embedded CR formatting.
190                                                </description>
191                                                <property name="encoding"      value="ISO-8859-1"/>
192                                                <property name="indentSize"    value="1"/>     <!-- count of indents -->
193                                                <property name="indent"        value="&#09;"/> <!-- tab value: &#09; = horizontal tab or spaces etc -->
194                                                <property name="newlines"      value="true"/>  <!-- if true puts next element on new line -->
195                                                <property name="padText"       value="false"/> <!-- if true just adds extra blank line inbetween... -->
196                                                <property name="trimText"      value="false"/>  <!-- must be false for embedded data CRs -->
197                                        </bean>
198                                </property>
199                                <property name="dateFormat"           ref="commonDateFormat"/>
200                                <property name="fileBackupFactory"    ref="publishVersionedFileBackupFactory"/>
201                                <property name="escapeTextWhenSaving" value="true"/>
202                        </bean>
203                </property>
204        </bean>
205        <bean id="publishIndicatorController"
206                class="org.ibisph.indicatorprofile.springmvc.databean.PublishIndicatorToXMLFileController"
207                parent="publishIndicatorToXMLFileProperties" 
208        />
209        <bean id="publishIndicatorAllApprovedController" 
210                class="org.ibisph.indicatorprofile.springmvc.databean.PublishAllApprovedIndicatorsToXMLFileController"
211                parent="publishIndicatorToXMLFileProperties" 
212        />
Note: See TracBrowser for help on using the repository browser.