Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Alfresco 5.0.2 - 5.1

 Procedure

  1. Make sure "cors-filter-1.9.3.jar,java-property-utils-1.9.1.jar" is located in "/opt/alfresco/tomcat/webapps/alfresco/WEB-INF/lib".

  2. Edit /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/web.xml

  3. Uncomment <filter> between <!-- CORS Filter Begin → and<!-- CORS Filter End -->

    Code Block
       <!-- CORS Filter Begin -->
       <filter>
          <filter-name>CORS</filter-name>
          <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
          <init-param>
             <param-name>cors.allowGenericHttpRequests</param-name>
             <param-value>true</param-value>
          </init-param>
          <init-param>
             <param-name>cors.allowOrigin</param-name>
             <param-value>http://localhost:8081</param-value>
          </init-param>
          <init-param>
             <param-name>cors.allowSubdomains</param-name>
             <param-value>true</param-value>
          </init-param>
          <init-param>
             <param-name>cors.supportedMethods</param-name>
             <param-value>GET, HEAD, POST, PUT, DELETE, OPTIONS</param-value>
          </init-param>
          <init-param>
             <param-name>cors.supportedHeaders</param-name>
          </init-param>
          <init-param>
             <param-name>cors.supportsCredentials</param-name>
             <param-value>true</param-value>
          </init-param>
          <init-param>
             <param-name>cors.maxAge</param-name>
             <param-value>3600</param-value>
          </init-param>
       </filter>
       <!-- CORS Filter End -->


  4. Specify the URL to allow on the cross-domain to  "cros.allowOrigin" param-value of the init-param element.  

    (The following asterisk specified here, but please specify with appropriate URL according to environment)  

    Code Block
          <init-param>
             <param-name>cors.allowOrigin</param-name>
             <!--param-value>http://localhost:8081</param-value-->
             <param-value>*</param-value>
          </init-param>



  5. Uncomment  <filter-mapping>  between <!-- CORS Filter Mappings Begin --> and <!-- CORS Filter Mappings End --> .

    Code Block
       <!-- CORS Filter Mappings Begin -->
       <filter-mapping>
          <filter-name>CORS</filter-name>
          <url-pattern>/api/*</url-pattern>
          <url-pattern>/service/*</url-pattern>
          <url-pattern>/s/*</url-pattern>
          <url-pattern>/cmisbrowser/*</url-pattern>
       </filter-mapping>
       <!-- CORS Filter Mappings End -->


  6. Restart the Alfresco.

...