You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ne...@apache.org on 2007/02/21 13:45:24 UTC

svn commit: r509985 - /lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/OneFormEditor.java

Author: nettings
Date: Wed Feb 21 04:45:23 2007
New Revision: 509985

URL: http://svn.apache.org/viewvc?view=rev&rev=509985
Log:
remove dead code, whitenoise.
please review, in case somebody left this in as a reminder of some kind
or forgot to add code...


Modified:
    lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/OneFormEditor.java

Modified: lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/OneFormEditor.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/OneFormEditor.java?view=diff&rev=509985&r1=509984&r2=509985
==============================================================================
--- lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/OneFormEditor.java (original)
+++ lenya/trunk/src/modules/editors/java/src/org/apache/lenya/cms/editors/forms/OneFormEditor.java Wed Feb 21 04:45:23 2007
@@ -94,41 +94,28 @@
      * @throws Exception if an error occurs.
      */
     protected void saveDocument(String encoding, String content) throws Exception {
-        SourceResolver resolver = null;
-        Source indexSource = null;
-        try {
-            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
-            saveXMLFile(encoding, content, getSourceDocument());
-
-            Document xmlDoc = null;
+        saveXMLFile(encoding, content, getSourceDocument());
 
-            try {
-                xmlDoc = DocumentHelper.readDocument(getSourceDocument().getInputStream());
-            } catch (SAXException e) {
-                addErrorMessage("error-document-form", new String[] { e.getMessage() });
-            }
+        Document xmlDoc = null;
 
-            if (xmlDoc != null) {
-                ResourceType resourceType = getSourceDocument().getResourceType();
-                Schema schema = resourceType.getSchema();
-
-                ValidationUtil.validate(this.manager, xmlDoc, schema, new UsecaseErrorHandler(this));
-
-                if (!hasErrors()) {
-                    WorkflowUtil.invoke(this.manager,
-                            getSession(),
-                            getLogger(),
-                            getSourceDocument(),
-                            getEvent());
-                }
-            }
+        try {
+            xmlDoc = DocumentHelper.readDocument(getSourceDocument().getInputStream());
+        } catch (SAXException e) {
+            addErrorMessage("error-document-form", new String[] { e.getMessage() });
+        }
 
-        } finally {
-            if (resolver != null) {
-                if (indexSource != null) {
-                    resolver.release(indexSource);
-                }
-                this.manager.release(resolver);
+        if (xmlDoc != null) {
+            ResourceType resourceType = getSourceDocument().getResourceType();
+            Schema schema = resourceType.getSchema();
+
+            ValidationUtil.validate(this.manager, xmlDoc, schema, new UsecaseErrorHandler(this));
+
+            if (!hasErrors()) {
+                WorkflowUtil.invoke(this.manager,
+                        getSession(),
+                        getLogger(),
+                        getSourceDocument(),
+                        getEvent());
             }
         }
     }
@@ -145,7 +132,6 @@
     private void saveXMLFile(String encoding, String content,
             org.apache.lenya.cms.publication.Document document)
             throws FileNotFoundException, UnsupportedEncodingException, IOException {
-        FileOutputStream fileoutstream = null;
         Writer writer = null;
 
         try {
@@ -161,8 +147,6 @@
             // close all streams
             if (writer != null)
                 writer.close();
-            if (fileoutstream != null)
-                fileoutstream.close();
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org