You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by rf...@apache.org on 2010/07/09 08:55:41 UTC
svn commit: r962428 - in /lenya/contributions/2_0_X/modules/xmldiff: ./
config/ config/cocoon-xconf/ config/cocoon-xconf/tab/ java/ java/lib/
java/src/ java/src/org/ java/src/org/apache/ java/src/org/apache/lenya/
java/src/org/apache/lenya/modules/ jav...
Author: rfrovarp
Date: Fri Jul 9 06:55:39 2010
New Revision: 962428
URL: http://svn.apache.org/viewvc?rev=962428&view=rev
Log:
Initial commit of XML Diff module from GSoC 2009.
Thanks to Alexander Sizemin who created the code.
Thanks to Google for funding GSoC.
Added:
lenya/contributions/2_0_X/modules/xmldiff/
lenya/contributions/2_0_X/modules/xmldiff/build.xml
lenya/contributions/2_0_X/modules/xmldiff/config/
lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/
lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/
lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/tabs.xconf
lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff-revisions.xconf
lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff.xconf
lenya/contributions/2_0_X/modules/xmldiff/config/module.xml
lenya/contributions/2_0_X/modules/xmldiff/java/
lenya/contributions/2_0_X/modules/xmldiff/java/lib/
lenya/contributions/2_0_X/modules/xmldiff/java/lib/daisydiff.jar (with props)
lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-compare.jar (with props)
lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-core-runtime-20070801.jar (with props)
lenya/contributions/2_0_X/modules/xmldiff/java/lib/nekohtml.jar (with props)
lenya/contributions/2_0_X/modules/xmldiff/java/lib/xercesImpl-2.8.0.jar (with props)
lenya/contributions/2_0_X/modules/xmldiff/java/src/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/DiffUsecase.java
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/RevisionsDiffUsecase.java
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/util/
lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/util/ArrayUtil.java
lenya/contributions/2_0_X/modules/xmldiff/java/test/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/LcsDiffTest.java
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test1.xml
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test2.xml
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/DiffTest.java
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test1.xml
lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test2.xml
lenya/contributions/2_0_X/modules/xmldiff/patches/
lenya/contributions/2_0_X/modules/xmldiff/patches/usecase-policies.patch
lenya/contributions/2_0_X/modules/xmldiff/readme.txt
lenya/contributions/2_0_X/modules/xmldiff/resources/
lenya/contributions/2_0_X/modules/xmldiff/resources/css/
lenya/contributions/2_0_X/modules/xmldiff/resources/css/diff.css
lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/
lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui.xml
lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui_ru.xml
lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/
lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/diffTips.js
lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/revselection.js
lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_EN.properties
lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_UK.properties
lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_US.properties
lenya/contributions/2_0_X/modules/xmldiff/resources/messages_ru_RU.properties
lenya/contributions/2_0_X/modules/xmldiff/test/
lenya/contributions/2_0_X/modules/xmldiff/usecases/
lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/
lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/diff.jx
lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/revisions.jx
Added: lenya/contributions/2_0_X/modules/xmldiff/build.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/build.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/build.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/build.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,36 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project default="build" basedir="." name="XMLdiff module">
+
+ <target name="build" depends="patch,copy-resources"/>
+
+ <target name="patch">
+ <patch strip="0" patchfile="patches/usecase-policies.patch" dir="../../.."/>
+
+ </target>
+
+ <target name="copy-resources">
+ <copy todir="../../../${build.webapp}/WEB-INF/classes" flatten="true">
+ <fileset dir="java">
+ <include name="**/*.xsl"/>
+ <include name="**/*.properties"/>
+ </fileset>
+ </copy>
+ </target>
+
+</project>
\ No newline at end of file
Added: lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/tabs.xconf
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/tabs.xconf?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/tabs.xconf (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/tabs.xconf Fri Jul 9 06:55:39 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: usecases-workflow-deactivate.xconf 348547 2005-11-23 20:13:01Z chestnut $ -->
+<!--
+ This file defines the publication specific use-cases
+
+unless="/cocoon/gui-manager/tab-group[@name = 'site']"
+-->
+
+ <xconf xpath="/cocoon/gui-manager/tab-group[@name = 'site']" >
+ <tab name="xmldiff" label="XMLDiff" usecase="tab.xmldiff-revisions" unless="/cocoon/gui-manager/tab-group[@name = 'site']/tab[@name='xmldiff']"/>
+ </xconf>
+
+
Added: lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff-revisions.xconf
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff-revisions.xconf?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff-revisions.xconf (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff-revisions.xconf Fri Jul 9 06:55:39 2010
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: usecases-workflow-deactivate.xconf 348547 2005-11-23 20:13:01Z chestnut $ -->
+<!--
+ This file defines the publication specific use-cases
+
+TODO:
+ <parameter name="workflowEvent" value="edit"/>
+ helps to pass param to class
+-->
+
+ <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'tab.xmldiff-revisions']">
+ <component-instance name="tab.xmldiff-revisions" logger="lenya.site" class="org.apache.lenya.modules.xmldiff.usecases.RevisionsDiffUsecase">
+ <view uri="modules/xmldiff/usecases/tab/revisions.jx" menu="true"
+ createContinuation="false">
+ <tab group="site" name="xmldiff"/>
+ </view>
+ <exit usecase="tab.xmldiff"/>
+ </component-instance>
+ </xconf>
+
Added: lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff.xconf
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff.xconf?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff.xconf (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/config/cocoon-xconf/tab/usecase-tab-xmldiff.xconf Fri Jul 9 06:55:39 2010
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: usecases-workflow-deactivate.xconf 348547 2005-11-23 20:13:01Z chestnut $ -->
+<!--
+ This file defines the publication specific use-cases
+-->
+
+
+
+ <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'tab.xmldiff']">
+ <component-instance name="tab.xmldiff" logger="lenya.site" class="org.apache.lenya.modules.xmldiff.usecases.DiffUsecase">
+ <view uri="modules/xmldiff/usecases/tab/diff.jx" menu="true"
+ createContinuation="false">
+ <tab group="site" name="xmldiff"/>
+ </view>
+ <exit usecase="tab.xmldiff-revisions" />
+ </component-instance>
+ </xconf>
+
Added: lenya/contributions/2_0_X/modules/xmldiff/config/module.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/config/module.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/config/module.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/config/module.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,23 @@
+<module xmlns="http://apache.org/lenya/module/1.0">
+ <id>org.apache.lenya.modules.xmldiff</id>
+
+
+<!-- <export package="org.apache.lenya.cms.ac.usecases"/> -->
+ <depends module="org.apache.lenya.modules.usecase"/>
+ <depends module="org.apache.lenya.modules.workflow"/>
+ <depends module="org.apache.lenya.modules.sitemanagement"/>
+ <depends module="org.apache.lenya.modules.ac"/>
+ <depends module="org.apache.lenya.modules.acusecases"/>
+ <depends module="org.apache.lenya.modules.ldap"/>
+ <depends module="org.apache.lenya.modules.monitoring"/>
+ <depends module="org.apache.lenya.modules.linking"/>
+ <depends module="org.apache.lenya.modules.notification"/>
+
+ <package>org.apache.lenya.modules</package>
+ <version>0.1-dev</version>
+ <name>XML diff tool</name>
+ <lenya-version>2.0-dev</lenya-version>
+ <description>
+ This is an XML diff tool
+ </description>
+</module>
\ No newline at end of file
Added: lenya/contributions/2_0_X/modules/xmldiff/java/lib/daisydiff.jar
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/lib/daisydiff.jar?rev=962428&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/contributions/2_0_X/modules/xmldiff/java/lib/daisydiff.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-compare.jar
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-compare.jar?rev=962428&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-compare.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-core-runtime-20070801.jar
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-core-runtime-20070801.jar?rev=962428&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/contributions/2_0_X/modules/xmldiff/java/lib/eclipse-core-runtime-20070801.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lenya/contributions/2_0_X/modules/xmldiff/java/lib/nekohtml.jar
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/lib/nekohtml.jar?rev=962428&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/contributions/2_0_X/modules/xmldiff/java/lib/nekohtml.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lenya/contributions/2_0_X/modules/xmldiff/java/lib/xercesImpl-2.8.0.jar
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/lib/xercesImpl-2.8.0.jar?rev=962428&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/contributions/2_0_X/modules/xmldiff/java/lib/xercesImpl-2.8.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/DiffUsecase.java
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/DiffUsecase.java?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/DiffUsecase.java (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/DiffUsecase.java Fri Jul 9 06:55:39 2010
@@ -0,0 +1,236 @@
+package org.apache.lenya.modules.xmldiff.usecases;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Locale;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.lenya.cms.repository.History;
+import org.apache.lenya.cms.repository.Revision;
+import org.apache.lenya.cms.site.usecases.SiteUsecase;
+import org.apache.lenya.cms.usecase.UsecaseException;
+import org.apache.lenya.modules.xmldiff.util.ArrayUtil;
+import org.outerj.daisy.diff.DaisyDiff;
+import org.outerj.daisy.diff.HtmlCleaner;
+import org.outerj.daisy.diff.html.HTMLDiffer;
+import org.outerj.daisy.diff.html.SimpleDiffOutput;
+import org.outerj.daisy.diff.html.TextNodeComparator;
+import org.outerj.daisy.diff.html.dom.BodyNode;
+import org.outerj.daisy.diff.html.dom.DomTreeBuilder;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+public class DiffUsecase extends SiteUsecase {
+
+ protected static final String NEWER_REVISION_PARAM = "newer_revision_num";
+ protected static final String ELDER_REVISION_PARAM = "elder_revison_num";
+ protected static final String PARAM_DIFFERENCES = "differences";
+
+ private Revision elderRevision;
+ private Revision newerRevision;
+
+ protected void prepareView() throws Exception {
+ super.prepareView();
+ prepareRevisions();
+ if (!hasErrors()) {
+ prepareHTMLView(elderRevision.getInputStream(), newerRevision
+ .getInputStream());
+ prepareXMLView(elderRevision.getInputStream(), newerRevision
+ .getInputStream());
+ }
+ }
+
+ public String getParameterAsString(String name, String defaultValue) {
+ String parameter = super.getParameterAsString(name, defaultValue);
+ if ("".equals(parameter)) {
+ parameter = defaultValue;
+ }
+ return parameter;
+ }
+
+ protected void prepareRevisions() throws Exception {
+ History history = getSourceDocument().getRepositoryNode().getHistory();
+ int[] revNumbers = history.getRevisionNumbers();
+ String nrevn = getParameterAsString(NEWER_REVISION_PARAM, "-1");
+ String erevn = getParameterAsString(ELDER_REVISION_PARAM, "-1");
+ int newerRevisionNum = Integer.valueOf(nrevn).intValue();
+ int elderRevisionNum = Integer.valueOf(erevn).intValue();
+ if (newerRevisionNum == -1) {
+ addErrorMessage("Missing parameter [" + newerRevisionNum + "]");
+ return;
+ }
+ revNumbers = ArrayUtil.unique(revNumbers);
+ int newerRevIdx = ArrayUtil
+ .findInUnsorted(revNumbers, newerRevisionNum);
+ if (newerRevIdx == -1) {
+ addErrorMessage("Revision [" + newerRevisionNum
+ + "] does not exist");
+ return;
+ }
+ if (elderRevisionNum == -1) {
+ // try get one
+ if (newerRevIdx == revNumbers.length - 1) { // if revision is the
+ // oldest
+ addErrorMessage("Revision [" + newerRevisionNum
+ + "] is the oldest.");
+ return;
+ }
+ elderRevisionNum = revNumbers[newerRevIdx + 1];
+ } else {
+ // check if exists
+ int elderRevIdx = ArrayUtil.findInUnsorted(revNumbers,
+ elderRevisionNum);
+ if (elderRevIdx == -1) {
+ addErrorMessage("Revision [" + newerRevisionNum
+ + "] does not exist");
+ return;
+ }
+ }
+ setElderRevision(history.getRevision(elderRevisionNum));
+ setNewerRevision(history.getRevision(newerRevisionNum));
+ }
+
+ protected Revision getElderRevision() {
+ return elderRevision;
+ }
+
+ protected void setElderRevision(Revision elderRevision) {
+ this.elderRevision = elderRevision;
+ }
+
+ protected Revision getNewerRevision() {
+ return newerRevision;
+ }
+
+ protected void setNewerRevision(Revision newerRevision) {
+ this.newerRevision = newerRevision;
+ }
+
+ protected void prepareHTMLView(InputStream older, InputStream newer)
+ throws Exception {
+ InputSource oldSource = new InputSource(older);
+ InputSource newSource = new InputSource(newer);
+
+ HtmlCleaner cleaner = new HtmlCleaner();
+ Locale locale = Locale.getDefault();
+
+ String prefix = "diff";
+
+ DomTreeBuilder oldHandler;
+ DomTreeBuilder newHandler;
+ try {
+ oldHandler = new DomTreeBuilder();
+ cleaner.cleanAndParse(oldSource, oldHandler);
+ newHandler = new DomTreeBuilder();
+ cleaner.cleanAndParse(newSource, newHandler);
+ } catch (Exception e) {
+ throw new UsecaseException(
+ "Error while parsing document for diffing: ", e);
+ }
+ TextNodeComparator leftComparator = new TextNodeComparator(oldHandler,
+ locale);
+ TextNodeComparator rightComparator = new TextNodeComparator(newHandler,
+ locale);
+
+ SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory
+ .newInstance();
+ TransformerHandler result = tf.newTransformerHandler();
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+ Result domResult = new StreamResult(out);
+ result.setResult(domResult);
+
+ ContentHandler htmlDiff = result;
+ // Document content filtering
+ // XslFilter filter = new XslFilter();
+ // ContentHandler postProcess = filter.xsl(result, "htmldiff.xsl");
+ try {
+ startDiffDocument(htmlDiff);
+ SimpleDiffOutput output = new SimpleDiffOutput(htmlDiff, prefix);
+ BodyNode diffNode = HTMLDiffer
+ .diff(leftComparator, rightComparator);
+ output.toHTML(diffNode);
+ finishDiffDocument(htmlDiff);
+ setParameter("html-output", DocumentBuilderFactory.newInstance()
+ .newDocumentBuilder().parse(
+ new ByteArrayInputStream(out.toByteArray()))
+ );
+ } catch (Exception e) {
+ throw new UsecaseException(
+ "Failed translating diff document to xml: ", e);
+ }
+
+ }
+
+ protected void prepareXMLView(InputStream older, InputStream newer)
+ throws UsecaseException {
+ SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory
+ .newInstance();
+
+ TransformerHandler result;
+ try {
+ result = tf.newTransformerHandler();
+ } catch (TransformerConfigurationException e) {
+ throw new UsecaseException("Failed to create handler for diff", e);
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+ Result domResult = new StreamResult(out);
+ result.setResult(domResult);
+
+ ContentHandler xmlDiff = result;
+
+ // Document content filtering
+ // XslFilter filter = new XslFilter();
+ // ContentHandler postProcess = filter.xsl(result, "tagdiff.xsl");
+
+ try {
+ startDiffDocument(xmlDiff);
+ DaisyDiff.diffTag(new BufferedReader(new InputStreamReader(older)),
+ new BufferedReader(new InputStreamReader(newer)), xmlDiff);
+ finishDiffDocument(xmlDiff);
+ } catch (Exception e) {
+ throw new UsecaseException("Failed to create diff report: ", e);
+ }
+ try {
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance()
+ .newDocumentBuilder();
+ setParameter("xml-output", builder.parse(new ByteArrayInputStream(
+ out.toByteArray())));
+ } catch (Exception e) {
+ throw new UsecaseException(
+ "Failed translating diff document to xml: ", e);
+ }
+
+ }
+
+ private static void startDiffDocument(ContentHandler document)
+ throws SAXException {
+ document.startDocument();
+ document.startElement("", "diffreport", "diffreport",
+ new AttributesImpl());
+ document.startElement("", "diff", "diff", new AttributesImpl());
+ }
+
+ private static void finishDiffDocument(ContentHandler document)
+ throws SAXException {
+ document.endElement("", "diff", "diff");
+ document.endElement("", "diffreport", "diffreport");
+ document.endDocument();
+ }
+
+}
Added: lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/RevisionsDiffUsecase.java
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/RevisionsDiffUsecase.java?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/RevisionsDiffUsecase.java (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/usecases/RevisionsDiffUsecase.java Fri Jul 9 06:55:39 2010
@@ -0,0 +1,60 @@
+package org.apache.lenya.modules.xmldiff.usecases;
+
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.repository.History;
+import org.apache.lenya.cms.repository.Revision;
+import org.apache.lenya.cms.site.usecases.SiteUsecase;
+import org.apache.lenya.cms.workflow.WorkflowUtil;
+import org.apache.lenya.workflow.Version;
+import org.apache.lenya.workflow.Workflow;
+import org.apache.lenya.workflow.Workflowable;
+
+public class RevisionsDiffUsecase extends SiteUsecase {
+
+ /**
+ * @see org.apache.lenya.cms.usecase.AbstractUsecase#initParameters()
+ *
+ */
+ protected void initParameters() {
+ super.initParameters();
+ Document sourceDoc = getSourceDocument();
+ if (sourceDoc != null) {
+ try {
+ History history = sourceDoc.getRepositoryNode().getHistory();
+
+ int[] numbers = history.getRevisionNumbers();
+ Revision[] revisions = new Revision[numbers.length];
+ for (int i = 0; i < numbers.length; i++) {
+ revisions[i] = history.getRevision(numbers[i]);
+ }
+ setParameter("revisions", revisions);
+
+ Boolean canRollback = Boolean.valueOf(WorkflowUtil.canInvoke(this.manager,
+ getDocumentFactory().getSession(), getLogger(), sourceDoc, getEvent()));
+ setParameter("canRollback", canRollback);
+
+ if (WorkflowUtil.hasWorkflow(this.manager, getSession(), getLogger(), sourceDoc)) {
+ Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager,
+ getSession(), getLogger(), sourceDoc);
+ Version latestVersion = workflowable.getLatestVersion();
+ String state;
+ if (latestVersion != null) {
+ state = latestVersion.getState();
+ } else {
+ Workflow workflow = WorkflowUtil.getWorkflowSchema(this.manager,
+ getSession(), getLogger(), sourceDoc);
+ state = workflow.getInitialState();
+ }
+ setParameter("workflowState", state);
+ }
+ } catch (final Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ protected String getEvent() {
+ return getParameterAsString("workflowEvent");
+ }
+
+}
Added: lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/util/ArrayUtil.java
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/util/ArrayUtil.java?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/util/ArrayUtil.java (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/src/org/apache/lenya/modules/xmldiff/util/ArrayUtil.java Fri Jul 9 06:55:39 2010
@@ -0,0 +1,36 @@
+package org.apache.lenya.modules.xmldiff.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+public class ArrayUtil {
+
+ public static int[] unique(int[] source) {
+ Collection temp = new ArrayList();
+ for (int i = 0; i < source.length; i++) {
+ temp.add(Integer.valueOf(source[i]));
+ }
+ HashSet set = new HashSet(temp);
+ int[] result = new int[set.size()];
+ int j = set.size() - 1;
+ for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+ Integer rn = (Integer) iterator.next();
+ result[j--] = rn.intValue();
+ }
+ return result;
+ }
+
+ public static int findInUnsorted(int[] array, int value) {
+ int j = -1;
+ int revIdx = -1;
+ while (++j < array.length) {
+ if (array[j] == value) {
+ revIdx = j;
+ }
+ }
+ return revIdx;
+ }
+
+}
Added: lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/LcsDiffTest.java
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/LcsDiffTest.java?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/LcsDiffTest.java (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/LcsDiffTest.java Fri Jul 9 06:55:39 2010
@@ -0,0 +1,108 @@
+package org.apache.lenya.modules.diff.lcs;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.lenya.modules.diff.DifferenceTree;
+import org.apache.lenya.modules.diff.DifferenceTreeWriter;
+import org.apache.lenya.modules.diff.SimpleTreeDiff;
+import org.apache.lenya.modules.diff.Tree;
+import org.apache.lenya.modules.diff.TreeDiff;
+import org.apache.lenya.modules.diff.xml.DomTreeBuilder;
+import org.apache.lenya.modules.diff.xml.DomTreeBuilderFactory;
+import org.apache.lenya.modules.diff.xml.XmlNodeWriter;
+import org.apache.lenya.xml.DocumentHelper;
+import org.w3c.dom.Document;
+
+public class LcsDiffTest extends TestCase implements DiffHandler, FragmentHandler {
+
+ public void testLcsDiff() throws Exception {
+
+ DomSerializer serializer = new DomSerializer();
+ List[] lists = new ArrayList[2];
+ for (int i = 0; i < lists.length; i++) {
+ URL url = getClass().getResource("test" + (i + 1) + ".xml");
+ Document dom = DocumentHelper.readDocument(url);
+ lists[i] = serializer.serialize(dom);
+ }
+
+ System.out.println("List 1: " + lists[0]);
+ System.out.println("List 2: " + lists[1]);
+
+ LcsDiff diff = new LcsDiff();
+ diff.diff(lists[0], lists[1], new FragmentingHandler(this));
+ }
+
+ public void added(Object newObj) throws Exception {
+ printPadded("", newObj);
+ }
+
+ public void end() throws Exception {
+ System.out.println("End");
+ }
+
+ public void equal(Object obj) throws Exception {
+ //printPadded(obj, obj);
+ }
+
+ public void removed(Object oldObj) throws Exception {
+ printPadded(oldObj, "");
+ }
+
+ public void start() throws Exception {
+ System.out.println("Start");
+ }
+
+ private static final int columnWidth = 50;
+
+ protected void printPadded(Object o1, Object o2) {
+ for (int i = 0; i < 2 * columnWidth; i++) {
+ System.out.print("-");
+ }
+ System.out.println();
+ printPadded(o1);
+ printPadded(o2);
+ System.out.println();
+ }
+
+ protected void printPadded(Object obj) {
+ String string = obj.toString();
+ System.out.print(string);
+ for (int i = string.length(); i < columnWidth; i++) {
+ System.out.print(" ");
+ }
+ }
+
+ private boolean adding = false;
+ private boolean removing = false;
+
+ public void element(Object obj) throws Exception {
+ if (adding || removing) {
+ System.out.println(" " + obj);
+ }
+ }
+
+ public void endAdding() throws Exception {
+ this.adding = false;
+ System.out.println("</add>");
+ }
+
+ public void endRemoving() throws Exception {
+ this.removing = false;
+ System.out.println("</remove>");
+ }
+
+ public void startAdding() throws Exception {
+ this.adding = true;
+ System.out.println("<add>");
+ }
+
+ public void startRemoving() throws Exception {
+ this.removing = true;
+ System.out.println("<remove>");
+ }
+
+}
Added: lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test1.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test1.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test1.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test1.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?><document>
+ <header>
+ <title>Who we are</title>
+ </header>
+ <body>
+ <section id="community">
+ <title>The Lenya Community</title>
+ <p>
+
+ The Lenya Project operates as a meritocracy: the more you do, the more
+ responsibility you will obtain. This page lists all of the people who
+ have gone the extra mile and are Committers. If you would like to get
+ involved, the first step is to join the mailing lists.
+ </p>
+ <p>
+ Of course the committers are not the only people involved in the
+ community. Thanks to the many people for their contributions of patches,
+ assistance, ideas, and email discussion. Some are mentioned at the
+ changes pages. See how we
+ <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7#contribution">acknowledge</a> contributions.
+ </p>
+ <p>
+ Please do not send emails directly to individual developers asking for
+ free support - see the Important Notices on the
+ <a href="lenya-document:dfb45860-e986-11dc-b04f-af2277a493d7">mailing lists</a> page.
+ </p>
+
+ </section>
+ <section id="committers">
+ <title>List of committers</title>
+ <p>
+ List of all people who have ever been committers at Apache Lenya,
+ sorted alphabetically.
+ </p>
+ <ul>
+ <li>Doug Chestnut (chestnut at apache.org)</li>
+
+ <li>Edith Chevrier (edith at apache.org)</li>
+ <li>Dale Christ (bigdog at apache.org)</li>
+ <li>Christian Egli (egli at apache.org)</li>
+ <li>Paul Ercolino (solprovider at apache.org)</li>
+ <li>
+ <strong>Jann Forrer (jann at apache.org)</strong>
+
+ </li>
+ <li>Richard Frovarp (rfrovarp at apache.org)</li>
+ <li>
+ <strong>Antonio Gallardo (antonio at apache.org)</strong>
+ </li>
+ <li>Bob Harner (bobharner at apache.org)</li>
+ <li>
+
+ <strong>Andreas Hartmann (andreas at apache.org)</strong>
+ </li>
+ <li>
+ <strong>J. Wolfgang Kaltz (jwkaltz at apache.org)</strong>
+ </li>
+ <li>Andreas Kuckartz (aku at apache.org)</li>
+ <li>
+
+ <em>Rolf Kulemann (roku at apache.org)</em>
+ </li>
+ <li>
+ <strong>Jörn Nettingsmeier (nettings at apache.org)</strong>
+ </li>
+ <li>Jürgen Ragaller (ragaller at apache.org)</li>
+ <li>Renaud Richardet (renaud at apache.org)</li>
+ <li>Felix Röthenbacher (froethenbacher at apache.org)</li>
+
+ <li>
+ <strong>
+ <em>Gregor J. Rothfuss (gregor at apache.org)</em>
+ </strong>
+ </li>
+ <li>Torsten Schlabach (tschlabach at apache.org)</li>
+ <li>
+ <strong>Thorsten Scherler (thorsten at apache.org)</strong>
+
+ </li>
+ <li>Josias Thöny (josias at apache.org)</li>
+ <li>Michael Wechner (michi at apache.org)</li>
+ </ul>
+ </section>
+ <section id="notes">
+ <title>Notes</title>
+
+ <p>
+ Strong type denotes "Project Management Committee
+ (<a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">PMC</a>) member". Emphasis type denotes
+ "emeritus PMC member". See the <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">ASF role
+ definitions</a> for detailed role information. The actual list of PMC
+ members is in the SVN "committers" repository at
+ /board/committee-info.txt
+ </p>
+ <p>
+ Some people were committers prior to Lenya becoming a top-level
+ project and so gaining a PMC. They were not around since then, so have
+ never been on the PMC. All new committers are
+ <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">encouraged</a> to become PMC
+ members.
+ </p>
+
+ <p>
+ Committers can be as active as they choose and there is no performance
+ pressure from the project. For those who are interested in the work that
+ each particular committer has done, see the
+ <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">acknowledgements</a> section.
+ </p>
+ <p>
+ All <a href="http://cocoon.apache.org/community/members.html">Apache
+ Cocoon committers</a> and
+ <a href="http://forrest.apache.org/who.html">Apache
+ Forrest committers</a> also have rights to commit to Lenya.
+ </p>
+
+ </section>
+
+ <section>
+ <title>Other Contributors</title>
+ <ul>
+ <li>
+ Lon Boonen is the original creator of Xopus and helped a
+ lot to integrate it into Lenya. Recently he
+ rewrote the JavaScript of the Lenya menubar.
+ </li>
+ <li>Jose Chaso: Spanish translation</li>
+
+ <li>Stephen England: Design of the Lenya logo, design of the Lenya UI</li>
+ <li>Jorge Gutierrez: Spanish translation</li>
+ <li>Martin Hitz</li>
+ <li>Margrit John</li>
+ <li>Olivier Lange: French translation</li>
+ <li>Jean Pierre LeJacq: Build system improvements</li>
+
+ <li>Martin Lüthi: Mail class</li>
+ <li>
+ Christian Stocker is the original creator of the Bitflux Editor and helped
+ a lot to integrate it into Lenya.
+ </li>
+ <li>Urs Stöckli</li>
+ <li>Giampaolo Trapasso: Italian translation, entertainer on #lenya</li>
+ <li>Markus Vaterlaus</li>
+
+ <li>Kars Veiling</li>
+ <li>Marc von Wattenwyl</li>
+ <li>Thomas Werschlein</li>
+ </ul>
+ </section>
+ </body>
+</document>
Added: lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test2.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test2.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test2.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/lcs/test2.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>Who we are</title>
+ </header>
+ <body>
+ <section id="community">
+ <title>The Lenya Community</title>
+
+ <p>
+ The Lenya Project operates as a meritocracy: the more you do, the more
+ responsibility you will obtain. This page lists all of the people who
+ have gone the extra mile and are Committers. If you would like to get
+ involved, the first step is to join the mailing lists.
+ </p>
+ <p>
+ Of course the committers are not the only people involved in the
+ community. Thanks to the many people for their contributions of patches,
+ assistance, ideas, and email discussion. Some are mentioned at the
+ changes pages. See how we
+ <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">acknowledge</a> contributions.
+ </p>
+ <p>
+ Please do not send emails directly to individual developers asking for
+ free support - see the Important Notices at the
+ <a href="lenya-document:dfb45860-e986-11dc-b04f-af2277a493d7">mailing lists</a> page.
+ </p>
+
+ </section>
+ <section id="committers">
+ <title>List of committers</title>
+ <p>
+ List of all people who have ever been committers at Apache Lenya,
+ sorted alphabetically.
+ </p>
+ <ul>
+ <li>Doug Chestnut (chestnut at apache.org)</li>
+
+ <li>Edith Chevrier (edith at apache.org)</li>
+ <li>Dale Christ (bigdog at apache.org)</li>
+ <li>Christian Egli (egli at apache.org)</li>
+ <li>Paul Ercolino (solprovider at apache.org)</li>
+ <li>
+ <strong>Jann Forrer (jann at apache.org)</strong>
+
+ </li>
+ <li>Richard Frovarp (rfrovarp at apache.org)</li>
+ <li>
+ <strong>Antonio Gallardo (antonio at apache.org)</strong>
+ </li>
+ <li>Bob Harner (bobharner at apache.org)</li>
+ <li>
+
+ <strong>Andreas Hartmann (andreas at apache.org)</strong>
+ </li>
+ <li>
+ <strong>J. Wolfgang Kaltz (jwkaltz at apache.org)</strong>
+ </li>
+ <li>Andreas Kuckartz (aku at apache.org)</li>
+ <li>
+
+ <em>Rolf Kulemann (roku at apache.org)</em>
+ </li>
+ <li>
+ <strong>Jörn Nettingsmeier (nettings at apache.org)</strong>
+ </li>
+ <li>Jürgen Ragaller (ragaller at apache.org)</li>
+ <li>Renaud Richardet (renaud at apache.org)</li>
+ <li>Felix Röthenbacher (froethenbacher at apache.org)</li>
+
+ <li>
+ <strong>
+ <em>Gregor J. Rothfuss (gregor at apache.org)</em>
+ </strong>
+ </li>
+ <li>Torsten Schlabach (tschlabach at apache.org)</li>
+ <li>
+ <strong>Thorsten Scherler (thorsten at apache.org)</strong>
+
+ </li>
+ <li>Josias Thöny (josias at apache.org)</li>
+ <li>Michael Wechner (michi at apache.org)</li>
+ </ul>
+ </section>
+ <section id="notes">
+ <title>Notes</title>
+
+ <p>
+ Strong type denotes "Project Management Committee
+ (<a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">PMC</a>) member". Emphasis type denotes
+ "emeritus PMC member". See the <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">ASF role
+ definitions</a> for detailed role information. The actual list of PMC
+ members is in the SVN "committers" repository at
+ /board/committee-info.txt
+ </p>
+ <p>
+ Some people were committers prior to Lenya becoming a top-level
+ project and so gaining a PMC. They were not around since then, so have
+ never been on the PMC. All new committers are
+ <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">encouraged</a> to become PMC
+ members.
+ </p>
+
+ <p>
+ Committers can be as active as they choose and there is no performance
+ pressure from the project. For those who are interested in the work that
+ each particular committer has done, see the
+ <a href="lenya-document:413a46e0-e986-11dc-b04f-af2277a493d7">acknowledgements</a> section.
+ </p>
+ <p>
+ All <a href="http://cocoon.apache.org/community/members.html">Apache
+ Cocoon committers</a> and
+ <a href="http://forrest.apache.org/who.html">Apache
+ Forrest committers</a> also have rights to commit to Lenya.
+ </p>
+
+ </section>
+
+ <section>
+ <title>Other Contributors</title>
+ <ul>
+ <li>
+ Lon Boonen is the original creator of Xopus and helped a
+ lot to integrate it into Lenya. Recently he
+ rewrote the JavaScript of the Lenya menubar.
+ </li>
+ <li>Jose Chaso: Spanish translation</li>
+
+ <li>Stephen England: Design of the Lenya logo, design of the Lenya UI</li>
+ <li>Jorge Gutierrez: Spanish translation</li>
+ <li>Martin Hitz</li>
+ <li>Margrit John</li>
+ <li>Olivier Lange: French translation</li>
+ <li>Jean Pierre LeJacq: Build system improvements</li>
+
+ <li>Martin Lüthi: Mail class</li>
+ <li>
+ Christian Stocker is the original creator of the Bitflux Editor and helped
+ a lot to integrate it into Lenya.
+ </li>
+ <li>Urs Stöckli</li>
+ <li>Giampaolo Trapasso: Italian translation, entertainer on #lenya</li>
+ <li>Markus Vaterlaus</li>
+
+ <li>Kars Veiling</li>
+ <li>Marc von Wattenwyl</li>
+ <li>Thomas Werschlein</li>
+ </ul>
+ </section>
+ </body>
+</document>
Added: lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/DiffTest.java
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/DiffTest.java?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/DiffTest.java (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/DiffTest.java Fri Jul 9 06:55:39 2010
@@ -0,0 +1,33 @@
+package org.apache.lenya.modules.diff.xml;
+
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.lenya.modules.diff.DifferenceTree;
+import org.apache.lenya.modules.diff.DifferenceTreeWriter;
+import org.apache.lenya.modules.diff.SimpleTreeDiff;
+import org.apache.lenya.modules.diff.Tree;
+import org.apache.lenya.modules.diff.TreeDiff;
+import org.apache.lenya.modules.diff.xml.DomTreeBuilder;
+import org.apache.lenya.modules.diff.xml.XmlNodeWriter;
+import org.apache.lenya.xml.DocumentHelper;
+import org.w3c.dom.Document;
+
+public class DiffTest extends TestCase {
+
+ public void testDiff() throws Exception {
+
+ DomTreeBuilder builder = DomTreeBuilderFactory.createBuilder();
+ Tree[] trees = new Tree[2];
+ for (int i = 0; i < trees.length; i++) {
+ URL url = getClass().getResource("test" + (i + 1) + ".xml");
+ Document dom = DocumentHelper.readDocument(url);
+ trees[i] = builder.buildTree(dom);
+ }
+ TreeDiff diff = new SimpleTreeDiff();
+ DifferenceTree difference = diff.getDifferences(trees[0], trees[1]);
+ DifferenceTreeWriter diffWriter = new DifferenceTreeWriter(new XmlNodeWriter());
+ difference.traverse(diffWriter);
+ }
+}
Added: lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test1.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test1.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test1.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test1.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hello xmlns="http://apache.org/lenya/test/1.0">
+ <foo/>
+ <bar>
+ Hello
+ <baz a="x"/>
+ </bar>
+</hello>
\ No newline at end of file
Added: lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test2.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test2.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test2.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/java/test/org/apache/lenya/modules/diff/xml/test2.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hello xmlns="http://apache.org/lenya/test/1.0" foo="bar">
+ <bar>
+ Hello<baz/>
+ </bar>
+ <foo a="b"/>
+</hello>
\ No newline at end of file
Added: lenya/contributions/2_0_X/modules/xmldiff/patches/usecase-policies.patch
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/patches/usecase-policies.patch?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/patches/usecase-policies.patch (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/patches/usecase-policies.patch Fri Jul 9 06:55:39 2010
@@ -0,0 +1,17 @@
+--- build\lenya\webapp\lenya\pubs\default\config\access-control\usecase-policies.xml
++++ build\lenya\webapp\lenya\pubs\default\config\access-control\usecase-policies.xml
+@@ -423,4 +423,14 @@
+ <usecase id="metadata.change">
+ <role id="edit" method="grant"/>
+ </usecase>
++ <usecase id="tab.xmldiff-revisions">
++ <role id="sitemanager" method="grant"/>
++ <role id="edit" method="grant"/>
++ <role id="review" method="grant"/>
++ </usecase>
++ <usecase id="tab.xmldiff">
++ <role id="sitemanager" method="grant"/>
++ <role id="edit" method="grant"/>
++ <role id="review" method="grant"/>
++ </usecase>
+ </usecases>
Added: lenya/contributions/2_0_X/modules/xmldiff/readme.txt
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/readme.txt?rev=962428&view=auto
==============================================================================
(empty)
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/css/diff.css
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/css/diff.css?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/css/diff.css (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/css/diff.css Fri Jul 9 06:55:39 2010
@@ -0,0 +1,144 @@
+/*
+ * Styles for the Tag Diff
+ */
+span.diff-tag-html {
+ font-family: "Andale Mono" monospace;
+ font-size: 80%;
+}
+
+span.diff-tag-removed {
+ font-size: 100%;
+ text-decoration: line-through;
+ background-color: #fdc6c6; /* light red */
+}
+
+span.diff-tag-added {
+ font-size: 100%;
+ background-color: #ccffcc; /* light green */
+}
+
+/*
+ * Styles for the HTML Diff
+ */
+span.diff-html-added {
+ font-size: 100%;
+ background-color: #ccffcc; /* light green */
+ cursor: pointer;
+}
+
+span.diff-html-removed {
+ font-size: 100%;
+ text-decoration: line-through;
+ background-color: #fdc6c6; /* light red */
+ cursor: pointer;
+}
+
+span.diff-html-changed {
+/* background: url(../images/diffunderline.gif) bottom repeat-x;*/
+ background-color: #c6c6fd; /* light blue */
+ cursor: pointer;
+}
+
+span.diff-html-selected {
+ background-color: #FF8800; /* light orange */
+ cursor: pointer;
+}
+
+span.diff-html-selected img{
+ border: 2px solid #FF8800; /* light orange */
+}
+
+span.diff-html-added img{
+ border: 2px solid #ccffcc;
+}
+
+span.diff-html-removed img{
+ border: 2px solid #fdc6c6;
+}
+
+span.diff-html-changed img{
+ border: 2px dotted #000099;
+
+}
+
+div.diff-removed-image, div.diff-added-image{
+ height: 300px;
+ width: 200px;
+ position: absolute;
+ opacity : 0.55;
+ filter: alpha(opacity=55);
+ -moz-opacity: 0.55;
+}
+
+div.diff-removed-image, div.diff-added-image {
+ margin-top: 2px;
+ margin-bottom: 2px;
+ margin-right: 2px;
+ margin-left: 2px;
+}
+
+div.diff-removed-image {
+ background-color: #fdc6c6;
+ background-image: url(../images/diffmin.gif);
+}
+div.diff-added-image {
+ background-color: #ccffcc;
+ background-image: url(../images/diffplus.gif);
+ background-repeat: no-repeat;
+}
+
+img.diff-icon {
+ background-color: #FF8800;
+ background-image: url(../images/bg_rounded.gif);
+ width: 16px;
+ height: 16px;
+ border: 0px none;
+}
+
+table.diff-tooltip-link, table.diff-tooltip-link-changed {
+ width: 100%;
+ text-align: center;
+ Vertical-align: middle;
+}
+
+table.diff-tooltip-link-changed {
+ border-top: thin dashed #000000;
+ margin-top: 3px;
+ padding-top: 3px
+}
+td.diff-tooltip-prev {
+ text-align: left;
+}
+
+td.diff-tooltip-next {
+ text-align: right;
+}
+
+table.diffpage-html-firstlast {
+ width: 100%;
+ Vertical-align: middle;
+}
+
+div.diff-topbar{
+ border-bottom: 2px solid #FF8800;
+ border-left: 1px solid #FF8800;
+ border-right: 1px solid #FF8800;
+ background-color: #FFF5F5;
+}
+
+a.diffpage-html-a, a.diffpage-html-a:hover, a.diffpage-html-a:link, a.diffpage-html-a:visited, a.diffpage-html-a:active {
+ text-decoration: none;
+ color: #FF8800;
+}
+
+.diffpage-html-firstlast a img, .dsydiff-prevnextnav a img {
+ vertical-align: middle;
+}
+
+ul.changelist {
+ padding-left: 15px;
+}
+
+body{
+ margin-top: 0px;
+}
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns="http://apache.org/cocoon/i18n/2.1">
+
+ <message key="Revisions">Revisions</message>
+ <message key="No.">No.</message>
+ <message key="Time">Time</message>
+ <message key="Editor">Editor</message>
+ <message key="show-diff">Diff</message>
+ <message key="Revision no.">Revision no.</message>
+ <message key="changed item">changed item</message>
+ <message key="added item">added item</message>
+ <message key="removed item">"removed item"</message>
+ <message key="XML diff">XML diff</message>
+ <message key="XML view">XML view</message>
+ <message key="HTML view">HTML view</message>
+ <message key="color notation">color notation</message>
+ <message key="Missing parameter [{0}]">Missing parameter [{0}]</message>
+ <message key="Revision [{0}] is the oldest">Revision [{0}] is the oldest</message>
+ <message key="Revision [{0}] does not exist">Revision [{0}] does not exist</message>
+
+</catalogue>
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui_ru.xml
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui_ru.xml?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui_ru.xml (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/i18n/cmsui_ru.xml Fri Jul 9 06:55:39 2010
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<catalogue xml:lang="ru" xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns="http://apache.org/cocoon/i18n/2.1">
+
+ <message key="Revisions">Ревизии</message>
+ <message key="No.">ÐомеÑ</message>
+ <message key="Time">ÐÑемÑ</message>
+ <message key="Editor">РедакÑоÑ</message>
+ <message key="show-diff">СÑавниÑÑ</message>
+ <message key="Revision no.">ÐÐ¾Ð¼ÐµÑ Ñевизии</message>
+ <message key="changed item">изменÑннÑй ÑлеменÑ</message>
+ <message key="added item">добавленнÑй ÑлеменÑ</message>
+ <message key="removed item">ÑдалÑннÑй ÑлеменÑ</message>
+ <message key="XML diff">XML изменениÑ</message>
+ <message key="XML view">XML оÑобÑажение</message>
+ <message key="HTML view">HTML оÑобÑажение</message>
+ <message key="color notation">ÑвеÑовÑе обознаÑениÑ</message>
+ <message key="Missing parameter [{0}]">ÐÑÑÑÑÑÑвÑÐµÑ Ð¿Ð°ÑамеÑÑ [{0}]</message>
+ <message key="Revision [{0}] is the oldest">Ð ÐµÐ²Ð¸Ð·Ð¸Ñ [{0}] - ÑÑаÑейÑаÑ</message>
+ <message key="Revision [{0}] does not exist">ÐÑÑÑÑÑÑвÑÐµÑ Ð¿Ð°ÑамеÑÑ [{0}]</message>
+
+</catalogue>
\ No newline at end of file
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/diffTips.js
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/diffTips.js?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/diffTips.js (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/diffTips.js Fri Jul 9 06:55:39 2010
@@ -0,0 +1,23 @@
+dojo.addOnLoad(
+ function(){
+ var changed_node;
+ var i = 0;
+ var id;
+ do {
+ id = "changed-diff-" + i;
+ changed_node = document.getElementById(id);
+
+ if(changed_node == null) {
+ break;
+ }
+
+ var changes = changed_node.getAttribute('changes');
+ var srcNode = document.createElement("div");
+ srcNode.innerHTML = changes;
+ var tooltip = dojo.widget.createWidget("Tooltip", {connectId : id, toggle : 'fade'}, srcNode);
+ i = i + 1;
+ } while (true);
+});
+
+
+
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/revselection.js
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/revselection.js?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/revselection.js (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/javascript/revselection.js Fri Jul 9 06:55:39 2010
@@ -0,0 +1,39 @@
+
+ function selectChanged(select) {
+ var rev = select.options[select.selectedIndex].value;
+ var name = select.name;
+
+ var radios = document.getElementsByName(name);
+ var i = 0;
+ for(i = 0; i < radios.length; i++) {
+ var radio_rev = radios[i].value;
+ if(radio_rev == rev) {
+ radios[i].checked = true;
+ //break;
+ } else {
+ radios[i].checked = false;
+ }
+ }
+
+ }
+
+ function radioChanged(radio) {
+ var rev = radio.value;
+ var name = radio.name;
+ var elements = document.getElementsByName(name);
+ var select = elements[elements.length - 1];
+
+ var options = select.options;
+ var i = 0;
+ for(i = 0; i < options.length; i++) {
+ var option_rev = options[i].value;
+
+ if(option_rev == rev) {
+ select.selectedIndex = i;
+ break;
+ }
+ }
+
+
+ }
+
\ No newline at end of file
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_EN.properties
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_EN.properties?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_EN.properties (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_EN.properties Fri Jul 9 06:55:39 2010
@@ -0,0 +1,85 @@
+diff-movedto=Moved to
+diff-styleadded=Style added
+diff-added=Added
+diff-changedto=Changed to
+diff-movedoutof=Moved out of
+diff-styleremoved=Style removed
+diff-removed=Removed
+diff-changedfrom=Changed from
+diff-source=Source
+diff-withdestination=With destination
+diff-and=And
+diff-with=With
+diff-width=Width
+diff-height=Height
+diff-html-article=A
+diff-html=Html page
+diff-body-article=A
+diff-body=Html document
+diff-p-article=A
+diff-p=Paragraph
+diff-blockquote-article=A
+diff-blockquote=Quote
+diff-h1-article=A
+diff-h1=Heading (level 1)
+diff-h2-article=A
+diff-h2=Heading (level 2)
+diff-h3-article=A
+diff-h3=Heading (level 3)
+diff-h4-article=A
+diff-h4=Heading (level 4)
+diff-h5-article=A
+diff-h5=Heading (level 5)
+diff-pre-article=A
+diff-pre=Preformatted block
+diff-div-article=A
+diff-div=Division
+diff-ul-article=An
+diff-ul=Unordered list
+diff-ol-article=An
+diff-ol=Ordered list
+diff-li-article=A
+diff-li=List item
+diff-table-article=A
+diff-table=Table
+diff-tbody-article=A
+diff-tbody=Table's content
+diff-tr-article=A
+diff-tr=Row
+diff-td-article=A
+diff-td=Cell
+diff-th-article=A
+diff-th=Header
+diff-br-article=A
+diff-br=Break
+diff-hr-article=A
+diff-hr=Horizontal rule
+diff-code-article=A
+diff-code=Computer code block
+diff-dl-article=A
+diff-dl=Definition list
+diff-dt-article=A
+diff-dt=Definition term
+diff-dd-article=A
+diff-dd=Definition
+diff-input-article=An
+diff-input=Input
+diff-form-article=A
+diff-form=Form
+diff-img-article=An
+diff-img=Image
+diff-span-article=A
+diff-span=Span
+diff-a-article=A
+diff-a=Link
+diff-i=Italics
+diff-b=Bold
+diff-strong=Strong
+diff-em=Emphasis
+diff-font=Font
+diff-big=Big
+diff-del=Deleted
+diff-tt=Fixed width
+diff-sub=Subscript
+diff-sup=Superscript
+diff-strike=Strikethrough
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_UK.properties
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_UK.properties?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_UK.properties (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_UK.properties Fri Jul 9 06:55:39 2010
@@ -0,0 +1,85 @@
+diff-movedto=Moved to
+diff-styleadded=Style added
+diff-added=Added
+diff-changedto=Changed to
+diff-movedoutof=Moved out of
+diff-styleremoved=Style removed
+diff-removed=Removed
+diff-changedfrom=Changed from
+diff-source=Source
+diff-withdestination=With destination
+diff-and=And
+diff-with=With
+diff-width=Width
+diff-height=Height
+diff-html-article=A
+diff-html=Html page
+diff-body-article=A
+diff-body=Html document
+diff-p-article=A
+diff-p=Paragraph
+diff-blockquote-article=A
+diff-blockquote=Quote
+diff-h1-article=A
+diff-h1=Heading (level 1)
+diff-h2-article=A
+diff-h2=Heading (level 2)
+diff-h3-article=A
+diff-h3=Heading (level 3)
+diff-h4-article=A
+diff-h4=Heading (level 4)
+diff-h5-article=A
+diff-h5=Heading (level 5)
+diff-pre-article=A
+diff-pre=Preformatted block
+diff-div-article=A
+diff-div=Division
+diff-ul-article=An
+diff-ul=Unordered list
+diff-ol-article=An
+diff-ol=Ordered list
+diff-li-article=A
+diff-li=List item
+diff-table-article=A
+diff-table=Table
+diff-tbody-article=A
+diff-tbody=Table's content
+diff-tr-article=A
+diff-tr=Row
+diff-td-article=A
+diff-td=Cell
+diff-th-article=A
+diff-th=Header
+diff-br-article=A
+diff-br=Break
+diff-hr-article=A
+diff-hr=Horizontal rule
+diff-code-article=A
+diff-code=Computer code block
+diff-dl-article=A
+diff-dl=Definition list
+diff-dt-article=A
+diff-dt=Definition term
+diff-dd-article=A
+diff-dd=Definition
+diff-input-article=An
+diff-input=Input
+diff-form-article=A
+diff-form=Form
+diff-img-article=An
+diff-img=Image
+diff-span-article=A
+diff-span=Span
+diff-a-article=A
+diff-a=Link
+diff-i=Italics
+diff-b=Bold
+diff-strong=Strong
+diff-em=Emphasis
+diff-font=Font
+diff-big=Big
+diff-del=Deleted
+diff-tt=Fixed width
+diff-sub=Subscript
+diff-sup=Superscript
+diff-strike=Strikethrough
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_US.properties
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_US.properties?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_US.properties (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/messages_en_US.properties Fri Jul 9 06:55:39 2010
@@ -0,0 +1,85 @@
+diff-movedto=Moved to
+diff-styleadded=Style added
+diff-added=Added
+diff-changedto=Changed to
+diff-movedoutof=Moved out of
+diff-styleremoved=Style removed
+diff-removed=Removed
+diff-changedfrom=Changed from
+diff-source=Source
+diff-withdestination=With destination
+diff-and=And
+diff-with=With
+diff-width=Width
+diff-height=Height
+diff-html-article=A
+diff-html=Html page
+diff-body-article=A
+diff-body=Html document
+diff-p-article=A
+diff-p=Paragraph
+diff-blockquote-article=A
+diff-blockquote=Quote
+diff-h1-article=A
+diff-h1=Heading (level 1)
+diff-h2-article=A
+diff-h2=Heading (level 2)
+diff-h3-article=A
+diff-h3=Heading (level 3)
+diff-h4-article=A
+diff-h4=Heading (level 4)
+diff-h5-article=A
+diff-h5=Heading (level 5)
+diff-pre-article=A
+diff-pre=Preformatted block
+diff-div-article=A
+diff-div=Division
+diff-ul-article=An
+diff-ul=Unordered list
+diff-ol-article=An
+diff-ol=Ordered list
+diff-li-article=A
+diff-li=List item
+diff-table-article=A
+diff-table=Table
+diff-tbody-article=A
+diff-tbody=Table's content
+diff-tr-article=A
+diff-tr=Row
+diff-td-article=A
+diff-td=Cell
+diff-th-article=A
+diff-th=Header
+diff-br-article=A
+diff-br=Break
+diff-hr-article=A
+diff-hr=Horizontal rule
+diff-code-article=A
+diff-code=Computer code block
+diff-dl-article=A
+diff-dl=Definition list
+diff-dt-article=A
+diff-dt=Definition term
+diff-dd-article=A
+diff-dd=Definition
+diff-input-article=An
+diff-input=Input
+diff-form-article=A
+diff-form=Form
+diff-img-article=An
+diff-img=Image
+diff-span-article=A
+diff-span=Span
+diff-a-article=A
+diff-a=Link
+diff-i=Italics
+diff-b=Bold
+diff-strong=Strong
+diff-em=Emphasis
+diff-font=Font
+diff-big=Big
+diff-del=Deleted
+diff-tt=Fixed width
+diff-sub=Subscript
+diff-sup=Superscript
+diff-strike=Strikethrough
Added: lenya/contributions/2_0_X/modules/xmldiff/resources/messages_ru_RU.properties
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/resources/messages_ru_RU.properties?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/resources/messages_ru_RU.properties (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/resources/messages_ru_RU.properties Fri Jul 9 06:55:39 2010
@@ -0,0 +1,85 @@
+diff-movedto=Moved to
+diff-styleadded=Style added
+diff-added=Added
+diff-changedto=Changed to
+diff-movedoutof=Moved out of
+diff-styleremoved=Style removed
+diff-removed=Removed
+diff-changedfrom=Changed from
+diff-source=Source
+diff-withdestination=With destination
+diff-and=And
+diff-with=With
+diff-width=Width
+diff-height=Height
+diff-html-article=A
+diff-html=Html page
+diff-body-article=A
+diff-body=Html document
+diff-p-article=A
+diff-p=Paragraph
+diff-blockquote-article=A
+diff-blockquote=Quote
+diff-h1-article=A
+diff-h1=Heading (level 1)
+diff-h2-article=A
+diff-h2=Heading (level 2)
+diff-h3-article=A
+diff-h3=Heading (level 3)
+diff-h4-article=A
+diff-h4=Heading (level 4)
+diff-h5-article=A
+diff-h5=Heading (level 5)
+diff-pre-article=A
+diff-pre=Preformatted block
+diff-div-article=A
+diff-div=Division
+diff-ul-article=An
+diff-ul=Unordered list
+diff-ol-article=An
+diff-ol=Ordered list
+diff-li-article=A
+diff-li=List item
+diff-table-article=A
+diff-table=Table
+diff-tbody-article=A
+diff-tbody=Table's content
+diff-tr-article=A
+diff-tr=Row
+diff-td-article=A
+diff-td=Cell
+diff-th-article=A
+diff-th=Header
+diff-br-article=A
+diff-br=Break
+diff-hr-article=A
+diff-hr=Horizontal rule
+diff-code-article=A
+diff-code=Computer code block
+diff-dl-article=A
+diff-dl=Definition list
+diff-dt-article=A
+diff-dt=Definition term
+diff-dd-article=A
+diff-dd=Definition
+diff-input-article=An
+diff-input=Input
+diff-form-article=A
+diff-form=Form
+diff-img-article=An
+diff-img=Image
+diff-span-article=A
+diff-span=Span
+diff-a-article=A
+diff-a=Link
+diff-i=Italics
+diff-b=Bold
+diff-strong=Strong
+diff-em=Emphasis
+diff-font=Font
+diff-big=Big
+diff-del=Deleted
+diff-tt=Fixed width
+diff-sub=Subscript
+diff-sup=Superscript
+diff-strike=Strikethrough
Added: lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/diff.jx
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/diff.jx?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/diff.jx (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/diff.jx Fri Jul 9 06:55:39 2010
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<page:page
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+ xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ >
+
+ <page:head>
+ <link rel="stylesheet" type="text/css" href="/modules/xmldiff/css/diff.css" />
+ <script type="text/javascript" src="/modules/sitemanagement/javascript/lenyaTabs.js"/>
+
+ <jx:import uri="fallback://lenya/modules/sitemanagement/usecases/tab/head.jx" />
+
+ <script type="text/javascript">
+ dojo.require("dojo.widget.Tooltip");
+ </script>
+
+ <script type="text/javascript" src="/modules/xmldiff/javascript/diffTips.js"/>
+ </page:head>
+ <page:body onload="lenyaInitTabs(2);dojoInit();">
+ <jx:import uri="fallback://lenya/modules/sitemanagement/usecases/tab/sitetree.jx"/>
+ <jx:import uri="fallback://lenya/modules/usecase/templates/tabs.jx"/>
+
+
+<div id="contentblock1" class="lenya-tab-sitetree">
+ <h1><i18n:text>XML diff</i18n:text></h1>
+<div class="lenya-box">
+ <div class="lenya-box-title"><i18n:text>color notation</i18n:text></div>
+ <div class="lenya-box-body">
+ <span class="diff-html-changed"><i18n:text>changed item</i18n:text></span>
+ <span class="diff-html-added"><i18n:text>added item</i18n:text></span>
+ <span class="diff-html-removed"><i18n:text>removed item</i18n:text></span>
+ </div>
+</div>
+ <p>
+ <jx:import uri="fallback://lenya/modules/usecase/templates/messages.jx"/>
+ </p>
+
+ <div class="lenyaTabTitle" id="lenyaTabTitle0" onclick="lenyaToggleTab(2, 0)">
+ <a><i18n:text>XML view</i18n:text></a>
+ </div>
+ <div class="lenyaTabTitle" id="lenyaTabTitle1" onclick="lenyaToggleTab(2, 1)">
+ <a><i18n:text>HTML view</i18n:text></a>
+ </div>
+ <div class="lenyaTabBody" id="lenyaTabBody0">
+ <div>${usecase.getParameter('xml-output')}</div>
+ </div>
+ <div class="lenyaTabBody" id="lenyaTabBody1">
+ <div>${usecase.getParameter('html-output')}</div>
+ </div>
+ </div>
+ </page:body>
+</page:page>
\ No newline at end of file
Added: lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/revisions.jx
URL: http://svn.apache.org/viewvc/lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/revisions.jx?rev=962428&view=auto
==============================================================================
--- lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/revisions.jx (added)
+++ lenya/contributions/2_0_X/modules/xmldiff/usecases/tab/revisions.jx Fri Jul 9 06:55:39 2010
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+ xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+
+ <jx:import uri="fallback://lenya/modules/sitemanagement/usecases/tab/head.jx" />
+
+ <page:head>
+ <script type="text/javascript" src="/modules/xmldiff/javascript/revselection.js"/>
+ </page:head>
+
+ <!-- add check if usecase could be invoked (see revisions tab) -->
+
+
+ <page:body>
+ <jx:import uri="fallback://lenya/modules/sitemanagement/usecases/tab/sitetree.jx" />
+ <jx:import uri="fallback://lenya/modules/usecase/templates/tabs.jx" />
+
+ <div id="contentblock1" class="lenya-tab-sitetree">
+ <h1><i18n:text>Revisions</i18n:text></h1>
+
+ <p><jx:import uri="fallback://lenya/modules/usecase/templates/messages.jx"/></p>
+
+ <form method="post" id="form-diff-radio"
+ action="${usecase.getSourceURL()}">
+ <table class="lenya-table-list-noborder">
+
+ <tr>
+ <th>
+ <i18n:text>No.</i18n:text>
+ </th>
+ <th>
+ <i18n:text>Time</i18n:text>
+ </th>
+ <th>
+ <i18n:text>Editor</i18n:text>
+ </th>
+ <th>
+ <input type="hidden" name="lenya.usecase"
+ value="tab.xmldiff" />
+ <input type="submit" i18n:attr="value"
+ value="show-diff"/>
+
+ </th>
+ </tr>
+
+ <jx:set var="count"
+ value="${usecase.getParameter('revisions').size()}" />
+ <jx:set var="isFirstItem" value="true" />
+ <jx:forEach var="revision"
+ items="${usecase.getParameter('revisions')}" begin="0"
+ varStatus="status">
+ <tr>
+ <td align="right">
+ <input type="button" i18n:attr="title"
+ onclick="showRevision(${revision.getNumber()});"
+ title="view-revision-in-new-window"
+ value="${revision.getNumber()}" />
+ </td>
+ <td align="right">
+ <i18n:date-time
+ src-pattern="yyyy-MM-dd HH:mm:ss">
+ <jx:formatDate
+ value="${revision.getTime()}" pattern="yyyy-MM-dd HH:mm:ss" />
+ </i18n:date-time>
+ </td>
+ <td>
+ <jx:set var="userId"
+ value="${revision.getUserId()}" />
+ <a
+ href="${usecase.getSourceURL()}?lenya.usecase=admin.user&userId=${userId}">
+ ${userId}
+ </a>
+ </td>
+ <td>
+ <jx:choose>
+ <jx:when
+ test="${status.count==1}">
+ <input type="radio"
+ value="${revision.getNumber()}" name="newer_revision_num" checked="true" onClick="radioChanged(this)" />
+ </jx:when>
+ <jx:otherwise>
+ <input type="radio"
+ value="${revision.getNumber()}" name="newer_revision_num" onClick="radioChanged(this)"/>
+ </jx:otherwise>
+ </jx:choose>
+ <input type="radio"
+ value="${revision.getNumber()}" name="elder_revision_num" onClick="radioChanged(this)"/>
+ </td>
+ </tr>
+ </jx:forEach>
+ </table>
+ </form>
+
+ <form method="post" id="form-diff-dropdown"
+ action="${usecase.getSourceURL()}">
+ <i18n:text>Revision no.</i18n:text>
+ <select onChange="selectChanged(this)"
+ name="newer_revision_num">
+ <jx:forEach var="revision"
+ items="${usecase.getParameter('revisions')}" begin="0">
+ <option value="${revision.getNumber()}">
+ ${revision.getNumber()}
+ </option>
+ </jx:forEach>
+ </select>
+ <i18n:text>Revision no.</i18n:text>
+ <select onChange="selectChanged(this)"
+ name="elder_revision_num">
+ <option selected="true"><i18n:text>previous</i18n:text></option>
+ <jx:forEach var="revision"
+ items="${usecase.getParameter('revisions')}" begin="0">
+ <option value="${revision.getNumber()}">
+ ${revision.getNumber()}
+ </option>
+ </jx:forEach>
+ </select>
+ <input type="hidden" name="lenya.usecase"
+ value="tab.xmldiff" />
+ <input type="submit" i18n:attr="value"
+ value="show-diff"/>
+ </form>
+
+ </div>
+ </page:body>
+</page:page>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org