From: <pka...@us...> - 2009-06-09 07:58:06
|
Revision: 243 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=243&view=rev Author: pkasprzak Date: 2009-06-09 07:57:58 +0000 (Tue, 09 Jun 2009) Log Message: ----------- * Use only one XSLT to generate messages Modified Paths: -------------- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/CourseToCDDMCourseMessage.xsl trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output.xml Added Paths: ----------- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output_output.xml trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/toCDDMMessages.xsl Modified: trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/CourseToCDDMCourseMessage.xsl =================================================================== --- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/CourseToCDDMCourseMessage.xsl 2009-06-09 07:41:17 UTC (rev 242) +++ trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/CourseToCDDMCourseMessage.xsl 2009-06-09 07:57:58 UTC (rev 243) @@ -26,9 +26,11 @@ <xsl:comment>##### Creating course (<xsl:value-of select="dt:title"/>) #####</xsl:comment> <xsl:element name="courseMessage"> <xsl:element name="course"> - <xsl:element name="busId">1</xsl:element> + <xsl:element name="busId">0</xsl:element> <xsl:element name="eventTime">2000-01-20T12:00:00</xsl:element> - <xsl:for-each select="*[position() < 6]"> + + <!-- Generate attributes --> + <xsl:for-each select="*"> <xsl:comment>----- Attribute: <xsl:value-of select="local-name(.)"/> -----</xsl:comment> <xsl:element name="attribute"> <xsl:element name="name"> @@ -42,6 +44,11 @@ </xsl:element> </xsl:element> </xsl:for-each> + + <!-- Generate category references --> + <xsl:for-each select=""> + </xsl:for-each> + </xsl:element> <xsl:element name="eventTime">2000-01-20T12:00:00</xsl:element> <xsl:element name="inputEvent">CREATE_UPDATE</xsl:element> Modified: trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel 2009-06-09 07:41:17 UTC (rev 242) +++ trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel 2009-06-09 07:57:58 UTC (rev 243) @@ -27,34 +27,54 @@ <partnerLink name="LSF" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" partnerLinkType="tns:LSFClientAdapter" myRole="LSFClientAdapterPortTypeRole"/> </partnerLinks> <variables> - <variable name="XSLTTransformOperationOut" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/XSLTTransform" messageType="tns:XSLTTransformOperationResponse"/> - <variable name="XSLTTransformOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/XSLTTransform" messageType="tns:XSLTTransformOperationRequest"/> - <variable name="ReceiveIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" messageType="tns:receiveRequest"/> - <variable name="synchronizationMessage" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" element="lsfdt:synchronizationMessage"/> + <variable name="XSLTTransformOperationOut" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/XSLTTransform" messageType="tns:XSLTTransformOperationResponse"/> + <variable name="XSLTTransformOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/XSLTTransform" messageType="tns:XSLTTransformOperationRequest"/> + <variable name="ReceiveIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" messageType="tns:receiveRequest"/> + + <variable name="SynchronizationMessage" element="lsfdt:synchronizationMessage"/> + <variable name="Messages" element="dt:messages"/> </variables> <sequence> - <receive name="receive" createInstance="yes" partnerLink="LSF" operation="receive" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" portType="tns:LSFClientAdapterPortType" variable="ReceiveIn"/> + <receive name="receive" createInstance="yes" partnerLink="LSF" operation="receive" + xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" + portType="tns:LSFClientAdapterPortType" + variable="ReceiveIn"/> <assign name="prepareXSLTTransform"> <copy> <from variable="ReceiveIn" part="InputData"/> <to variable="XSLTTransformOperationIn" part="inputXML"/> </copy> </assign> - <invoke name="doXSLTTransform" partnerLink="XSLTTransform" operation="XSLTTransformOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/XSLTTransform" portType="tns:XSLTTransformPortType" inputVariable="XSLTTransformOperationIn" outputVariable="XSLTTransformOperationOut"/> - <assign name="convertResult"> + + <invoke name="doXSLTTransform" partnerLink="XSLTTransform" operation="XSLTTransformOperation" + xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/XSLTTransform" + portType="tns:XSLTTransformPortType" + inputVariable="XSLTTransformOperationIn" + outputVariable="XSLTTransformOperationOut"/> + + <assign name="unmarshalResult"> +<!-- <sxt:trace> -<!-- - <sxt:log level="info" location="onStart"> - <ns0:from>concat('XSLT-Transofmation-Output: ', $XSLTTransformOperationOut.result)</ns0:from> - </sxt:log> + <sxt:log level="info" location="onStart"> + <ns0:from>concat('*** XSLT-Transformation-Output: ', $XSLTTransformOperationOut.result)</ns0:from> + </sxt:log> + </sxt:trace> --> + <copy> + <from>sxxf:doUnMarshal($XSLTTransformOperationOut.result)</from> + <to variable="SynchronizationMessage"/> + </copy> + </assign> + + <assign name="convertToMessages"> + <sxt:trace> <sxt:log level="info" location="onComplete"> - <ns0:from>concat('Variable.SemesterName: ', $synchronizationMessage/semesterName)</ns0:from> + <ns0:from>concat('*** Messages: ', sxxf:doMarshal($Messages))</ns0:from> </sxt:log> </sxt:trace> <copy> - <from>sxxf:doUnMarshal($XSLTTransformOperationOut.result)</from> - <to variable="synchronizationMessage"/> + <from>ns0:doXslTransform('urn:stylesheets:toCDDMMessages.xsl', $SynchronizationMessage)</from> + <to>$Messages</to> </copy> </assign> @@ -66,7 +86,7 @@ </sxt:log> </sxt:trace> <startCounterValue>1</startCounterValue> - <finalCounterValue>count($synchronizationMessage/courses/course[.])</finalCounterValue> + <finalCounterValue>count($Messages/dt:courseMessages/*)</finalCounterValue> <scope name="invokeObjectProcessorForCourseMessages"> <variables> <variable name="ProcessCourseOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ObjectProcessor" messageType="tns:ProcessCourseOperationRequest"/> @@ -79,18 +99,20 @@ <to variable="ProcessCourseOperationIn" part="clientInstanceId"/> </copy> <copy> - <from>$synchronizationMessage/courses/course[$CourseCounter]/clientId</from> + <from>$Messages/dt:courseMessages/dt:courseMessage[$CourseCounter]/dt:course/dt:attribute[dt:name = 'clientId']/dt:value</from> <to variable="ProcessCourseOperationIn" part="clientObjectId"/> </copy> </assign> - <!-- Copy relevant attributes --> + <!-- Extract message --> <assign name="transformCourseToCDDMCourseMessage"> <copy> - <from>ns0:doXslTransform('urn:stylesheets:CourseToCDDMCourseMessage.xsl', $synchronizationMessage/courses/course[$CourseCounter])</from> + <from>$Messages/dt:courseMessages/dt:courseMessage[$CourseCounter]</from> <to>$ProcessCourseOperationIn.courseMessage</to> </copy> </assign> - <invoke name="processCourseMessage" partnerLink="ObjectProcessor" operation="ProcessCourseOperation" portType="ns1:ObjectProcessorPortType" inputVariable="ProcessCourseOperationIn"/> + <invoke name="processCourseMessage" partnerLink="ObjectProcessor" operation="ProcessCourseOperation" + portType="ns1:ObjectProcessorPortType" + inputVariable="ProcessCourseOperationIn"/> </sequence> </scope> </forEach> @@ -103,7 +125,7 @@ </sxt:log> </sxt:trace> <startCounterValue>1</startCounterValue> - <finalCounterValue>count($synchronizationMessage/categories/category[.])</finalCounterValue> + <finalCounterValue>count($Messages/dt:courseMessages/*)</finalCounterValue> <scope name="invokeObjectProcessorForCategoryMessages"> <variables> <variable name="ProcessCategoryOperationIn" messageType="ns1:ProcessCategoryOperationRequest"/> @@ -116,24 +138,21 @@ <to variable="ProcessCategoryOperationIn" part="clientInstanceId"/> </copy> <copy> - <from>$synchronizationMessage/categories/category[$CategoryCounter]/clientId</from> + <from>$Messages/dt:categoryMessages/dt:categoryMessage[$CategoryCounter]/dt:category/dt:attribute[dt:name = 'clientId']/dt:value</from> <to variable="ProcessCategoryOperationIn" part="clientObjectId"/> </copy> </assign> <!-- Copy relevant attributes --> <assign name="transformCategoryToCDDMCategoryMessage"> <copy> - <from>ns0:doXslTransform('urn:stylesheets:CategoryToCDDMCategoryMessage.xsl', $synchronizationMessage/categories/category[$CategoryCounter])</from> + <from>$Messages/dt:categoryMessages/dt:categoryMessage[$CategoryCounter]</from> <to>$ProcessCategoryOperationIn.categoryMessage</to> </copy> </assign> - <invoke name="processCategoryMessage" partnerLink="ObjectProcessor" operation="ProcessCategoryOperation" portType="ns1:ObjectProcessorPortType" inputVariable="ProcessCategoryOperationIn"> - <sxt:trace> - <sxt:log level="info" location="onStart"> - <ns0:from>concat('*** Sending CategoryMessage: ', $ProcessCategoryOperationIn.categoryMessage)</ns0:from> - </sxt:log> - </sxt:trace> - </invoke> + <invoke name="processCategoryMessage" partnerLink="ObjectProcessor" operation="ProcessCategoryOperation" + portType="ns1:ObjectProcessorPortType" + inputVariable="ProcessCategoryOperationIn"/> + </sequence> </scope> </forEach> Modified: trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output.xml =================================================================== --- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output.xml 2009-06-09 07:41:17 UTC (rev 242) +++ trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output.xml 2009-06-09 07:57:58 UTC (rev 243) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<synchronizationMessage xmlns="http://cse.campussource.de/schema/DataTypes"> +<synchronizationMessage xmlns="http://cse.campussource.de/schema/LSFDataTypes"> <isSyncMessage>true</isSyncMessage> <semesterName>SS 2008</semesterName> <semesterLsfId>20081</semesterLsfId> Added: trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output_output.xml =================================================================== --- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output_output.xml (rev 0) +++ trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/sync-test_output_output.xml 2009-06-09 07:57:58 UTC (rev 243) @@ -0,0 +1,680 @@ +<?xml version="1.0" encoding="UTF-8"?> +<messages xmlns="http://cse.campussource.de/schema/DataTypes"> +<courseMessages> +<!--##### Creating course (Tutorium-Test) #####--> +<courseMessage> +<course> +<busId>0</busId> +<eventTime>2000-01-20T12:00:00</eventTime> +<!--- - - - - Attribute: lsfId - - - - - --> +<attribute> +<name>lsfId</name> +<value>32350</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: logicalNumber - - - - - --> +<attribute> +<name>logicalNumber</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: type - - - - - --> +<attribute> +<name>type</name> +<value>Tutorium</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: title - - - - - --> +<attribute> +<name>title</name> +<value>Tutorium-Test</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: shortDescription - - - - - --> +<attribute> +<name>shortDescription</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: abbreviation - - - - - --> +<attribute> +<name>abbreviation</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: necessaryAssignment - - - - - --> +<attribute> +<name>necessaryAssignment</name> +<value>J</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: note - - - - - --> +<attribute> +<name>note</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: comment - - - - - --> +<attribute> +<name>comment</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterAsInt - - - - - --> +<attribute> +<name>semesterAsInt</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterPeriodsPerWeek - - - - - --> +<attribute> +<name>semesterPeriodsPerWeek</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: expectedRegistrations - - - - - --> +<attribute> +<name>expectedRegistrations</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: maximumRegistrations - - - - - --> +<attribute> +<name>maximumRegistrations</name> +<value>20</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: activityConfirmation - - - - - --> +<attribute> +<name>activityConfirmation</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: lectureTypeId - - - - - --> +<attribute> +<name>lectureTypeId</name> +<value>40</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: active - - - - - --> +<attribute> +<name>active</name> +<value>A</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterAbbr - - - - - --> +<attribute> +<name>semesterAbbr</name> +<value>SS 2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterFull - - - - - --> +<attribute> +<name>semesterFull</name> +<value>SS 2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: dates - - - - - --> +<attribute> +<name>dates</name> +<value> + + + + 14:00 + 16:00 + + + Montag + wöchentlich + + + + + 14:00 + 15:00 + + + Mittwoch + wöchentlich + + </value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: clientId - - - - - --> +<attribute> +<name>clientId</name> +<value>lecture:32350</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterId - - - - - --> +<attribute> +<name>semesterId</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: startDate - - - - - --> +<attribute> +<name>startDate</name> +<value>14.04.2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: endDate - - - - - --> +<attribute> +<name>endDate</name> +<value>18.07.2008</value> +<transient>false</transient> +</attribute> +<categories> +<category>category:10482</category> +</categories> +</course> +<eventTime>2000-01-20T12:00:00</eventTime> +<inputEvent>CREATE_UPDATE</inputEvent> +</courseMessage> +<!--##### Creating course (Phonetische Aspekte des Sorbischen) #####--> +<courseMessage> +<course> +<busId>0</busId> +<eventTime>2000-01-20T12:00:00</eventTime> +<!--- - - - - Attribute: lsfId - - - - - --> +<attribute> +<name>lsfId</name> +<value>28232</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: logicalNumber - - - - - --> +<attribute> +<name>logicalNumber</name> +<value>28232</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: type - - - - - --> +<attribute> +<name>type</name> +<value>Hauptseminar</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: title - - - - - --> +<attribute> +<name>title</name> +<value>Phonetische Aspekte des Sorbischen</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: shortDescription - - - - - --> +<attribute> +<name>shortDescription</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: abbreviation - - - - - --> +<attribute> +<name>abbreviation</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: necessaryAssignment - - - - - --> +<attribute> +<name>necessaryAssignment</name> +<value>N</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: note - - - - - --> +<attribute> +<name>note</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: comment - - - - - --> +<attribute> +<name>comment</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterAsInt - - - - - --> +<attribute> +<name>semesterAsInt</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterPeriodsPerWeek - - - - - --> +<attribute> +<name>semesterPeriodsPerWeek</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: expectedRegistrations - - - - - --> +<attribute> +<name>expectedRegistrations</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: maximumRegistrations - - - - - --> +<attribute> +<name>maximumRegistrations</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: activityConfirmation - - - - - --> +<attribute> +<name>activityConfirmation</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: lectureTypeId - - - - - --> +<attribute> +<name>lectureTypeId</name> +<value>98</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: active - - - - - --> +<attribute> +<name>active</name> +<value>A</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: languageISO - - - - - --> +<attribute> +<name>languageISO</name> +<value>de</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: languageFull - - - - - --> +<attribute> +<name>languageFull</name> +<value>deutsch</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterAbbr - - - - - --> +<attribute> +<name>semesterAbbr</name> +<value>SS 2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterFull - - - - - --> +<attribute> +<name>semesterFull</name> +<value>SS 2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: dates - - - - - --> +<attribute> +<name>dates</name> +<value> + + + + 10:00 + 12:00 + + + Freitag + wöchentlich + + </value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: clientId - - - - - --> +<attribute> +<name>clientId</name> +<value>lecture:28232</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterId - - - - - --> +<attribute> +<name>semesterId</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: startDate - - - - - --> +<attribute> +<name>startDate</name> +<value>14.04.2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: endDate - - - - - --> +<attribute> +<name>endDate</name> +<value>18.07.2008</value> +<transient>false</transient> +</attribute> +<categories> +<category>category:10512</category> +</categories> +</course> +<eventTime>2000-01-20T12:00:00</eventTime> +<inputEvent>CREATE_UPDATE</inputEvent> +</courseMessage> +<!--##### Creating course (Numerical Algorithms for Visual Computing I) #####--> +<courseMessage> +<course> +<busId>0</busId> +<eventTime>2000-01-20T12:00:00</eventTime> +<!--- - - - - Attribute: lsfId - - - - - --> +<attribute> +<name>lsfId</name> +<value>28481</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: logicalNumber - - - - - --> +<attribute> +<name>logicalNumber</name> +<value>28481</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: type - - - - - --> +<attribute> +<name>type</name> +<value>Weiterführende Vorlesung</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: title - - - - - --> +<attribute> +<name>title</name> +<value>Numerical Algorithms for Visual Computing I</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: shortDescription - - - - - --> +<attribute> +<name>shortDescription</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: abbreviation - - - - - --> +<attribute> +<name>abbreviation</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: necessaryAssignment - - - - - --> +<attribute> +<name>necessaryAssignment</name> +<value>N</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: note - - - - - --> +<attribute> +<name>note</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: comment - - - - - --> +<attribute> +<name>comment</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterAsInt - - - - - --> +<attribute> +<name>semesterAsInt</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterPeriodsPerWeek - - - - - --> +<attribute> +<name>semesterPeriodsPerWeek</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: expectedRegistrations - - - - - --> +<attribute> +<name>expectedRegistrations</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: maximumRegistrations - - - - - --> +<attribute> +<name>maximumRegistrations</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: activityConfirmation - - - - - --> +<attribute> +<name>activityConfirmation</name> +<value/> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: lectureTypeId - - - - - --> +<attribute> +<name>lectureTypeId</name> +<value>147</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: active - - - - - --> +<attribute> +<name>active</name> +<value>A</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: languageISO - - - - - --> +<attribute> +<name>languageISO</name> +<value>en</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: languageFull - - - - - --> +<attribute> +<name>languageFull</name> +<value>englisch</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterAbbr - - - - - --> +<attribute> +<name>semesterAbbr</name> +<value>SS 2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterFull - - - - - --> +<attribute> +<name>semesterFull</name> +<value>SS 2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: dates - - - - - --> +<attribute> +<name>dates</name> +<value> + + + + 16:00 + 18:00 + + + Montag + wöchentlich + + </value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: clientId - - - - - --> +<attribute> +<name>clientId</name> +<value>lecture:28481</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterId - - - - - --> +<attribute> +<name>semesterId</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: startDate - - - - - --> +<attribute> +<name>startDate</name> +<value>14.04.2008</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: endDate - - - - - --> +<attribute> +<name>endDate</name> +<value>18.07.2008</value> +<transient>false</transient> +</attribute> +<categories> +<category>category:10512</category> +</categories> +</course> +<eventTime>2000-01-20T12:00:00</eventTime> +<inputEvent>CREATE_UPDATE</inputEvent> +</courseMessage> +</courseMessages> +<categoryMessages> +<!--##### Creating category (Vorlesungsverzeichnis) #####--> +<categoryMessage> +<category> +<busId>0</busId> +<eventTime>2000-01-20T12:00:00</eventTime> +<!--- - - - - Attribute: clientId - - - - - --> +<attribute> +<name>clientId</name> +<value>category:11517</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterId - - - - - --> +<attribute> +<name>semesterId</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: lsfId - - - - - --> +<attribute> +<name>lsfId</name> +<value>11517</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: name - - - - - --> +<attribute> +<name>name</name> +<value>Vorlesungsverzeichnis</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: sort - - - - - --> +<attribute> +<name>sort</name> +<value>0</value> +<transient>false</transient> +</attribute> +</category> +<eventTime>2000-01-20T12:00:00</eventTime> +<inputEvent>CREATE_UPDATE</inputEvent> +</categoryMessage> +<!--##### Creating category (Fakultät 4 (Sprach-, Literatur- u. Kulturwissenschaften)) #####--> +<categoryMessage> +<category> +<busId>0</busId> +<eventTime>2000-01-20T12:00:00</eventTime> +<!--- - - - - Attribute: clientId - - - - - --> +<attribute> +<name>clientId</name> +<value>category:10477</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterId - - - - - --> +<attribute> +<name>semesterId</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: lsfId - - - - - --> +<attribute> +<name>lsfId</name> +<value>10477</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: name - - - - - --> +<attribute> +<name>name</name> +<value>Fakultät 4 (Sprach-, Literatur- u. Kulturwissenschaften)</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: sort - - - - - --> +<attribute> +<name>sort</name> +<value>1040</value> +<transient>false</transient> +</attribute> +</category> +<eventTime>2000-01-20T12:00:00</eventTime> +<inputEvent>CREATE_UPDATE</inputEvent> +</categoryMessage> +<!--##### Creating category (Fakultät 1 (Rechts- u. Wirtschaftswissenschaft)) #####--> +<categoryMessage> +<category> +<busId>0</busId> +<eventTime>2000-01-20T12:00:00</eventTime> +<!--- - - - - Attribute: clientId - - - - - --> +<attribute> +<name>clientId</name> +<value>category:10482</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterId - - - - - --> +<attribute> +<name>semesterId</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: lsfId - - - - - --> +<attribute> +<name>lsfId</name> +<value>10482</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: name - - - - - --> +<attribute> +<name>name</name> +<value>Fakultät 1 (Rechts- u. Wirtschaftswissenschaft)</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: sort - - - - - --> +<attribute> +<name>sort</name> +<value>1010</value> +<transient>false</transient> +</attribute> +</category> +<eventTime>2000-01-20T12:00:00</eventTime> +<inputEvent>CREATE_UPDATE</inputEvent> +</categoryMessage> +<!--##### Creating category (Neue Bachelorstudiengänge der phil. Fakultäten (Fakultäten 3 - 5)) #####--> +<categoryMessage> +<category> +<busId>0</busId> +<eventTime>2000-01-20T12:00:00</eventTime> +<!--- - - - - Attribute: clientId - - - - - --> +<attribute> +<name>clientId</name> +<value>category:10512</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: semesterId - - - - - --> +<attribute> +<name>semesterId</name> +<value>20081</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: lsfId - - - - - --> +<attribute> +<name>lsfId</name> +<value>10512</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: name - - - - - --> +<attribute> +<name>name</name> +<value>Neue Bachelorstudiengänge der phil. Fakultäten (Fakultäten 3 - 5)</value> +<transient>false</transient> +</attribute> +<!--- - - - - Attribute: sort - - - - - --> +<attribute> +<name>sort</name> +<value>1300</value> +<transient>false</transient> +</attribute> +</category> +<eventTime>2000-01-20T12:00:00</eventTime> +<inputEvent>CREATE_UPDATE</inputEvent> +</categoryMessage> +</categoryMessages> +</messages> Added: trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/toCDDMMessages.xsl =================================================================== --- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/toCDDMMessages.xsl (rev 0) +++ trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/toCDDMMessages.xsl 2009-06-09 07:57:58 UTC (rev 243) @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Document : toCDDMMessages.xsl + Created on : April 16, 2009, 10:18 PM + Author : pete + Description: Transform "old" CSE -> CDDM-Messages + +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:dt="http://cse.campussource.de/schema/LSFDataTypes" + xmlns="http://cse.campussource.de/schema/DataTypes" + version="1.0"> + + <xsl:output method="xml" + media-type="text/xml" + indent="yes" + encoding="UTF-8" + omit-xml-declaration="no"/> + + <xsl:template match="/dt:synchronizationMessage"> + <xsl:element name="messages"> + + <!-- Generate course-messages --> + <xsl:element name="courseMessages"> + <xsl:for-each select="/dt:synchronizationMessage/dt:courses/*"> + <xsl:comment>##### Creating course (<xsl:value-of select="dt:title"/>) #####</xsl:comment> + <xsl:element name="courseMessage"> + <xsl:element name="course"> + <xsl:element name="busId">0</xsl:element> + <xsl:element name="eventTime">2000-01-20T12:00:00</xsl:element> + + <!-- Generate attributes --> + <xsl:for-each select="*"> + <xsl:comment>----- Attribute: <xsl:value-of select="local-name(.)"/> -----</xsl:comment> + <xsl:element name="attribute"> + <xsl:element name="name"> + <xsl:value-of select="local-name(.)"/> + </xsl:element> + <xsl:element name="value"> + <xsl:value-of select="."/> + </xsl:element> + <xsl:element name="transient"> + <xsl:text>false</xsl:text> + </xsl:element> + </xsl:element> + </xsl:for-each> + + <xsl:variable name="clientId" select="dt:clientId"/> + + <!-- Generate category references --> + <xsl:element name="categories"> + <xsl:for-each select="/dt:synchronizationMessage/dt:relations/*[dt:clientChildId = $clientId and dt:relationType = 'category_to_lectures']"> + <xsl:element name="category"><xsl:value-of select="dt:clientParentId"/></xsl:element> + </xsl:for-each> + </xsl:element> + + </xsl:element> + <xsl:element name="eventTime">2000-01-20T12:00:00</xsl:element> + <xsl:element name="inputEvent">CREATE_UPDATE</xsl:element> + </xsl:element> + + </xsl:for-each> + </xsl:element> + + <!-- Generate category-messages --> + <xsl:element name="categoryMessages"> + <xsl:for-each select="/dt:synchronizationMessage/dt:categories/*"> + <xsl:comment>##### Creating category (<xsl:value-of select="dt:name"/>) #####</xsl:comment> + <xsl:element name="categoryMessage"> + <xsl:element name="category"> + <xsl:element name="busId">0</xsl:element> + <xsl:element name="eventTime">2000-01-20T12:00:00</xsl:element> + + <!-- Generate attributes --> + <xsl:for-each select="*"> + <xsl:comment>----- Attribute: <xsl:value-of select="local-name(.)"/> -----</xsl:comment> + <xsl:element name="attribute"> + <xsl:element name="name"> + <xsl:value-of select="local-name(.)"/> + </xsl:element> + <xsl:element name="value"> + <xsl:value-of select="."/> + </xsl:element> + <xsl:element name="transient"> + <xsl:text>false</xsl:text> + </xsl:element> + </xsl:element> + </xsl:for-each> + </xsl:element> + <xsl:element name="eventTime">2000-01-20T12:00:00</xsl:element> + <xsl:element name="inputEvent">CREATE_UPDATE</xsl:element> + </xsl:element> + </xsl:for-each> + </xsl:element> + + </xsl:element> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |