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

View File

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

View File

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

View File

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