2014-01-07 57 views

回答

3

您可以添加自定義端點衝浪&使用SURF代理的Servlet: 例Flickr的端點 共享配置,custom.xml:

<alfresco-config> 
    <config evaluator="string-compare" condition="Remote"> 
     <remote>  
     <endpoint> 
      <id>flickr</id> 
      <name>flickr - unauthenticated access for oembed resolution</name> 
      <description>Access flickr to resolve URLs to embed presentations.</description> 
      <connector-id>http</connector-id> 
      <endpoint-url>http://www.flickr.com/services</endpoint-url> 
      <identity>none</identity> 
     </endpoint>   
     </remote> 
    </config> 
</alfresco-config> 

在瀏覽器JS代碼只是使用Flickr通過端點PROXY,例如添加一個新的VA PROXY_FLICKR_API:

var PROXY_FLICKR_API = Alfresco.constants.PROXY_URI.replace("/alfresco/", "/flickr/"); 
Alfresco.util.Ajax.jsonRequest(
    { 
     method: Alfresco.util.Ajax.GET, 
     url: PROXY_FLICKR_API + "add your concrete URL", 
     successCallback: 
     { 
      ... 
     }, 
     failureCallback: 
     { 
      ... 
     } 
    }); 

你應該通過SURF擴展機制添加您的VAR PROXY_FLICKR_API JS宣言 - 你的目標是markupid(更多詳情http://blogs.alfresco.com/wp/developer/2012/05/22/customizing-share-javascript-widget-instantiation-part-1/):

<@markup id="yourid" target="resources" action="after">