Search the FirstSpirit Knowledge Base
Hello,
What is the difference between Relase and Release by server in FS5.1?
Thank you.
Hi Siva, even if provided many information more is needed. E.g. you included a picture of the folder, but relevant is the state of of the picture.
FirstSpirit offers two types of release calls:
(1) provokes the version history comment "Release" whereas (2) creates the comment "Release by server". Interesting is also that when executing a "IDProvider.release" on a media element currently uploaded in a newly created media store folder the following method "mediaElement.isRelease()" does show false where as the "mediaElement.isInReleaseStore()" does show true:
bsh % print(e.isReleased());
false
bsh % print(e.isInReleaseStore());
true
Compared to the same executions done on the newly created media store folder we get the following results.
bsh % print(e.isReleased());
false
bsh % print(e.isInReleaseStore());
false
But the following questions go to e-Spirit:
"isReleased()" -> true if not changed in resepect to the released version, "isInReleaseStore()" -> true if there is a released version of the node (but the current and the released version may differ).
/**
* Returns {@code true} if this element is currently released (not changed).
* Semantically the same as ({@link #getReleaseStatus() getReleaseStatus()} {@code ==} {@link #RELEASED RELEASED})
* but probably faster, at least for {@link Dataset datasets}
*
* @since 5.0.414
*/
boolean isReleased();
/**
* Checks if this store element exists in the release representation of the belonging {@link #getStore() store}. This
* method could only be called for storeelements which {@link #isReleaseSupported() support release} and which are in
* the current representation of the belonging {@link #getStore() store}
*
* @return <code>true</code> if the node exists in the release store, <code>false</code> otherwise
* @see #isReleaseSupported()
* @see #getReleaseStatus()
* @since 4.1.9
*/
public boolean isInReleaseStore();
Don't hesitate to ask if it's still not clear.
Thanx for the hints regarding the JavaDoc for "isReleased()" and "isInReleaseStore()". The more interesting thing would be what the difference between:
is. Here, the JavaDoc was not really helpful. Could you maybe assist?
There are some "AccessUtil.release(..)" methods. All in common is that they delegate the release operation to the server (in contrast to "IDProvider.release(..)"). Depending on the method and provided parameters more elements than the provided will be released.
If you've got a more specific question I'll try to answer it
That means that "IDProvider.release()" does not delegate to the server and in consequence does not guarantee a release for the underlying element?
Is your recommendation to always use "AccessUtil.release(..)" methods instead of "IDProvider.release()"?
That means that "IDProvider.release()" does not delegate to the server and in consequence does not guarantee a release for the underlying element?
No, that's not what I intendet to say. "IDProvider.release()" does release the corresponding element unless an exception is raised.
Which method to use depends on your use case. But I believe there are fewer use cases for "IDProvider.release(..)".
Can you offer concrete use cases where it makes sense to use "IDProvider.release" and when to use "AccessUtil.release()"?
Hello Peter,
Thanks for your Reply.
I have an AutoRelease class which release the media and its dependent folder which is uploaded via ContentCreator....
Below is the code..
1.media.release();
2.AccessUtil.release((IDProvider)media ,false ,true , false ,IDProvider.DependentReleaseType.NO_DEPENDENT_RELEASE);
private void releaseMedia(Media media) {
try {
Logging.logDebug("postProcess for Media executed.", LOGGER);
media.save("Media saved");
//media.release();
//Modified due to ContentCreator Media upload and folder release once(First time) in the store.
AccessUtil.release((IDProvider)media ,false ,true , false ,IDProvider.DependentReleaseType.NO_DEPENDENT_RELEASE);
} catch(Exception e) {
Logging.logError("An unexpected Exception occurred", e, LOGGER);
}
}
As per this above code,
1.Media and the immediate top folder should get released - true - success.
2.Status of the version history comment for the Folder shows "Released" only,Even if i use the below release methods,
1.media.release();
2.AccessUtil.release((IDProvider)media ,false ,true , false ,IDProvider.DependentReleaseType.NO_DEPENDENT_RELEASE);
3.if i do refer the released image in the News creation page and after generating the HTML page it looks like below,
1.Why image is not generated even status is Released.?
2.If Comment is "Release by Server" means image is generated inside the page properly.
3.What is the difference here in Release methods?Is there any problem with Content creator media upload and release?
Thanks,
Siva
Hi Siva, even if provided many information more is needed. E.g. you included a picture of the folder, but relevant is the state of of the picture.