Merge from SEAMIST3

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10720 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2008-09-04 10:42:23 +00:00
parent 9bb82eff7f
commit f5f2eb4b02
13 changed files with 811 additions and 25 deletions

View File

@@ -0,0 +1,34 @@
<#macro cursor cursor pageArg="pageNo" skipArg="skipCount">
<#-- NOTE: this macro requires the definition of xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" in -->
<#-- the enclosing document -->
<opensearch:totalResults>${cursor.totalRows}</opensearch:totalResults>
<opensearch:startIndex>${cursor.startRow}</opensearch:startIndex>
<opensearch:itemsPerPage>${cursor.pageSize}</opensearch:itemsPerPage>
<#if cursor.pageType = "PAGE">
<#if cursor.hasFirstPage>
<link rel="first" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.firstPage)))?xml}" type="${format.type}"/>
</#if>
<#if cursor.hasLastPage>
<link rel="last" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.lastPage)))?xml}" type="${format.type}"/>
</#if>
<#if cursor.hasPrevPage>
<link rel="prev" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.prevPage)))?xml}" type="${format.type}"/>
</#if>
<#if cursor.hasNextPage>
<link rel="next" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.nextPage)))?xml}" type="${format.type}"/>
</#if>
<#else>
<#if cursor.hasFirstPage>
<link rel="first" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.firstPage)))?xml}" type="${format.type}"/>
</#if>
<#if cursor.hasLastPage>
<link rel="last" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.lastPage)))?xml}" type="${format.type}"/>
</#if>
<#if cursor.hasPrevPage>
<link rel="prev" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.prevPage)))?xml}" type="${format.type}"/>
</#if>
<#if cursor.hasNextPage>
<link rel="next" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.nextPage)))?xml}" type="${format.type}"/>
</#if>
</#if>
</#macro>

View File

@@ -19,7 +19,7 @@
<#-- TODO: cmis:id on collection elements - are they required by cmis? --> <#-- TODO: cmis:id on collection elements - are they required by cmis? -->
<#-- TODO: collection resources --> <#-- TODO: collection resources -->
<collection href="http://example.org/cmis/main" cmis:collectionType="root"> <collection href="${absurl(url.serviceContext)}/api/path/workspace/SpacesStore//children" cmis:collectionType="root">
<atom:title>CMIS root folder</atom:title> <atom:title>CMIS root folder</atom:title>
</collection> </collection>
<collection href="http://example.org/cmis/main?checkedout" cmis:collectionType="checkedout"> <collection href="http://example.org/cmis/main?checkedout" cmis:collectionType="checkedout">

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/CMIS/1.0" xmlns:alf="http://www.alfresco.org">
<generator version="${server.version}">Alfresco (${server.edition})</generator>
<title>${node.name}</title>
<updated>${xmldate(node.properties.modified)}</updated>
<icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
<author>
<name>${node.properties.creator!""}</name>
</author>
<id>urn:uuid:${node.id}</id>
<link rel="self" href="${absurl(url.full)}" type="application/atom+xml"/>
<#if cursor.pageType = "WINDOW">
<#if cursor.hasFirstPage>
<link rel="first" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.firstPage)))}" type="application/atom+xml"/>
</#if>
<#if cursor.hasLastPage>
<link rel="last" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.lastPage)))}" type="application/atom+xml"/>
</#if>
<#if cursor.hasPrevPage>
<link rel="prev" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.prevPage)))}" type="application/atom+xml"/>
</#if>
<#if cursor.hasNextPage>
<link rel="next" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.nextPage)))}" type="application/atom+xml"/>
</#if>
<#else>
<#if cursor.hasFirstPage>
<link rel="first" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.firstPage)))}" type="application/atom+xml"/>
</#if>
<#if cursor.hasLastPage>
<link rel="last" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.lastPage)))}" type="application/atom+xml"/>
</#if>
<#if cursor.hasPrevPage>
<link rel="prev" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.prevPage)))}" type="application/atom+xml"/>
</#if>
<#if cursor.hasNextPage>
<link rel="next" href="${absurl(scripturl(argreplace(url.args, "skipCount", cursor.nextPage)))}" type="application/atom+xml"/>
</#if>
</#if>
<#list results as child>
<entry>
<title>${child.name}</title>
<link rel="alternate" href="${absurl(url.serviceContext)}${child.url}"/>
<icon>${absurl(url.context)}${child.icon16}</icon> <#comment>TODO: What's the standard for entry icons?</#comment>
<id>urn:uuid:${child.id}</id>
<updated>${xmldate(child.properties.modified)}</updated>
<published>${xmldate(child.properties.created)}</published>
<summary>${child.properties.description!""}</summary>
<author>
<name>${child.properties.creator}</name>
</author>
<alf:noderef>${child.nodeRef}</alf:noderef>
</entry>
</#list>
</feed>

