[Registry-dev] svn commit r9871 - in trunk/registry: . modules/core
modules/core/src/main/java/org/wso2/registry/client
modules/webapps/src/main/webapp/admin/tiles
svn at wso2.org
svn at wso2.org
Sun Nov 18 21:22:23 PST 2007
Author: chathura
Date: Sun Nov 18 21:22:12 2007
New Revision: 9871
Added:
trunk/registry/modules/core/src/main/java/org/wso2/registry/client/
trunk/registry/modules/core/src/main/java/org/wso2/registry/client/RegistryClient.java
Modified:
trunk/registry/modules/core/pom.xml
trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resource_detail.jsp
trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resources_general.jsp
trunk/registry/pom.xml
Log:
Started implementing client side of the remote registry.
Modified: trunk/registry/modules/core/pom.xml
==============================================================================
--- trunk/registry/modules/core/pom.xml (original)
+++ trunk/registry/modules/core/pom.xml Sun Nov 18 21:22:12 2007
@@ -75,8 +75,24 @@
</dependency>
<dependency>
<groupId>org.wso2.commons.usermanager</groupId>
- <artifactId>usermanager-core</artifactId>
+ <artifactId>usermanager-core</artifactId>
</dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-client</artifactId>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-core</artifactId>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-protocol</artifactId>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-parser</artifactId>-->
+ <!--</dependency>-->
</dependencies>
</project>
Added: trunk/registry/modules/core/src/main/java/org/wso2/registry/client/RegistryClient.java
==============================================================================
--- (empty file)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/client/RegistryClient.java Sun Nov 18 21:22:12 2007
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+package org.wso2.registry.client;
+
+import org.wso2.registry.*;
+
+import java.util.Date;
+
+public class RegistryClient implements Registry {
+
+ public Resource get(String path) throws RegistryException {
+
+ //AbderaClient client = new AbderaClient();
+ //ClientResponse response = client.get(path);
+ //Document doc = response.getDocument();
+ //
+ //if (doc instanceof Feed) {
+ //
+ // Feed feed = (Feed) doc;
+ //
+ // Resource collection = new Resource();
+ // collection.setDirectory(true);
+ //
+ // List entries = feed.getEntries();
+ // String[] childPaths = new String[entries.size()];
+ //
+ // for (int i = 0; i < entries.size(); i++) {
+ // Entry entry = (Entry) entries.get(i);
+ // childPaths[i] = entry.getContentElement().getText();
+ // }
+ //
+ // collection.setContent(childPaths);
+ //
+ // return collection;
+ //
+ //} else if (doc instanceof Entry) {
+ //
+ // Entry entry = (Entry) doc;
+ //
+ // Resource resource = new Resource();
+ // resource.setDirectory(false);
+ // resource.setAuthorUserName(entry.getAuthor().getName());
+ //
+ // String contentURL = entry.getContentElement().getText();
+ //}
+
+ return null;
+ }
+
+ public boolean resourceExists(String path) throws RegistryException {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void put(String path, Resource resource) throws RegistryException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void delete(String path) throws RegistryException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String[] getVersions(String path) throws RegistryException {
+ return new String[0]; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void restoreVersion(String versionPath) throws RegistryException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void applyTag(String resourcePath, String tag) throws RegistryException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public TaggedResourcePath[] getResourcePathsWithTag(String tag) throws RegistryException {
+ return new TaggedResourcePath[0]; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Tag[] getTags(String resourcePath) throws RegistryException {
+ return new Tag[0]; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void addComment(String resourcePath, Comment comment) throws RegistryException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Comment[] getComments(String resourcePath) throws RegistryException {
+ return new Comment[0]; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void rateResource(String resourcePath, int rating) throws RegistryException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public float getAverageRating(String resourcePath) throws RegistryException {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int getRating(String path, String userName) throws RegistryException {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Resource executeQuery(String path, Object[] parameters) throws RegistryException {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public LogEntry[] getLogs(String resourcePath, String userName, Date from, Date to) throws RegistryException {
+ return new LogEntry[0]; //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Modified: trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resource_detail.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resource_detail.jsp (original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resource_detail.jsp Sun Nov 18 21:22:12 2007
@@ -23,7 +23,7 @@
<script language="javascript" type="text/javascript">
var ratingImg="";
for(i=1;i<=5;i++){
- if(i <= <s:property value="Rating"/>){
+ if(i <= <s:property value="averageRating"/>){
ratingImg += '<img src="images/star_on.gif">';
}else{
ratingImg += '<img src="images/star_off.gif">';
@@ -44,7 +44,7 @@
<br/>
<script language="javascript">
onload = function(){
- document.frmRate.rating.selectedIndex= <s:property value="Rating"/>;
+ document.frmRate.rating.selectedIndex= <s:property value="averageRating"/>;
}
</script>
<div class="detail-section">
Modified: trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resources_general.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resources_general.jsp (original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/tiles/resources_general.jsp Sun Nov 18 21:22:12 2007
@@ -49,7 +49,7 @@
<script language="javascript" type="text/javascript">
var ratingImg="";
for(i=1;i<=5;i++){
- if(i <= <s:property value="Rating"/>){
+ if(i <= <s:property value="averageRating"/>){
ratingImg += '<img src="images/star_on.gif">';
}else{
ratingImg += '<img src="images/star_off.gif">';
Modified: trunk/registry/pom.xml
==============================================================================
--- trunk/registry/pom.xml (original)
+++ trunk/registry/pom.xml Sun Nov 18 21:22:12 2007
@@ -173,6 +173,26 @@
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-client</artifactId>-->
+ <!--<version>0.3.0-incubating-SNAPSHOT</version>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-core</artifactId>-->
+ <!--<version>0.3.0-incubating-SNAPSHOT</version>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-protocol</artifactId>-->
+ <!--<version>0.3.0-incubating-SNAPSHOT</version>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>org.apache.abdera</groupId>-->
+ <!--<artifactId>abdera-parser</artifactId>-->
+ <!--<version>0.3.0-incubating-SNAPSHOT</version>-->
+ <!--</dependency>-->
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
@@ -286,8 +306,8 @@
</url>
</repository>
<!--<repository>-->
- <!--<id>wso2-maven2-repository</id>-->
- <!--<url>http://dist.wso2.org/maven2</url>-->
+ <!--<id>wso2-maven2-repository</id>-->
+ <!--<url>http://dist.wso2.org/maven2</url>-->
<!--</repository>-->
<repository>
<releases>
More information about the Registry-dev
mailing list