Class AiCapabilitiesWebScript
java.lang.Object
org.springframework.extensions.webscripts.AbstractWebScript
fr.becpg.repo.web.scripts.remote.ai.AiCapabilitiesWebScript
- All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript
public class AiCapabilitiesWebScript
extends org.springframework.extensions.webscripts.AbstractWebScript
Capabilities & bootstrap probe for the AI remote API (/becpg/remote/ai/capabilities).
becpg-ai calls this once per instance/session to (1) detect whether the tenant exposes the new
/becpg/remote/ai/* endpoints (HTTP 200 = new mode, 404 = fall back to the generic remote API), and
(2) bootstrap a small context so it can avoid repeated round-trips: the current user (+ home folder), the
available entity types/models, and the beCPG version. Runs as the authenticated user, so the returned
person/home reflect the caller.
- Author:
- matthieu
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringBump when the AI remote API contract changes in a way clients must detect.private EntityDictionaryServiceprivate org.alfresco.service.cmr.module.ModuleServiceprivate org.alfresco.service.namespace.NamespaceServiceprivate org.alfresco.service.cmr.repository.NodeServiceprivate org.alfresco.service.cmr.security.PersonService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.json.JSONArrayprivate org.json.JSONObjectvoidexecute(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse resp) private static voidputIfPresent(org.json.JSONObject obj, String key, Object value) private StringvoidsetEntityDictionaryService(EntityDictionaryService entityDictionaryService) Setter for the fieldentityDictionaryService.voidsetModuleService(org.alfresco.service.cmr.module.ModuleService moduleService) Setter for the fieldmoduleService.voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) Setter for the fieldnamespaceService.voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) Setter for the fieldnodeService.voidsetPersonService(org.alfresco.service.cmr.security.PersonService personService) Setter for the fieldpersonService.Methods inherited from class org.springframework.extensions.webscripts.AbstractWebScript
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
-
Field Details
-
API_VERSION
Bump when the AI remote API contract changes in a way clients must detect.- See Also:
-
nodeService
private org.alfresco.service.cmr.repository.NodeService nodeService -
namespaceService
private org.alfresco.service.namespace.NamespaceService namespaceService -
personService
private org.alfresco.service.cmr.security.PersonService personService -
entityDictionaryService
-
moduleService
private org.alfresco.service.cmr.module.ModuleService moduleService
-
-
Constructor Details
-
AiCapabilitiesWebScript
public AiCapabilitiesWebScript()
-
-
Method Details
-
execute
public void execute(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse resp) throws IOException - Throws:
IOException
-
buildUser
private org.json.JSONObject buildUser() throws org.json.JSONException- Throws:
org.json.JSONException
-
buildEntityTypes
private org.json.JSONArray buildEntityTypes() throws org.json.JSONException- Throws:
org.json.JSONException
-
resolveBecpgVersion
-
putIfPresent
private static void putIfPresent(org.json.JSONObject obj, String key, Object value) throws org.json.JSONException - Throws:
org.json.JSONException
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) Setter for the field
nodeService.- Parameters:
nodeService- aNodeServiceobject
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) Setter for the field
namespaceService.- Parameters:
namespaceService- aNamespaceServiceobject
-
setPersonService
public void setPersonService(org.alfresco.service.cmr.security.PersonService personService) Setter for the field
personService.- Parameters:
personService- aPersonServiceobject
-
setEntityDictionaryService
Setter for the field
entityDictionaryService.- Parameters:
entityDictionaryService- aEntityDictionaryServiceobject
-
setModuleService
public void setModuleService(org.alfresco.service.cmr.module.ModuleService moduleService) Setter for the field
moduleService.- Parameters:
moduleService- aModuleServiceobject
-