Removed the Environment from the Publishing REST API methods.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28939 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2011-07-12 10:46:59 +00:00
parent 94e7cd42b1
commit df033727ad
4 changed files with 5 additions and 23 deletions

View File

@@ -1,7 +1,6 @@
<webscript>
<shortname>Query Publishing Events</shortname>
<description>Queries for Publishing Events on an Environment.</description>
<url>/api/publishing/{site_id}/{environment_id}/events/query</url>
<url>/api/publishing/{site_id}/events/query</url>
<format default="json"/>
<authentication>user</authentication>
@@ -12,10 +11,6 @@
<shortname>site_id</shortname>
<description>The id of the site to query.</description>
</arg>
<arg>
<shortname>environment_id</shortname>
<description>The id of the environment to query.</description>
</arg>
</args>
<requests>
<request>

View File

@@ -1,7 +1,6 @@
<webscript>
<shortname>Post Content to Publishing Queue</shortname>
<description>Place a new Publishing Event on the Publishing Queue for the specified Environment.</description>
<url>/api/publishing/{site_id}/{environment_id}/queue</url>
<url>/api/publishing/{site_id}/queue</url>
<format default="json"/>
<authentication>user</authentication>
@@ -12,10 +11,6 @@
<shortname>site_id</shortname>
<description>The id of the site to publish to.</description>
</arg>
<arg>
<shortname>environment_id</shortname>
<description>The id of the environment to publish to. If unspecified the default environment is used.</description>
</arg>
</args>
<requests>
<request>

View File

@@ -19,7 +19,6 @@
package org.alfresco.repo.web.scripts.publishing;
import static org.alfresco.repo.web.scripts.publishing.PublishingWebScriptConstants.ENVIRONMENT_ID;
import static org.alfresco.repo.web.scripts.publishing.PublishingWebScriptConstants.SITE_ID;
import java.util.Map;
@@ -58,21 +57,15 @@ public abstract class PublishingEnvironmentWebScript extends DeclarativeWebScrip
String msg = "A Site ID must be specified!";
throw new WebScriptException(HttpServletResponse.SC_BAD_REQUEST, msg);
}
String environmentId = params.get(ENVIRONMENT_ID);
if(environmentId == null)
if (defaultEnvironmentId == null)
{
if(defaultEnvironmentId == null)
{
String msg = "An Environment ID must be specified!";
throw new WebScriptException(HttpServletResponse.SC_BAD_REQUEST, msg);
}
environmentId = defaultEnvironmentId;
String msg = "An Environment ID must be specified!";
throw new WebScriptException(HttpServletResponse.SC_BAD_REQUEST, msg);
}
Environment environment = publishingService.getEnvironment(siteId, environmentId);
Environment environment = publishingService.getEnvironment(siteId, defaultEnvironmentId);
if(environment == null)
{
String msg = "Environment " +environmentId + " does not exist in site " +siteId;
String msg = "Environment " + defaultEnvironmentId + " does not exist in site " +siteId;
throw new WebScriptException(HttpServletResponse.SC_BAD_REQUEST, msg);
}
return new Pair<String, Environment>(siteId, environment);

View File

@@ -28,7 +28,6 @@ public interface PublishingWebScriptConstants
{
// URL Template Keys.
public static final String SITE_ID = "site_id";
public static final String ENVIRONMENT_ID = "environment_id";
// General Model Keys
public static final String ID = "id";