sivaprasad9394
Occasional Collector

Required more explanation for isReleaseSupported() Method

Hello Team,

I would like to understand more on this method, For me documentation is not enough.

--- Indicates wether this element supports release(boolean) or not.

de.espirit.firstspirit.access.store.IDProvider

If some has some more information please share me.

for (ReferenceEntry entry : page.getIncomingReferences()) {

  if (entry.getType() == ReferenceEntry.SITE_STORE_REFERENCE && entry.getReferencedElement() instanceof PageRef) {

         PageRef pageRef = (PageRef) entry.getReferencedElement();

             if (pageRef.getStore().isReleaseSupported()){

             ....

             ........

             ...........

             }

     }   

}


In the above code pageRef.getStore().isReleaseSupported() when will this condition become true? For me it always returns false in the code implementation.

But in Bean-shell test for pageRef it shows true.

Bean_Shell_Console.png

More about current store and release store information required.

Thank you,

Regards,

Siva

0 Kudos
1 Reply
StefanSchulz
I'm new here

Hi Siva,

The logic behind isReleaseSupported is not that complex: It is true if

  • the element, the method is invoked upon, is in the current store (i.e., the store represents the working state not the released state)
  • the store related to the element does actually support current and release states, which is the case for page store, site store, media store and global store but not content store and template store.

Hope this helps.

Best wishes

Stefan

0 Kudos