[Yanel-commits] rev 25716 - public/yanel/contributions/projects/update-manager/resource-types/yanel-update-manager/src/java/org/wyona/yanel/impl/resources/yanelupdatemanager

simon at wyona.com simon at wyona.com
Tue Jul 3 13:12:23 CEST 2007


Author: simon
Date: 2007-07-03 13:12:23 +0200 (Tue, 03 Jul 2007)
New Revision: 25716

Modified:
   public/yanel/contributions/projects/update-manager/resource-types/yanel-update-manager/src/java/org/wyona/yanel/impl/resources/yanelupdatemanager/YanelUpdateManager.java
Log:
dependecies and imports fixed

Modified: public/yanel/contributions/projects/update-manager/resource-types/yanel-update-manager/src/java/org/wyona/yanel/impl/resources/yanelupdatemanager/YanelUpdateManager.java
===================================================================
--- public/yanel/contributions/projects/update-manager/resource-types/yanel-update-manager/src/java/org/wyona/yanel/impl/resources/yanelupdatemanager/YanelUpdateManager.java	2007-07-03 09:56:19 UTC (rev 25715)
+++ public/yanel/contributions/projects/update-manager/resource-types/yanel-update-manager/src/java/org/wyona/yanel/impl/resources/yanelupdatemanager/YanelUpdateManager.java	2007-07-03 11:12:23 UTC (rev 25716)
@@ -6,6 +6,7 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
 import java.util.Enumeration;
 
 import javax.xml.transform.TransformerFactory;
@@ -29,15 +30,20 @@
 import org.xml.sax.InputSource;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Iterator;
+import java.io.File;
+import java.net.URL;
 
-import src.java.org.wyona.yanel.impl.resources.updatefinder.UpdateFinder;
+import org.wyona.yanel.impl.resources.updatefinder.utils.*;
 
 /**
  *
  */
 public class YanelUpdateManager extends Resource implements ViewableV2 {
 
-    private static Category log = Category.getInstance(UpdateFinder.class);
+    private static Category log = Category.getInstance(YanelUpdateManager.class);
     private String defaultLanguage;
     private String language = null;
     
@@ -274,4 +280,41 @@
             sb.append("<p>Update failed. Exception: " + e.getMessage() + "</p>");
         }
     }
+    
+    private InstallInfo getInstallInfo(StringBuffer sb) {
+        InstallInfo installInfo = null;
+        try {
+            return installInfo = new InstallInfo(request);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            sb.append("<p>Exception: " + e.getMessage() + "</p>");
+            return null;
+        }
+    }
+
+    private UpdateInfo getUpdateInfo(StringBuffer sb) {
+        UpdateInfo updateInfo = null;
+        try {
+            URL UpdateRdfUrl = new URL(getInstallInfo(sb).getUpdateURL());
+            InputStream updateRdfIn = UpdateRdfUrl.openStream();
+            return updateInfo = new UpdateInfo(updateRdfIn, getInstallInfo(sb));
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            sb.append("<p>");
+            sb.append("Yanel could not get the Update information! " + e);
+            sb.append("</p>");
+            return null;
+        }
+    }
+    
+    /**
+     * Get XSLT path
+     */
+    private String[] getXSLTPath(String path) throws Exception {
+        String[] xsltPath = getResourceConfigProperties("xslt");
+        if (xsltPath != null)
+            return xsltPath;
+        log.info("No XSLT Path within: " + path);
+        return null;
+    }    
 }




More information about the Yanel-commits mailing list