View File

@@ -0,0 +1,27 @@
<#import "/org/alfresco/paging.lib.atom.ftl" as pagingLib/>
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/CMIS/1.0" xmlns:alf="http://www.alfresco.org" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<generator version="${server.version}">Alfresco (${server.edition})</generator>
<title>${node.name}</title>
<updated>${xmldate(node.properties.modified)}</updated>
<icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
<author>
<name>${node.properties.creator!""}</name>
</author>
<id>urn:uuid:${node.id}</id>
<link rel="self" href="${absurl(url.full)?xml}" type="${format.type}"/>
<@pagingLib.cursor cursor=cursor/>
<#list results as child>
<entry>
<title>${child.name}</title>
<link rel="alternate" href="${absurl(url.serviceContext)}${child.url}"/>
<id>urn:uuid:${child.id}</id>
<updated>${xmldate(child.properties.modified)}</updated>
<published>${xmldate(child.properties.created)}</published>
<summary>${child.properties.description!""}</summary>
<author><name>${child.properties.creator}</name></author>
<alf:noderef>${child.nodeRef}</alf:noderef>
<alf:icon>${absurl(url.context)}${child.icon16}</alf:icon>
</entry>
</#list>
</feed>

View File

@@ -0,0 +1,8 @@
<webscript>
<shortname>Retrieve list of children</shortname>
<description>Retrieve list of child folders and/or documents</description>
<url>/api/node/{store_type}/{store_id}/{id}/children?types={types}&amp;filter={filter?}&amp;skipCount={skipCount?}&amp;maxChildren={maxChildren?}</url>
<url>/api/path/{store_type}/{store_id}/{id}/children?types={types}&amp;filter={filter?}&amp;skipCount={skipCount?}&amp;maxChildren={maxChildren?}</url>
<authentication>guest</authentication>
<format default="atomfeed" />
</webscript>

View File

@@ -0,0 +1,31 @@
script:
{
// locate node
var pathSegments = url.match.split("/");
var reference = [ url.templateArgs.store_type, url.templateArgs.store_id, url.templateArgs.id ];
model.node = cmis.findNode(pathSegments[2], reference);
if (model.node === null)
{
status.code = 404;
status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " not found";
status.redirect = true;
break script;
}
// handle filters
model.types = cmis.findArg(args.types, headers["CMIS-types"]) === null ? cmis.defaultTypesFilter : cmis.findArg(args.types, headers["CMIS-types"]);
if (!cmis.isValidTypesFilter(model.types))
{
status.code = 400;
status.message = "Types filter '" + model.types + "' unknown";
status.redirect = true;
break script;
}
// TODO: property filters
// retrieve children
var page = paging.createPageOrWindow(args.pageNo, args.pageSize, cmis.findArg(args.skipCount, headers["CMIS-skipCount"]), cmis.findArg(args.maxChildren, headers["CMIS-maxChildren"]));
var paged = cmis.queryChildren(model.node, model.types, page);
model.results = paged.results;
model.cursor = paged.cursor;
}

View File

