2012-12-14 85 views
2

我目前正在嘗試找出一種方法來禁用系統範圍的Alfresco 4.2.b中的快速共享功能,或者如果它不可能,至少從文檔庫和文檔詳細信息頁面中刪除快捷鏈接。如何禁用Alfresco Share中的快速分享?

我試圖

第一件事就是要把system.quickshare.enabled財產是在alfresco-global.properties文件中配置的優勢。它根本無法投擲下一個異常:

我發現一個問題已打開:https://issues.alfresco.com/jira/browse/ALF-16233

由於它似乎是一個錯誤,並且會在更多發行版中修復,所以我將重點放在從UI中儘快移除快速鏈接。順便說一下,我發現一個相關的帖子有助於:https://forums.alfresco.com/en/viewtopic.php?f=48&t=46659。我已經成功地去掉了文件,鏈接文件,詳細信息頁面區通過創建一個擴展:

<extension> 
    <modules> 
     <module> 
      <id>Removes from document-details page the Share region.</id> 
      <auto-deploy>true</auto-deploy> 
      <components> 
       <component> 
        <scope>template</scope> 
        <region-id>document-links</region-id> 
        <source-id>document-details</source-id> 
        <sub-components> 
         <sub-component id="default"> 
          <evaluations> 
           <evaluation id="hideDocumentLinks"> 
            <render>false</render> 
           </evaluation> 
          </evaluations> 
         </sub-component> 
        </sub-components> 
       </component> 
      </components> 
     </module> 
    </modules> 
</extension> 

這很好。我還從文檔詳細信息頁面執行的份額-config.xml中文件的一些變化,具體由社會部內只剩下空空的標籤的QuickShare鏈接:根據這一邏輯被定義

<config evaluator="string-compare" condition="Social"> 
     <!-- Alfresco QuickShare social widget - for creating public url that can be shared --> 
     <quickshare> 
     <!-- 
      Will be available as Alfresco.constants.QUICKSHARE_URL using javascrip in the browser. 
      If changing this, make sure this url matches the quickshare rule in urlrewrite.xml 
     --> 
     <url>{context}/s/{sharedId}</url> 
     </quickshare> 

     <!-- Alfresco LinkShare social widget - share a link to social sites --> 
     <linkshare> 
     <!-- 
      These actions will be available as Alfresco.constants.LINKSHARE_ACTIONS using javascript in the browser. 
      Labels will be retrieved from msg key "linkshare.action.<id>.label" unless explicitly provided as an 
      attribute to the action element. 
      Each param value accepts the following input: {shareUrl}, {displayName} or a msg key that will be prefixed. 
      I.e. {body} for the email action's href param will be retrieved using "linkshare.action.email.body". 
     --> 
     <action id="email" type="link" index="10"> 
      <param name="href">mailto:?subject={subject}&amp;body={body}</param> 
      <param name="target">new</param> 
     </action> 
     <action id="facebook" type="link" index="20"> 
      <param name="href">https://www.facebook.com/sharer/sharer.php?u={shareUrl}&amp;t={message}</param> 
      <param name="target">new</param> 
     </action> 
     <action id="twitter" type="link" index="30"> 
      <param name="href">https://twitter.com/intent/tweet?text={message}&amp;url={shareUrl}</param> 
      <param name="target">new</param> 
     </action> 
     <action id="google-plus" type="link" index="40"> 
      <param name="href">https://plus.google.com/share?url={shareUrl}</param> 
      <param name="target">new</param> 
     </action> 
     </linkshare> 

    </config> 

該節點header.get.js webscript:

model.showQuickShare = (!model.isContainer && model.showQuickShare && config.scoped["Social"]["quickshare"].getChildValue("url") != null).toString(); 

儘管如此,快享鏈接保持在documentlibrary頁面,這讓我感到吃驚。我相信,上述類似的邏輯可以用來顯示或不顯示文檔庫頁面中的鏈接,但事實並非如此。所以,現在我不知道還有什麼我能做的......至於我已經看到,與documentlibrary插件的客戶端生成該鏈接(documentlist.js):

if (!record.node.isContainer) 
    { 
     html += '<span class="item item-social item-separator">' + Alfresco.DocumentList.generateQuickShare(this, record) + '</span>'; 
    } 

我我正在考慮創建一個自定義documentlibrarywidget的擴展,類似於這裏描述:[url] http://blogs.alfresco.com/wp/ddraper/2012/05/22/customizing-share-javascript-widget-instantiation-part- 1/[/ URL]。這可能嗎?

我想知道在開始自定義小部件之前是否有更簡單的方法來做我需要做的事情。如果這種「神奇」的方式不存在,我想知道所描述的方法是否正確。

在此先感謝。

+1

你已經指出有JIRA門票(我見過他們),但它仍然無法正常工作。所以你唯一的選擇就是等待修復或從字面上破解你的方式。做到這一點快速和骯髒。只需使用CSS隱藏項目社交類,並將share-config-custom中的URL更改爲非工作的URL,以保持安全。 –

+0

非常有用的塔希爾。實際上,我已經從文檔庫和文檔詳細信息頁面中刪除了快速共享鏈接,只需添加此CSS條目即可覆蓋爲鏈接計算的樣式:「.item-social a.quickshare-action {0} {0} {0} {0}} visibility:hidden; }' –

+0

順便說一句,如果你想要的話,發表你的評論作爲答案,我會將它標記爲已接受的答案。 –

回答

2

由於文檔庫小部件(documentlist.js)的擴展並不像我預期的那樣簡單,我已經通過一個更簡單,更簡單和非侵入式的解決方案解決了這個問題,原來的問題。一般而言,它包括定義一個擴展模塊,在每個頁面的標題中添加一個自定義CSS。這CSS覆蓋的QuickShare鏈接的方式是這樣的:

/* Disables the Quick Share link both in documentlibrary and document-details pages */ 
.item-social a.quickshare-action { 
    visibility: hidden; 
} 

如何定義的那種擴展模塊的在這裏解釋說:https://forums.alfresco.com/en/viewtopic.php?f=48&t=47312#p140623

希望它可以幫助其他人試圖達到同樣的效果。

+0

擴展模塊的鏈接不工作。你可以分享鏈接來創建這樣的模塊。謝謝 – nikhil84

相關問題