mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Web Script Runtime now takes ServiceRegistry in constructor (not an explicit ever growing list of services)
- default status templates now include Alfresco server information & time of error for diagnostic purposes - template url.match does not include service context anymore e.g. /alfresco/service/api/path/ is now just /api/path/ - added Retrying Transaction Helper to Service Registry git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6088 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
package org.alfresco.web.scripts;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -35,6 +36,7 @@ import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.web.scripts.WebScriptDescription.RequiredAuthentication;
|
||||
import org.alfresco.web.scripts.WebScriptDescription.RequiredTransaction;
|
||||
@@ -61,6 +63,7 @@ public abstract class WebScriptRuntime
|
||||
|
||||
/** Component Dependencies */
|
||||
private WebScriptRegistry registry;
|
||||
private ServiceRegistry serviceRegistry;
|
||||
private RetryingTransactionHelper retryingTransactionHelper;
|
||||
private AuthorityService authorityService;
|
||||
|
||||
@@ -68,13 +71,14 @@ public abstract class WebScriptRuntime
|
||||
* Construct
|
||||
*
|
||||
* @param registry web script registry
|
||||
* @param transactionService transaction service
|
||||
* @param serviceRegistry service registry
|
||||
*/
|
||||
public WebScriptRuntime(WebScriptRegistry registry, RetryingTransactionHelper transactionHelper, AuthorityService authorityService)
|
||||
public WebScriptRuntime(WebScriptRegistry registry, ServiceRegistry serviceRegistry)
|
||||
{
|
||||
this.registry = registry;
|
||||
this.retryingTransactionHelper = transactionHelper;
|
||||
this.authorityService = authorityService;
|
||||
this.serviceRegistry = serviceRegistry;
|
||||
this.authorityService = serviceRegistry.getAuthorityService();
|
||||
this.retryingTransactionHelper = serviceRegistry.getRetryingTransactionHelper();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,6 +209,8 @@ public abstract class WebScriptRuntime
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
model.put("status", status);
|
||||
model.put("url", new URLModel(req));
|
||||
model.put("server", new ServerModel(serviceRegistry.getDescriptorService().getServerDescriptor()));
|
||||
model.put("date", new Date());
|
||||
|
||||
// locate status template
|
||||
// NOTE: search order...
|
||||
|
Reference in New Issue
Block a user