@@ -93,6 +93,13 @@
<bean id="webscripts.container" class="org.alfresco.repo.web.scripts.RepositoryContainer" parent="webscripts.abstractcontainer"> <bean id="webscripts.container" class="org.alfresco.repo.web.scripts.RepositoryContainer" parent="webscripts.abstractcontainer">
<property name="name"><value>Repository</value></property> <property name="name"><value>Repository</value></property>
<property name="scriptObjects">
<map>
<entry key="paging">
<ref bean="webscripts.js.paging" />
</entry>
</map>
</property>
<property name="registryFactory"> <property name="registryFactory">
<bean class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean"> <bean class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean">
<property name="targetBeanName"><idref local="webscripts.registry.prototype"/></property> <property name="targetBeanName"><idref local="webscripts.registry.prototype"/></property>
@@ -133,6 +140,32 @@
<bean id="webscripts.authenticator.facebook" class="org.alfresco.repo.web.scripts.facebook.FacebookAuthenticatorFactory" /> <bean id="webscripts.authenticator.facebook" class="org.alfresco.repo.web.scripts.facebook.FacebookAuthenticatorFactory" />
<!-- -->
<!-- CMIS Support -->
<!-- -->
<bean id="webscripts.cmis.navigation" class="org.alfresco.repo.cmis.Navigation">
<property name="dictionaryService" ref="dictionaryService" />
<property name="searchService" ref="searchService" />
</bean>
<!-- -->
<!-- Web Script Javascript Extensions -->
<!-- -->
<!-- TODO: the following root js objects should only really be available in context of web scripts -->
<bean id="webscripts.js.paging" class="org.alfresco.repo.web.util.paging.Paging" />
<bean id="webscripts.js.cmis" parent="baseJavaScriptExtension" class="org.alfresco.repo.cmis.CMISScript">
<property name="extensionName"><value>cmis</value></property>
<property name="serviceRegistry" ref="ServiceRegistry" />
<property name="repository" ref="webscripts.repo" />
<property name="navigation" ref="webscripts.cmis.navigation" />
<property name="paging" ref="webscripts.js.paging" />
</bean>
<!-- --> <!-- -->
<!-- API Beans --> <!-- API Beans -->

View File

@@ -0,0 +1,218 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.cmis;
import org.alfresco.repo.cmis.Navigation.TypesFilter;
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
import org.alfresco.repo.jscript.ScriptNode;
import org.alfresco.repo.web.scripts.Repository;
import org.alfresco.repo.web.util.paging.Cursor;
import org.alfresco.repo.web.util.paging.Page;
import org.alfresco.repo.web.util.paging.PagedResults;
import org.alfresco.repo.web.util.paging.Paging;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
/**
* CMIS Javascript API
*
* @author davic
*/
public class CMISScript extends BaseScopableProcessorExtension
{
private static final TypesFilter defaultTypesFilter = TypesFilter.FoldersAndDocuments;
private ServiceRegistry services;
private Repository repository;
private Navigation navigation;
private Paging paging;
/**
* Set the service registry
*
* @param services the service registry
*/
public void setServiceRegistry(ServiceRegistry services)
{
this.services = services;
}
/**
* Set the repository
*
* @param repository
*/
public void setRepository(Repository repository)
{
this.repository = repository;
}
/**
* Set the paging helper
*
* @param paging
*/
public void setPaging(Paging paging)
{
this.paging = paging;
}
/**
* Set the CMIS Navigation helper
*
* @param navigation
*/
public void setNavigation(Navigation navigation)
{
this.navigation = navigation;
}
/**
* Finds the arg value from the specified url argument and header
*
* NOTE: Url argument takes precedence over header
*
* @param argVal url arg value
* @param headerVal header value
* @return value (or null)
*/
public String findArg(String argVal, String headerVal)
{
return (argVal == null) ? headerVal : argVal;
}
/**
* Finds the arg value from the specified url argument and header
*
* NOTE: Url argument takes precedence over header
*
* @param argVal url arg value
* @param headerVal header value
* @return value (or null)
*/
public String[] findArgM(String[] argVal, String[] headerVal)
{
return (argVal == null) ? headerVal : argVal;
}
/**
* Gets the default Types filter
*
* @return default types filter
*/
public String getDefaultTypesFilter()
{
return defaultTypesFilter.toString();
}
/**
* Is specified Types filter valid?
*
* @param typesFilter types filter
* @return true => valid
*/
public boolean isValidTypesFilter(String typesFilter)
{
try
{
TypesFilter.valueOf(typesFilter);
return true;
}
catch(IllegalArgumentException e)
{
return false;
}
catch(NullPointerException e)
{
return false;
}
}
/**
* Finds a Node with the repository given a reference
*
* @param referenceType node, path
* @param reference node => id, path => path
* @return node (or null, if not found)
*/
public ScriptNode findNode(String referenceType, String[] reference)
{
ScriptNode node = null;
NodeRef nodeRef = repository.findNodeRef(referenceType, reference);
if (nodeRef != null)
{
node = new ScriptNode(nodeRef, services, getScope());
}
return node;
}
/**
* Query for node children
*
* @param parent node to query children for
* @param typesFilter types filter
* @param page page to query for
* @return paged result set of children
*/
public PagedResults queryChildren(ScriptNode parent, String typesFilter, Page page)
{
TypesFilter filter = resolveTypesFilter(typesFilter);
NodeRef[] children = navigation.getChildren(parent.getNodeRef(), filter);
Cursor cursor = paging.createCursor(children.length, page);
ScriptNode[] nodes = new ScriptNode[cursor.getRowCount()];
for (int i = cursor.getStartRow(); i <= cursor.getEndRow(); i++)
{
nodes[i - cursor.getStartRow()] = new ScriptNode(children[i], services, getScope());
}
PagedResults results = paging.createPagedResults(nodes, cursor);
return results;
}
/**
* Resolve to a Types Filter
*
* NOTE: If specified types filter is not specified or invalid, the default types
* filter is returned
*
* @param typesFilter types filter
* @return resolved types filter
*/
private TypesFilter resolveTypesFilter(String typesFilter)
{
if (isValidTypesFilter(typesFilter))
{
return TypesFilter.valueOf(typesFilter);
}
else
{
return defaultTypesFilter;
}
}
}

