Document Library Custom Response - Document Library Custom Response - Alfresco - Alfresco Content Services - Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/Share-UI-Extension-Points/Share-Configuration/Share-Document-Library/Extending-the-Alfresco-Share-Document-Library/Document-Library-Repository-Tier/Document-Library-Custom-Response - 23.4 - 23.4

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License
ft:lastPublication
2026-09-18T00:52:02.442000
ft:locale
en-US

A custom response appears within the metadata.custom section of the JSON response. An example of a cleanly installed service is the vtiServer configuration, defined within the slingshot-context.xml file.

The customResponses property defines a map of JSON key to custom response bean within the SlingshotDocLibCustomerResponse bean definition.

Default slingshotDocLibCustomResponse bean configuration:

<bean id="slingshotDocLibCustomResponse"
   parent="baseJavaScriptExtension"
   class="org.alfresco.repo.jscript.SlingshotDocLibCustomResponse">
  <property name="extensionName">
     <value>slingshotDocLib</value>
  </property>
  <property name="<b>customResponses</b>">
    <map>
       <entry key="vtiServer">
          <ref bean="doclibCustomVtiServer"/>
       </entry>
    </map>
  </property>
</bean>

The bean for returning the vtiServer configuration is defined as:

<bean id="doclibCustomVtiServer" class="org.alfresco.repo.jscript.app.VtiServerCustomResponse">
    <property name="scriptUtils">
        <ref bean="utilsScript" />
    </property>
    <property name="sysAdminParams">
        <ref bean="sysAdminParams" />
    </property>
    <property name="port">
        <value>${vti.server.external.port}</value>
    </property>
    <property name="host">
        <value>${vti.server.external.host}</value>
    </property>
</bean>

The VtiServerCustomResponse class (which implements CustomResponse) returns a Serializable object (for example a LinkedHashMap) that is serialized into the JSON response by the DocLib web scripts.

This extension point is designed to return useful information that is not specific to any node, for example, the presence of an optional module; whether a subsystem is active or not, etc.