Web Scripts:

- simplify how web scripts urls & formats are described
- fix 'reset' on index page (when accessed via /)
- fix xml status response (rogue html in template)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5897 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2007-06-08 21:39:54 +00:00
parent f95c3de04f
commit bb2536fcf5
36 changed files with 101 additions and 189 deletions

View File

@@ -26,8 +26,6 @@ package org.alfresco.web.scripts;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
/**
@@ -47,9 +45,8 @@ public class WebScriptDescriptionImpl implements WebScriptDescription
private RequiredTransaction requiredTransaction;
private FormatStyle formatStyle;
private String httpMethod;
private URI[] uris;
private String[] uris;
private String defaultFormat;
private Map<String, URI> uriByFormat;
/**
@@ -246,32 +243,19 @@ public class WebScriptDescriptionImpl implements WebScriptDescription
*
* @param uris
*/
public void setUris(URI[] uris)
public void setUris(String[] uris)
{
this.uriByFormat = new HashMap<String, URI>(uris.length);
for (URI uri : uris)
{
this.uriByFormat.put(uri.getFormat(), uri);
}
this.uris = uris;
}
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptDescription#getURIs()
*/
public URI[] getURIs()
public String[] getURIs()
{
return this.uris;
}
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptDescription#getURI(java.lang.String)
*/
public URI getURI(String format)
{
return this.uriByFormat.get(format);
}
/**
* Sets the default response format
*
@@ -290,52 +274,4 @@ public class WebScriptDescriptionImpl implements WebScriptDescription
return this.defaultFormat;
}
/**
* Web Script URL Implementation
*
* @author davidc
*/
public static class URIImpl implements WebScriptDescription.URI
{
private String format;
private String uri;
/**
* Sets the URI response format
*
* @param format
*/
public void setFormat(String format)
{
this.format = format;
}
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptDescription.URI#getFormat()
*/
public String getFormat()
{
return this.format;
}
/**
* Sets the URI
*
* @param uri
*/
public void setUri(String uri)
{
this.uri = uri;
}
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptDescription.URI#getURI()
*/
public String getURI()
{
return this.uri;
}
}
}