View File

@@ -0,0 +1,179 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.cmis;
import java.util.List;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.search.QueryParameterDefImpl;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.search.QueryParameterDefinition;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.springframework.beans.factory.InitializingBean;
/**
* CMIS Navigation Service
*
* @author davidc
*/
public class Navigation implements InitializingBean
{
/**
* Types Filter
*
* @author davidc
*/
public enum TypesFilter
{
Folders,
FoldersAndDocuments,
Documents
};
/** Query Parameters */
private static final QName PARAM_PARENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "parent");
/** Shallow search for all files and folders */
private static final String LUCENE_QUERY_SHALLOW_FOLDERS =
"+PARENT:\"${cm:parent}\" " +
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
"+TYPE:\"" + ContentModel.TYPE_FOLDER + "\" ";
/** Shallow search for all files and folders */
private static final String LUCENE_QUERY_SHALLOW_FILES =
"+PARENT:\"${cm:parent}\" " +
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
"+TYPE:\"" + ContentModel.TYPE_CONTENT + "\" ";
// dependencies
private DictionaryService dictionaryService;
private SearchService searchService;
private DataTypeDefinition nodeRefDataType;
/**
* @param dictionaryService
*/
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
/**
* @param searchService
*/
public void setSearchService(SearchService searchService)
{
this.searchService = searchService;
}
/**
* Initialisation
*/
public void afterPropertiesSet() throws Exception
{
nodeRefDataType = dictionaryService.getDataType(DataTypeDefinition.NODE_REF);
}
/**
* Query for node children
*
* @param parent node to query children for
* @param typesFilter types filter
* @return children of node
*/
public NodeRef[] getChildren(NodeRef parent, TypesFilter typesFilter)
{
if (typesFilter == TypesFilter.FoldersAndDocuments)
{
NodeRef[] folders = queryChildren(parent, TypesFilter.Folders);
NodeRef[] docs = queryChildren(parent, TypesFilter.Documents);
NodeRef[] foldersAndDocs = new NodeRef[folders.length + docs.length];
System.arraycopy(folders, 0, foldersAndDocs, 0, folders.length);
System.arraycopy(docs, 0, foldersAndDocs, folders.length, docs.length);
return foldersAndDocs;
}
else if (typesFilter == TypesFilter.Folders)
{
NodeRef[] folders = queryChildren(parent, TypesFilter.Folders);
return folders;
}
else if (typesFilter == TypesFilter.Documents)
{
NodeRef[] docs = queryChildren(parent, TypesFilter.Documents);
return docs;
}
return new NodeRef[0];
}
/**
* Query children helper
*
* NOTE: Queries for folders only or documents only
*
* @param parent node to query children for
* @param typesFilter folders or documents
* @return node children
*/
private NodeRef[] queryChildren(NodeRef parent, TypesFilter typesFilter)
{
SearchParameters params = new SearchParameters();
params.setLanguage(SearchService.LANGUAGE_LUCENE);
params.addStore(parent.getStoreRef());
QueryParameterDefinition parentDef = new QueryParameterDefImpl(PARAM_PARENT, nodeRefDataType, true, parent.toString());
params.addQueryParameterDefinition(parentDef);
if (typesFilter == TypesFilter.Folders)
{
params.setQuery(LUCENE_QUERY_SHALLOW_FOLDERS);
}
else if (typesFilter == TypesFilter.Documents)
{
params.setQuery(LUCENE_QUERY_SHALLOW_FILES);
}
ResultSet resultSet = searchService.query(params);
try
{
List<NodeRef> results = resultSet.getNodeRefs();
NodeRef[] nodeRefs = new NodeRef[results.size()];
return results.toArray(nodeRefs);
}
finally
{
resultSet.close();
}
}
}

