From a0a36dd1eded09c4c09057594672dd6f05d47741 Mon Sep 17 00:00:00 2001 From: David Caruana Date: Thu, 4 Sep 2008 10:40:14 +0000 Subject: [PATCH] Merge from SEAMIST3 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10718 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repository/repository.get.atom.ftl | 39 ++++++ .../repository/repository.get.desc.xml | 7 + .../repo/web/scripts/RepositoryContainer.java | 2 +- .../web/scripts/RepositoryServerModel.java | 16 +++ source/test/apptest/apptest.readme.txt | 33 +++++ source/test/apptest/install.sh | 5 + source/test/apptest/results.html | 126 ++++++++++++++++++ source/test/apptest/test.sh | 6 + 8 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml create mode 100644 source/test/apptest/apptest.readme.txt create mode 100755 source/test/apptest/install.sh create mode 100644 source/test/apptest/results.html create mode 100755 source/test/apptest/test.sh diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl new file mode 100644 index 0000000000..ce224cc936 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl @@ -0,0 +1,39 @@ + + + + ${server.name} + + + Alfresco + Alfresco Repository (${server.edition}) + ${server.version} + + true + false + true + + + + + + <#-- TODO: cmis:id on collection elements - are they required by cmis? --> + <#-- TODO: collection resources --> + + + CMIS root folder + + + CMIS checked-out documents + + + CMIS Types + + + <#-- NOTE: alfresco does not support notion of unfiled... + + CMIS unfiled documents + + --> + + + diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml new file mode 100644 index 0000000000..12cbe3638c --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml @@ -0,0 +1,7 @@ + + Repository AtomPub Service Document + Repository ATOM Publishing Service Document (with CMIS extensions) + /api/repository + + none + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java b/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java index 1b7acd54ec..694444ea87 100644 --- a/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java +++ b/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java @@ -157,7 +157,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten */ public ServerModel getDescription() { - return new RepositoryServerModel(descriptorService.getServerDescriptor()); + return new RepositoryServerModel(descriptorService.getCurrentRepositoryDescriptor()); } /* (non-Javadoc) diff --git a/source/java/org/alfresco/repo/web/scripts/RepositoryServerModel.java b/source/java/org/alfresco/repo/web/scripts/RepositoryServerModel.java index 4cd4ce28a6..0efdf7ce7f 100644 --- a/source/java/org/alfresco/repo/web/scripts/RepositoryServerModel.java +++ b/source/java/org/alfresco/repo/web/scripts/RepositoryServerModel.java @@ -55,6 +55,22 @@ public class RepositoryServerModel implements ServerModel return "Repository"; } + /*(non-Javadoc) + * @see org.alfresco.web.scripts.ServerModel#getId() + */ + public String getId() + { + return serverDescriptor.getId(); + } + + /* (non-Javadoc) + * @see org.alfresco.web.scripts.ServerModel#getName() + */ + public String getName() + { + return serverDescriptor.getName(); + } + /* (non-Javadoc) * @see org.alfresco.web.scripts.ServerModel#getVersionMajor() */ diff --git a/source/test/apptest/apptest.readme.txt b/source/test/apptest/apptest.readme.txt new file mode 100644 index 0000000000..be519b842c --- /dev/null +++ b/source/test/apptest/apptest.readme.txt @@ -0,0 +1,33 @@ +AppClientTest is a tool for testing an AtomPub Service. + +http://code.google.com/p/feedvalidator/wiki/AppClientTest + +1) To install and test installation... + +$ svn co http://feedvalidator.googlecode.com/svn/trunk/apptestsuite/client/validator/ validator +$ python validator/appclienttest.py --output=results.html "http://bitworking.org/projects/apptestsite/app.cgi/service/;service_document" +$ firefox results.html + +The above has been encapsulated in... + +/projects/remote-api/source/test/apptest/install.sh + +2) To execute appclienttest against Alfresco + +/projects/remote-api/source/test/apptest/test.sh + + +3) Note: appclienttest.py arguments... + + -h, --help show this help message and exit + --credentials=FILE FILE that contains a name and password on separate lines + with an optional third line with the authentication type + of 'ClientLogin '. + --output=FILE FILE to store test results + --verbose Print extra information while running. + --quiet Do not print anything while running. + --debug Print low level HTTP information while running. + --html Output is formatted in HTML + --record=DIR Record all the responses to be used later in playback + mode. + --playback=DIR Playback responses stored from a previous run. diff --git a/source/test/apptest/install.sh b/source/test/apptest/install.sh new file mode 100755 index 0000000000..acf5059631 --- /dev/null +++ b/source/test/apptest/install.sh @@ -0,0 +1,5 @@ +# ! /bin/sh + +svn co http://feedvalidator.googlecode.com/svn/trunk/apptestsuite/client/validator/ validator +python validator/appclienttest.py --html --verbose --output=results.html "http://bitworking.org/projects/apptestsite/app.cgi/service/;service_document" +open results.html diff --git a/source/test/apptest/results.html b/source/test/apptest/results.html new file mode 100644 index 0000000000..b3ae33c040 --- /dev/null +++ b/source/test/apptest/results.html @@ -0,0 +1,126 @@ + + + + + + + + + + AppClientTest - Results + + +

