Changeset 1002

Show
Ignore:
Timestamp:
11/07/07 22:27:49 (1 year ago)
Author:
mikey
Message:

added target to create the processor configuration, implements enhancement #57, still needs to be tested within a build and to be integrated into the setup process

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/resources/phing/build-stubbles.xml

    r686 r1002  
    11<?xml version="1.0"?> 
    22<project name="Stubbles" basedir="." default="main"> 
     3  <property name="processors.default.file" value="config/xml/processors.xml" /> 
    34  <taskDef name="stubInit" classname="stubInitTask" classpath="${project.basedir}/src/main/php/info/phing/tasks" /> 
    45  <taskDef name="stubGenerateJsonRpcProxies" classname="stubGenerateJsonRpcProxiesTask" classpath="${project.basedir}/src/main/php/info/phing/tasks" /> 
     
    7273        <echo>JSON-RPC initialization skipped.</echo> 
    7374      </else> 
     75    </if> 
     76  </target> 
     77 
     78  <!-- Set up all processors to be used --> 
     79  <target name="setup-processors" description="Setup processor configuration"> 
     80    <input propertyname="processors.xml" promptChar="?" defaultValue="Y">Do you want to enable XML/XSL processor? (Y/N)</input> 
     81    <if> 
     82      <or> 
     83        <equals arg1="${processors.xml}" arg2="Y"/> 
     84        <equals arg1="${processors.xml}" arg2="y"/> 
     85      </or> 
     86      <then> 
     87        <echo level="warning">Please do not forget to add the required pre- and postinterceptors for the XML/XSL processor.</echo> 
     88        <input propertyname="processors.default.select" promptChar="?" defaultValue="Y">Do you want to use this as the default one? (Y/N)</input> 
     89        <if> 
     90          <or> 
     91            <equals arg1="${processors.default.select}" arg2="Y"/> 
     92            <equals arg1="${processors.default.select}" arg2="y"/> 
     93          </or> 
     94          <then> 
     95            <property name="processors.default.value" value="xml" /> 
     96          </then> 
     97        </if> 
     98      </then> 
     99    </if> 
     100    <input propertyname="processors.memphis" promptChar="?" defaultValue="N">Do you want to enable Memphis processor? (Y/N)</input> 
     101    <if> 
     102      <and> 
     103        <or> 
     104          <equals arg1="${processors.memphis}" arg2="Y"/> 
     105          <equals arg1="${processors.memphis}" arg2="y"/> 
     106        </or> 
     107        <not> 
     108          <isset property="processors.default.value"/> 
     109        </not> 
     110      </and> 
     111      <then> 
     112        <input propertyname="processors.default.select" promptChar="?" defaultValue="Y">Do you want to use this as the default one? (Y/N)</input> 
     113        <if> 
     114          <or> 
     115            <equals arg1="${processors.default.select}" arg2="Y"/> 
     116            <equals arg1="${processors.default.select}" arg2="y"/> 
     117          </or> 
     118          <then> 
     119            <property name="processors.default.value" value="memphis" /> 
     120          </then> 
     121        </if> 
     122      </then> 
     123    </if> 
     124    <input propertyname="processors.rte" promptChar="?" defaultValue="N">Do you want to enable RTE processor? (Y/N)</input> 
     125    <if> 
     126      <and> 
     127        <or> 
     128          <equals arg1="${processors.rte}" arg2="Y"/> 
     129          <equals arg1="${processors.rte}" arg2="y"/> 
     130        </or> 
     131        <not> 
     132          <isset property="processors.default.value"/> 
     133        </not> 
     134      </and> 
     135      <then> 
     136        <input propertyname="processors.default.select" promptChar="?" defaultValue="Y">Do you want to use this as the default one? (Y/N)</input> 
     137        <if> 
     138          <or> 
     139            <equals arg1="${processors.default.select}" arg2="Y"/> 
     140            <equals arg1="${processors.default.select}" arg2="y"/> 
     141          </or> 
     142          <then> 
     143            <property name="processors.default.value" value="rte" /> 
     144          </then> 
     145        </if> 
     146      </then> 
     147    </if> 
     148    <append destFile="${processors.default.file}" text="&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt; 
     149&lt;xj:configuration 
     150    xmlns:xj=&quot;http://xjconf.net/XJConf&quot; 
     151    xmlns=&quot;http://stubbles.net/websites&quot;&gt; 
     152  &lt;defaultResolver default=&quot;${processors.default.value}&quot;&gt;"/> 
     153    <if> 
     154      <or> 
     155        <equals arg1="${processors.xml}" arg2="Y"/> 
     156        <equals arg1="${processors.xml}" arg2="y"/> 
     157      </or> 
     158      <then> 
     159        <append destFile="${processors.default.file}" text="&lt;processor name=&quot;xml&quot; type=&quot;net.stubbles.websites.xml.stubXMLProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
     160      </then> 
     161    </if> 
     162    <if> 
     163      <or> 
     164        <equals arg1="${processors.memphis}" arg2="Y"/> 
     165        <equals arg1="${processors.memphis}" arg2="y"/> 
     166      </or> 
     167      <then> 
     168        <append destFile="${processors.default.file}" text="&lt;processor name=&quot;memphis&quot; type=&quot;net.stubbles.websites.memphis.stubMemphisProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
     169      </then> 
     170    </if> 
     171    <if> 
     172      <or> 
     173        <equals arg1="${processors.rte}" arg2="Y"/> 
     174        <equals arg1="${processors.rte}" arg2="y"/> 
     175      </or> 
     176      <then> 
     177        <append destFile="${processors.default.file}" text="&lt;processor name=&quot;rte&quot; type=&quot;net.stubbles.websites.rasmus.stubRasmusProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
     178      </then> 
     179    </if> 
     180    <if> 
     181      <or> 
     182        <equals arg1="${jsonrpc.enabled}" arg2="Y"/> 
     183        <equals arg1="${jsonrpc.enabled}" arg2="y"/> 
     184      </or> 
     185      <then> 
     186        <append destFile="${processors.default.file}" text="&lt;processor name=&quot;jsonrpc&quot; type=&quot;net.stubbles.service.jsonrpc.stubJsonRpcProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
     187      </then> 
     188    </if> 
     189    <append destFile="${processors.default.file}" text="&lt;/defaultResolver&gt; 
     190&lt;/xj:configuration&gt;"/> 
     191    <if> 
     192      <not> 
     193        <isset property="processors.default.value"/> 
     194      </not> 
     195      <then> 
     196        <echo level="warning">Warning: No default processor selected. Please edit config/xml/processors.xml to select the correct default processor or re-run phing setup-processors</echo> 
     197      </then> 
    74198    </if> 
    75199  </target>