View File

@@ -135,6 +135,28 @@ public class Paging
return zeroBasedRow; return zeroBasedRow;
} }
/**
* Create a Page or Window
*
* @param pageNumber page number (optional and paired with pageSize)
* @param pageSize page size (optional and paired with pageNumber)
* @param skipCount skipCount (optional and paired with maxItems)
* @param maxItems maxItems (optional and paired with skipCount)
* @return page (if pageNumber driven) or window (if skipCount driven)
*/
public Page createPageOrWindow(Integer pageNumber, Integer pageSize, Integer skipCount, Integer maxItems)
{
if (pageNumber != null)
{
return createPage(pageNumber, pageSize == null ? 0 : pageSize);
}
else if (skipCount != null)
{
return createWindow(skipCount, maxItems == null ? 0 : maxItems);
}
return createUnlimitedPage();
}
/** /**
* Create a Page * Create a Page
* *
@@ -147,6 +169,16 @@ public class Paging
return new Page(PageType.PAGE, zeroBasedPage, pageNumber, pageSize); return new Page(PageType.PAGE, zeroBasedPage, pageNumber, pageSize);
} }
/**
* Create an unlimited Page
*
* @return page (single Page starting at first page of unlimited page size)
*/
public Page createUnlimitedPage()
{
return new Page(PageType.PAGE, zeroBasedPage, zeroBasedPage ? 0 : 1, 0);
}
/** /**
* Create a Window * Create a Window
* @param skipRows number of rows to skip * @param skipRows number of rows to skip

View File

@@ -0,0 +1,2 @@
admin
admin

View File

@@ -13,7 +13,7 @@
<h1>Test Report</h1> <h1>Test Report</h1>
<dl> <dl>
<dt>Date</dt> <dt>Date</dt>
<dd>Thu May 1 16:48:30 2008</dd> <dd>Mon May 12 15:38:50 2008</dd>
</dl> </dl>
<div class='legend'> <div class='legend'>
<h3>Legend</h3> <h3>Legend</h3>
@@ -48,7 +48,7 @@ transfer-encoding: chunked
server: Apache-Coyote/1.1 server: Apache-Coyote/1.1
pragma: no-cache pragma: no-cache
cache-control: no-cache cache-control: no-cache
date: Thu, 01 May 2008 15:48:26 GMT date: Mon, 12 May 2008 14:38:47 GMT
content-type: application/atom+xml;charset=UTF-8 content-type: application/atom+xml;charset=UTF-8
@@ -71,7 +71,7 @@ content-type: application/atom+xml;charset=UTF-8
&lt;/cmis:repository_info&gt; &lt;/cmis:repository_info&gt;
&lt;collection cmis:collectionType="root" href="http://example.org/cmis/main"&gt; &lt;collection cmis:collectionType="root" href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children"&gt;
&lt;atom:title&gt;CMIS root folder&lt;/atom:title&gt; &lt;atom:title&gt;CMIS root folder&lt;/atom:title&gt;
&lt;/collection&gt; &lt;/collection&gt;
&lt;collection cmis:collectionType="checkedout" href="http://example.org/cmis/main?checkedout"&gt; &lt;collection cmis:collectionType="checkedout" href="http://example.org/cmis/main?checkedout"&gt;
@@ -91,9 +91,9 @@ content-type: application/atom+xml;charset=UTF-8
</ol> </ol>
<h2>Basic Entry Manipulation</h2><p>Add and remove three entries to the collection</p> <h2>Basic Entry Manipulation</h2><p>Add and remove three entries to the collection</p>
<ol> <ol>
<li class='Info'><img src='validator/res/info.gif'> <span class='Info'>Service Document: http://example.org/cmis/main</span></li> <li class='Info'><img src='validator/res/info.gif'> <span class='Info'>Service Document: http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children</span></li>
<li class='Log'><img src='validator/res/log.gif'> Request <span class='Log'><pre><code> <li class='Log'><img src='validator/res/log.gif'> Request <span class='Log'><pre><code>
GET http://example.org/cmis/main GET http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children
@@ -101,26 +101,193 @@ GET http://example.org/cmis/main
<pre><code class='prettyprint'></code></pre></span></li> <pre><code class='prettyprint'></code></pre></span></li>
<li class='Log'><img src='validator/res/log.gif'> Response <span class='Log'><pre><code> <li class='Log'><img src='validator/res/log.gif'> Response <span class='Log'><pre><code>
status: 404 status: 200
content-length: 283 content-location: http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children
server: Apache/2.2.3 (CentOS) transfer-encoding: chunked
connection: close server: Apache-Coyote/1.1
date: Thu, 01 May 2008 15:48:30 GMT pragma: no-cache
content-type: text/html; charset=iso-8859-1 cache-control: no-cache
date: Mon, 12 May 2008 14:38:50 GMT
content-type: application/atom+xml;type=feed;charset=UTF-8
</code></pre> </code></pre>
<pre><code class='prettyprint'>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt; <pre><code class='prettyprint'>&lt;?xml version="1.0" ?&gt;&lt;feed xmlns="http://www.w3.org/2005/Atom" xmlns:alf="http://www.alfresco.org" xmlns:cmis="http://www.cmis.org/CMIS/1.0"&gt;
&lt;html&gt;&lt;head&gt; &lt;generator version="3.0.0 (dev @build-number@)"&gt;Alfresco (Community Network)&lt;/generator&gt;
&lt;title&gt;404 Not Found&lt;/title&gt; &lt;title&gt;Company Home&lt;/title&gt;
&lt;/head&gt;&lt;body&gt; &lt;updated&gt;2008-04-24T18:33:35.511+01:00&lt;/updated&gt;
&lt;h1&gt;Not Found&lt;/h1&gt; &lt;icon&gt;http://localhost:8080/alfresco/images/logo/AlfrescoLogo16.ico&lt;/icon&gt;
&lt;p&gt;The requested URL /cmis/main was not found on this server.&lt;/p&gt; &lt;author&gt;
&lt;hr&gt; &lt;name&gt;System&lt;/name&gt;
&lt;address&gt;Apache/2.2.3 (CentOS) Server at example.org Port 80&lt;/address&gt; &lt;/author&gt;
&lt;/body&gt;&lt;/html&gt; &lt;id&gt;urn:uuid:6413e19d-1224-11dd-bee8-852083ea779d&lt;/id&gt;
&lt;link href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children" rel="self" type="application/atom+xml;type=feed"/&gt;
&lt;link href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children?skipCount=0&amp;amp;guest=" rel="first" type="application/atom+xml;type=feed"/&gt;
&lt;entry&gt;
&lt;title&gt;Data Dictionary&lt;/title&gt;
&lt;link href="http://localhost:8080/alfresco/service/n/browse/workspace/SpacesStore/642ce7e4-1224-11dd-bee8-852083ea779d" rel="alternate"/&gt;
&lt;icon&gt;http://localhost:8080/alfresco/images/icons/space-icon-default-16.gif&lt;/icon&gt;
&lt;id&gt;urn:uuid:642ce7e4-1224-11dd-bee8-852083ea779d&lt;/id&gt;
&lt;updated&gt;2008-04-24T18:33:35.708+01:00&lt;/updated&gt;
&lt;published&gt;2008-04-24T18:32:20.013+01:00&lt;/published&gt;
&lt;summary&gt;User managed definitions&lt;/summary&gt;
&lt;author&gt;
&lt;name&gt;System&lt;/name&gt;
&lt;/author&gt;
&lt;alf:noderef&gt;workspace://SpacesStore/642ce7e4-1224-11dd-bee8-852083ea779d&lt;/alf:noderef&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;title&gt;Guest Home&lt;/title&gt;
&lt;link href="http://localhost:8080/alfresco/service/n/browse/workspace/SpacesStore/648715e5-1224-11dd-bee8-852083ea779d" rel="alternate"/&gt;
&lt;icon&gt;http://localhost:8080/alfresco/images/icons/space-icon-default-16.gif&lt;/icon&gt;
&lt;id&gt;urn:uuid:648715e5-1224-11dd-bee8-852083ea779d&lt;/id&gt;
&lt;updated&gt;2008-04-24T18:33:36.941+01:00&lt;/updated&gt;
&lt;published&gt;2008-04-24T18:32:20.608+01:00&lt;/published&gt;
&lt;summary&gt;The guest root space&lt;/summary&gt;
&lt;author&gt;
&lt;name&gt;System&lt;/name&gt;
&lt;/author&gt;
&lt;alf:noderef&gt;workspace://SpacesStore/648715e5-1224-11dd-bee8-852083ea779d&lt;/alf:noderef&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;title&gt;User Homes&lt;/title&gt;
&lt;link href="http://localhost:8080/alfresco/service/n/browse/workspace/SpacesStore/64963118-1224-11dd-bee8-852083ea779d" rel="alternate"/&gt;
&lt;icon&gt;http://localhost:8080/alfresco/images/icons/space-icon-default-16.gif&lt;/icon&gt;
&lt;id&gt;urn:uuid:64963118-1224-11dd-bee8-852083ea779d&lt;/id&gt;
&lt;updated&gt;2008-04-24T18:33:37.110+01:00&lt;/updated&gt;
&lt;published&gt;2008-04-24T18:32:20.699+01:00&lt;/published&gt;
&lt;summary&gt;User Homes&lt;/summary&gt;
&lt;author&gt;
&lt;name&gt;System&lt;/name&gt;
&lt;/author&gt;
&lt;alf:noderef&gt;workspace://SpacesStore/64963118-1224-11dd-bee8-852083ea779d&lt;/alf:noderef&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;title&gt;Projects&lt;/title&gt;
&lt;link href="http://localhost:8080/alfresco/service/n/browse/workspace/SpacesStore/90df9f8b-1224-11dd-bee8-852083ea779d" rel="alternate"/&gt;
&lt;icon&gt;http://localhost:8080/alfresco/images/icons/space-icon-default-16.gif&lt;/icon&gt;
&lt;id&gt;urn:uuid:90df9f8b-1224-11dd-bee8-852083ea779d&lt;/id&gt;
&lt;updated&gt;2008-04-24T18:33:47.401+01:00&lt;/updated&gt;
&lt;published&gt;2008-04-24T18:33:35.091+01:00&lt;/published&gt;
&lt;summary&gt;Project Collaboration Spaces&lt;/summary&gt;
&lt;author&gt;
&lt;name&gt;System&lt;/name&gt;
&lt;/author&gt;
&lt;alf:noderef&gt;workspace://SpacesStore/90df9f8b-1224-11dd-bee8-852083ea779d&lt;/alf:noderef&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;title&gt;Web Projects&lt;/title&gt;
&lt;link href="http://localhost:8080/alfresco/service/n/browse/workspace/SpacesStore/a3beb60b-1224-11dd-bee8-852083ea779d" rel="alternate"/&gt;
&lt;icon&gt;http://localhost:8080/alfresco/images/icons/space-icon-default-16.gif&lt;/icon&gt;
&lt;id&gt;urn:uuid:a3beb60b-1224-11dd-bee8-852083ea779d&lt;/id&gt;
&lt;updated&gt;2008-04-24T18:34:06.711+01:00&lt;/updated&gt;
&lt;published&gt;2008-04-24T18:34:06.649+01:00&lt;/published&gt;
&lt;summary&gt;Web Content Management Spaces&lt;/summary&gt;
&lt;author&gt;
&lt;name&gt;System&lt;/name&gt;
&lt;/author&gt;
&lt;alf:noderef&gt;workspace://SpacesStore/a3beb60b-1224-11dd-bee8-852083ea779d&lt;/alf:noderef&gt;
&lt;/entry&gt;
&lt;/feed&gt;</code></pre></span></li>
<li class='Warning'><img src='validator/res/warning.gif'> <a href='http://tools.ietf.org/html/rfc2616#section-13.3.4'>[RFC2616] Section 13.3.4</a> <span class='Warning'>No ETag: header was sent with the response.</span></li>
<li class='Warning'><img src='validator/res/warning.gif'> <a href='http://tools.ietf.org/html/rfc2616#section-13.3.4'>[RFC2616] Section 13.3.4</a> <span class='Warning'>No Last-Modified: header was sent with the response.</span></li>
<li class='Error'><img src='validator/res/error.gif'> [RFC4287] <span class='Error'>line 18, column 4: Undefined entry element: icon (5 occurrences)</span></li>
<li class='Warning'><img src='validator/res/warning.gif'> [RFC4287] <span class='Warning'>line 2, column 0: Use of unknown namespace: http://www.cmis.org/CMIS/1.0
line 2, column 0: Use of unknown namespace: http://www.alfresco.org
line 11, column 145: "self" link references a non-Atom representation</span></li>
<li class='Info'><img src='validator/res/info.gif'> <span class='Info'>line 4, column 2: title should contain a xml:lang element (6 occurrences)
line 22, column 4: summary should contain a xml:lang element (5 occurrences)</span></li>
<li class='Info'><img src='validator/res/info.gif'> <span class='Info'>Create new entry #1</span></li>
<li class='Log'><img src='validator/res/log.gif'> Request <span class='Log'><pre><code>
POST http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children
content-type: application/atom+xml
slug: ddabfdegge
</code></pre>
<pre><code class='prettyprint'>&lt;?xml version="1.0" ?&gt;&lt;entry xmlns="http://www.w3.org/2005/Atom"&gt;
&lt;title&gt;Iñtërnâtiônàlizætiøn - 1&lt;/title&gt;
&lt;id&gt;tag:bitworking.org,2008-02-26:1210603130.5665419&lt;/id&gt;
&lt;updated&gt;2005-07-10T12:29:29Z&lt;/updated&gt;
&lt;author&gt;
&lt;name&gt;Joe Gregorio&lt;/name&gt;
&lt;/author&gt;
&lt;content type="xhtml"&gt;
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;&lt;i&gt;A test of utf-8&lt;/i&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/content&gt;
&lt;/entry&gt;</code></pre></span></li>
<li class='Log'><img src='validator/res/log.gif'> Response <span class='Log'><pre><code>
status: 405
transfer-encoding: chunked
server: Apache-Coyote/1.1
pragma: no-cache
cache-control: no-cache
date: Mon, 12 May 2008 14:38:50 GMT
content-type: text/html;charset=UTF-8
</code></pre>
<pre><code class='prettyprint'>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;Web Script Status 405 - Method Not Allowed&lt;/title&gt;
&lt;link rel="stylesheet" href="/alfresco/css/base.css" TYPE="text/css"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /&gt;&lt;/td&gt;
&lt;td&gt;&lt;span class="title"&gt;Web Script Status 405 - Method Not Allowed&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;
&lt;table&gt;
&lt;tr&gt;&lt;td&gt;The Web Script &lt;a href="/alfresco/service/api/path/workspace/SpacesStore//children"&gt;/alfresco/service/api/path/workspace/SpacesStore//children&lt;/a&gt; has responded with a status of 405 - Method Not Allowed.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;
&lt;table&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;405 Description:&lt;/b&gt;&lt;/td&gt;&lt;td&gt; The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Message:&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Script url /api/path/workspace/SpacesStore//children does not support the method POST&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Exception:&lt;/b&gt;&lt;/td&gt;&lt;td&gt;org.alfresco.web.scripts.WebScriptException - Script url /api/path/workspace/SpacesStore//children does not support the method POST&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:113)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;javax.servlet.http.HttpServlet.service(HttpServlet.java:803)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.alfresco.web.app.servlet.MTWebScriptAuthenticationFilter.doFilter(MTWebScriptAuthenticationFilter.java:102)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;java.lang.Thread.run(Thread.java:613)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Server&lt;/b&gt;:&lt;/td&gt;&lt;td&gt;Alfresco Community Network v3.0.0 (dev @build-number@) schema 124&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Time&lt;/b&gt;:&lt;/td&gt;&lt;td&gt;May 12, 2008 3:38:50 PM&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre></span></li> </code></pre></span></li>
<li class='Error'><img src='validator/res/error.gif'> <a href='http://tools.ietf.org/html/rfc2616#section-10.2.1'>[RFC2616] Section 10.2.1</a> <span class='Error'>Could not successfully retrieve the document. Got a status code of: 404</span></li> <li class='Error'><img src='validator/res/error.gif'> <a href='http://tools.ietf.org/html/rfc5023#section-9.2'>[RFC5023] Section 9.2</a> <span class='Error'>Entry creation failed with status: 405 Method Not Allowed</span></li>
<li class='Info'><img src='validator/res/info.gif'> <span class='Info'>Didn't find any Media Collections that would accept GIF images</span></li> <li class='Info'><img src='validator/res/info.gif'> <span class='Info'>Didn't find any Media Collections that would accept GIF images</span></li>
</ol> </ol>

View File

@@ -1,6 +1,4 @@
# ! /bin/sh # ! /bin/sh
# TODO: change url to Alfresco root service document python validator/appclienttest.py --html --credentials=credentials.txt --verbose --output=results.html "http://localhost:8080/alfresco/service/api/repository"
python validator/appclienttest.py --html --verbose --output=results.html "http://localhost:8080/alfresco/service/api/repository"
open results.html open results.html