Test Report

+
+
Date
+
Thu May 1 16:48:30 2008
+
+
+

Legend

+
+
Informational
+
Information on what was being tested.
+
Warning
+
Warnings indicate behavior that, while legal, may cause
+ either performance or interoperability problems in the field.
+
Error
+
Errors are violations of either the Atom, AtomPub
or HTTP specifications.
+
Log
+
Detailed information on the transaction to help you
debug your service.
+
Success
+
A specific sub-test has been passed successfully.
+ +
+

Entry Collection

Find the first entry collection listed in an Introspection document and run the Entry collection tests against it.

+
    +
  1. Request
    
    +GET http://localhost:8080/alfresco/service/api/repository
    +
    +
    +
    +
    +
  2. +
  3. Response
    
    +
    +status: 200
    +content-location: http://localhost:8080/alfresco/service/api/repository
    +transfer-encoding: chunked
    +server: Apache-Coyote/1.1
    +pragma: no-cache
    +cache-control: no-cache
    +date: Thu, 01 May 2008 15:48:26 GMT
    +content-type: application/atom+xml;charset=UTF-8
    +
    +
    +
    +
    <?xml version="1.0" ?><service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/CMIS/1.0">
    +  <workspace cmis:id="63dbba8b-1224-11dd-bee8-852083ea779d"> 
    +    <atom:title>Main Repository</atom:title>
    +     
    +    <cmis:repository_info> 
    +      <cmis:vendorName>Alfresco</cmis:vendorName> 
    +      <cmis:productName>Alfresco Repository (Community Network)</cmis:productName>
    +      <cmis:productVersion>3.0.0 (dev @build-number@)</cmis:productVersion> 
    +      <cmis:capabilities>
    +        <cmis:capabilityMultifiling>true</cmis:capabilityMultifiling>
    +        <cmis:capabilityAllVersionsSearchable>false</cmis:capabilityAllVersionsSearchable>
    +        <cmis:capabilityPWCUpdatable>true</cmis:capabilityPWCUpdatable>
    +      </cmis:capabilities> 
    +      <cmis:description/>
    +      <cmis:repositoryInfo/>
    +    </cmis:repository_info>
    +
    +     
    +    <collection cmis:collectionType="root" href="http://example.org/cmis/main"> 
    +      <atom:title>CMIS root folder</atom:title> 
    +    </collection> 
    +    <collection cmis:collectionType="checkedout" href="http://example.org/cmis/main?checkedout"> 
    +      <atom:title>CMIS checked-out documents</atom:title> 
    +    </collection> 
    +    <collection cmis:collectionType="types" href="http://example.org/cmis/main?types"> 
    +      <atom:title>CMIS Types</atom:title> 
    +    </collection> 
    +
    +         
    +  </workspace> 
    +</service>
  4. +
  5. [RFC2616] Section 13.3.4 No ETag: header was sent with the response.
  6. +
  7. [RFC2616] Section 13.3.4 No Last-Modified: header was sent with the response.
  8. +
  9. [RFC4287] line 2, column 0: Use of unknown namespace: http://www.cmis.org/CMIS/1.0
  10. +
  11. line 4, column 4: atom_title should contain a xml:lang element (4 occurrences)
  12. +
+

Basic Entry Manipulation

Add and remove three entries to the collection

+
    +
  1. Service Document: http://example.org/cmis/main
  2. +
  3. Request
    
    +GET http://example.org/cmis/main
    +
    +
    +
    +
    +
  4. +
  5. Response
    
    +
    +status: 404
    +content-length: 283
    +server: Apache/2.2.3 (CentOS)
    +connection: close
    +date: Thu, 01 May 2008 15:48:30 GMT
    +content-type: text/html; charset=iso-8859-1
    +
    +
    +
    +
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    +<html><head>
    +<title>404 Not Found</title>
    +</head><body>
    +<h1>Not Found</h1>
    +<p>The requested URL /cmis/main was not found on this server.</p>
    +<hr>
    +<address>Apache/2.2.3 (CentOS) Server at example.org Port 80</address>
    +</body></html>
    +
  6. +
  7. [RFC2616] Section 10.2.1 Could not successfully retrieve the document. Got a status code of: 404
  8. +
  9. Didn't find any Media Collections that would accept GIF images
  10. +
+ diff --git a/source/test/apptest/test.sh b/source/test/apptest/test.sh new file mode 100755 index 0000000000..d09371151f --- /dev/null +++ b/source/test/apptest/test.sh @@ -0,0 +1,6 @@ +# ! /bin/sh + +# TODO: change url to Alfresco root service document + +python validator/appclienttest.py --html --verbose --output=results.html "http://localhost:8080/alfresco/service/api/repository" +open results.html