<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use alfresco hazelcast caches for storing custom data objects in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59009#M20933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="padding: 0px;"&gt;We are in&amp;nbsp; requirement of storing custom object (Map&amp;lt;String&amp;gt;&amp;lt;String&amp;gt;) in caches with some customName(NodeId) in alfresco.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;STRONG&gt;Eg:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;When the user first time invokes custom action in certain node, data will be created in the form of Map and that needs to be stored in cache with region name as nodeId.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;The same data needs to be retrieved from cache using nodeId when user second time invokes same action in the same node .&amp;nbsp;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;And all the caches needs to be cleared automatically with in some pre configured time.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;I guess probably we need to use hazelcast to achieve this,&amp;nbsp;but I cannot able to find the proper documentation for this purpose.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Can someone guide me with the best approach ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Dec 2018 10:59:28 GMT</pubDate>
    <dc:creator>svijay</dc:creator>
    <dc:date>2018-12-17T10:59:28Z</dc:date>
    <item>
      <title>How to use alfresco hazelcast caches for storing custom data objects</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59009#M20933</link>
      <description>We are in&amp;nbsp; requirement of storing custom object (Map&amp;lt;String&amp;gt;&amp;lt;String&amp;gt;) in caches with some customName(NodeId) in alfresco.Eg:&amp;nbsp;When the user first time invokes custom action in certain node, data will be created in the form of Map and that needs to be stored in cache with region name as no</description>
      <pubDate>Mon, 17 Dec 2018 10:59:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59009#M20933</guid>
      <dc:creator>svijay</dc:creator>
      <dc:date>2018-12-17T10:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use alfresco hazelcast caches for storing custom data objects</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59010#M20934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should not have to and never should use Hazelcast as a direct dependency in your Alfresco code. Alfresco already provides a generic abstraction for caches which - on Enterprise installations - may use Hazelcast as the underlying library.&lt;/P&gt;&lt;P&gt;You simply have to define your custom cache as beans &lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/resources/alfresco/cache-context.xml#L183" rel="nofollow noopener noreferrer"&gt;using the Alfresco cache factory&lt;/A&gt; and a &lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/resources/alfresco/tx-cache-context.xml#L266" rel="nofollow noopener noreferrer"&gt;transactional cache&lt;/A&gt; to go along with it to correctly deal with on-commit cache updates. In the beans where you&amp;nbsp;want to use a cache you inject the transactional cache (using SimpleCache&amp;lt;String, String&amp;gt; as type of dependency). Finally, you have to configure &lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/resources/alfresco/caches.properties#L214" rel="nofollow noopener noreferrer"&gt;some properties for how the cache should behave&lt;/A&gt; in your module alfresco-global.properties file. This is also where you effectively determine that the cache uses Hazelcast on Enterprise installations by setting the cluster type - only "fully-distributed" actually will make Alfresco use a pure Hazelcast cache, "invalidating" uses a simple map with Hazelcast-based messaging, and "local" is just that simple map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2018 11:39:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59010#M20934</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-12-17T11:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use alfresco hazelcast caches for storing custom data objects</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59011#M20935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Axel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We would like to generate cache in runtime (i.e) the name should be with nodeId.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;( i.e) We like to add cache object dynamically with nodeId as the key when the user access the node first time through the custom Action.&lt;/P&gt;&lt;P&gt;The methods you mentioned is something which we need to configure before starting server.&lt;/P&gt;&lt;P&gt;Do we have any approach to achieve this in&amp;nbsp; alfresco.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2018 06:39:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59011#M20935</guid>
      <dc:creator>svijay</dc:creator>
      <dc:date>2018-12-18T06:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use alfresco hazelcast caches for storing custom data objects</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59012#M20936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does not make any sense to generate a cache instance during runtime for individual nodes based on their IDs. If you have a system with a million nodes you'd (eventually) end up with a million cache instances.&lt;/P&gt;&lt;P&gt;As far as you have&amp;nbsp;described it, your use case would work with a single pre-configured instance. If you have a custom action you should already have some custom Java code (or are you talking about a script action here?) which is configured before starting the server (via an extension / Spring config), and you'd simply add a cache to that implementation, putting in cache data keyed by the NodeRef (you should never rely on node ID in custom code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whatever you want to cache, please be aware that you will have to deal with cache data invalidation yourself when changes are made&amp;nbsp;to&amp;nbsp;properties / content that you are caching...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 12:50:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59012#M20936</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-12-19T12:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use alfresco hazelcast caches for storing custom data objects</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59013#M20937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Axel&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;It does not make any sense to generate a cache instance during runtime for individual nodes based on their IDs. If you have a system with a million nodes you'd (eventually) end up with a million cache instances.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;We will not use this cache for all nodes. It will be used only for certain file types which is very less in number.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px; font-size: 14px; margin: 0px; padding: 0px;"&gt;As far as you have&amp;nbsp;described it, your use case would work with a single pre-configured instance. If you have a custom action you should already have some custom Java code (or are you talking about a script action here?) which is configured before starting the server (via an extension / Spring config), and you'd simply add a cache to that implementation, putting in cache data keyed by the NodeRef (you should never rely on node ID in custom code).&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px; font-size: 14px; margin: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px; font-size: 14px; margin: 0px; padding: 0px;"&gt;Whatever you want to cache, please be aware that you will have to deal with cache data invalidation yourself when changes are made&amp;nbsp;to&amp;nbsp;properties / content that you are caching...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The reason we want to put it based on node Id is, we stored metadata&amp;nbsp;of certain files &amp;nbsp;in another system. We just want to get the metadata from the other system only one time (At very first time any of the user access the custom Action on particular node).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next time if some other user accesses the same action in same node, we dont want to make another call to get the metadata again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As&amp;nbsp; you said we if pre configure the cache with some generic name and internally&amp;nbsp;keyed with nodeRef, when we invalidate the cache it will remove all the cached data (&lt;STRONG&gt;Includes all nodeRef and cachedata(metadata) key value pairs&lt;/STRONG&gt;- Pls correct me if I am wrong).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to specifically invalidate custom cache related to particular nodeRef alone .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am seeking for some&amp;nbsp; option to create cache object in runtime and invalidation period also need to specified at the time of creating object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vijay S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Dec 2018 07:16:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-use-alfresco-hazelcast-caches-for-storing-custom-data/m-p/59013#M20937</guid>
      <dc:creator>svijay</dc:creator>
      <dc:date>2018-12-26T07:16:00Z</dc:date>
    </item>
  </channel>
</rss>

