forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r240437 - /forrest/trunk/tools/eclipse/plugins/org.apache.forrest.repository.daisy/src/org/apache/forrest/repository/daisy/RepositoryInterface.java
Date Sat, 27 Aug 2005 16:23:59 GMT
Author: rgardler
Date: Sat Aug 27 09:23:55 2005
New Revision: 240437

URL: http://svn.apache.org/viewcvs?rev=240437&view=rev
Log:
Whitespace and formatting

Modified:
    forrest/trunk/tools/eclipse/plugins/org.apache.forrest.repository.daisy/src/org/apache/forrest/repository/daisy/RepositoryInterface.java

Modified: forrest/trunk/tools/eclipse/plugins/org.apache.forrest.repository.daisy/src/org/apache/forrest/repository/daisy/RepositoryInterface.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/plugins/org.apache.forrest.repository.daisy/src/org/apache/forrest/repository/daisy/RepositoryInterface.java?rev=240437&r1=240436&r2=240437&view=diff
==============================================================================
--- forrest/trunk/tools/eclipse/plugins/org.apache.forrest.repository.daisy/src/org/apache/forrest/repository/daisy/RepositoryInterface.java
(original)
+++ forrest/trunk/tools/eclipse/plugins/org.apache.forrest.repository.daisy/src/org/apache/forrest/repository/daisy/RepositoryInterface.java
Sat Aug 27 09:23:55 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.forrest.repository.daisy;
 
-
 import java.util.Locale;
 import java.util.Vector;
 
@@ -32,56 +31,66 @@
 import org.w3c.dom.Element;
 
 /**
- * The main plugin class to be used to interface withthe Daisy repository. It will allow
- * you to search the repository and retrieve a list of documents avaiable. 
+ * The main plugin class to be used to interface withthe Daisy repository. It
+ * will allow you to search the repository and retrieve a list of documents
+ * avaiable.
  */
 
 public class RepositoryInterface {
-	
-	/**
-	 * This searches the repository for all documents and returns a list of them as DOM document

-	 * @param document 
-	 */
-	public static Document SearchRepository(Document document) throws Exception { 
-		
+
+    /**
+     * This searches the repository for all documents and returns a list of them
+     * as DOM document
+     * 
+     * @param document
+     */
+    public static Document SearchRepository(Document document) throws Exception {
+
         Element element = document.createElement("daisy");
         document.appendChild(element);
-        
-		String repositoryLocation = org.apache.forrest.repository.daisy.DaisyPlugin.getDefault().getPluginPreferences()
-        .getString(DaisyPreferences.REPOSITORY_URL);
-		String repositoryPort = org.apache.forrest.repository.daisy.DaisyPlugin.getDefault().getPluginPreferences()
-        .getString(DaisyPreferences.REPOSITORY_PORT);
-		String repositoryUsername = org.apache.forrest.repository.daisy.DaisyPlugin.getDefault().getPluginPreferences()
-        .getString(DaisyPreferences.REPOSITORY_USERNAME);
-		String repositoryPassword = org.apache.forrest.repository.daisy.DaisyPlugin.getDefault().getPluginPreferences()
-        .getString(DaisyPreferences.REPOSITORY_PASSWORD);
-		RepositoryManager repositoryManager = new RemoteRepositoryManager(
-            "http://"+repositoryLocation+":"+repositoryPort, new Credentials(repositoryUsername,
repositoryPassword));
-		 Repository repository =
-	            repositoryManager.getRepository(new Credentials(repositoryUsername, repositoryPassword));
-	        QueryManager queryManager = repository.getQueryManager();
-	        Object searchresults = queryManager.performQuery("select id, name where true", Locale.getDefault());
-	        Row[] rows = ((SearchResultDocument) searchresults).getSearchResult().getRows().getRowArray();
-	        Vector documentList = new Vector();
-			for (int i = 0; i < rows.length; i++) {
-	            String id = rows[i].getValueArray(0);
-	            String documentName = rows[i].getValueArray(1);
-	            String name = "http://" + repositoryUsername +":"+repositoryPassword+"@"+repositoryLocation+":"+repositoryPort;
-	            name = name + "/publisher/documentPage?documentId=";
-	            name = name + id;
-	            name = name + "&includeNavigation=false&locale=en_US;version=live";
-	            Element element2 = document.createElement("item");
-	            element.appendChild(element2);
-	            element2.setAttribute("id",id);
-	            element2.setAttribute("name",documentName);
-	            element2.setAttribute("location",name);
-	            documentList.add(name);
-	        }
-			return document;
-			
-}
-
-	
-	
-	
+
+        String repositoryLocation = org.apache.forrest.repository.daisy.DaisyPlugin
+                .getDefault().getPluginPreferences().getString(
+                        DaisyPreferences.REPOSITORY_URL);
+        String repositoryPort = org.apache.forrest.repository.daisy.DaisyPlugin
+                .getDefault().getPluginPreferences().getString(
+                        DaisyPreferences.REPOSITORY_PORT);
+        String repositoryUsername = org.apache.forrest.repository.daisy.DaisyPlugin
+                .getDefault().getPluginPreferences().getString(
+                        DaisyPreferences.REPOSITORY_USERNAME);
+        String repositoryPassword = org.apache.forrest.repository.daisy.DaisyPlugin
+                .getDefault().getPluginPreferences().getString(
+                        DaisyPreferences.REPOSITORY_PASSWORD);
+        RepositoryManager repositoryManager = new RemoteRepositoryManager(
+                "http://" + repositoryLocation + ":" + repositoryPort,
+                new Credentials(repositoryUsername, repositoryPassword));
+        Repository repository = repositoryManager
+                .getRepository(new Credentials(repositoryUsername,
+                        repositoryPassword));
+        QueryManager queryManager = repository.getQueryManager();
+        Object searchresults = queryManager.performQuery(
+                "select id, name where true", Locale.getDefault());
+        Row[] rows = ((SearchResultDocument) searchresults).getSearchResult()
+                .getRows().getRowArray();
+        Vector documentList = new Vector();
+        for (int i = 0; i < rows.length; i++) {
+            String id = rows[i].getValueArray(0);
+            String documentName = rows[i].getValueArray(1);
+            String name = "http://" + repositoryUsername + ":"
+                    + repositoryPassword + "@" + repositoryLocation + ":"
+                    + repositoryPort;
+            name = name + "/publisher/documentPage?documentId=";
+            name = name + id;
+            name = name + "&includeNavigation=false&locale=en_US;version=live";
+            Element element2 = document.createElement("item");
+            element.appendChild(element2);
+            element2.setAttribute("id", id);
+            element2.setAttribute("name", documentName);
+            element2.setAttribute("location", name);
+            documentList.add(name);
+        }
+        return document;
+
+    }
+
 }



Mime
View raw message