sivaprasad9394
Occasional Collector

What is the difference between release and release By Server?

Jump to solution

Hello,

What is the difference between Relase and Release by server in FS5.1?

Thank you.

ReleaseDifference.jpg

0 Kudos
1 Solution

Accepted Solutions

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.

Peter

View solution in original post

0 Kudos
11 Replies
king
I'm new here

FirstSpirit offers two types of release calls:

  1. IDProvider.release()
  2. AccessUtil.release()

(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:

  • what is the difference between these two release methods? According to the documentation AccessUtil's release methods do a release on server side
  • we observed that "IDProvider.release()" does offer some comfort functionality as the direct parent that might have never been released before will be released as well. Are we right?
  • when to use which type of release method?
0 Kudos

"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.

Peter
0 Kudos

Thanx for the hints regarding the JavaDoc for "isReleased()" and "isInReleaseStore()". The more interesting thing would be what the difference between:

  1. IDProvider.release()
  2. AccessUtil.release()

is. Here, the JavaDoc was not really helpful. Could you maybe assist?

0 Kudos

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 Smiley Wink

Peter
0 Kudos

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()"?

0 Kudos

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(..)".

Peter
0 Kudos

Can you offer concrete use cases where it makes sense to use "IDProvider.release" and when to use "AccessUtil.release()"?

0 Kudos

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.

ImageProblem_MediaSa.png

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);

ReleaseProblemSA.png

3.if i do refer the released image in the News creation page and after generating the HTML page it looks like below,

ImageFailNew.png

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

0 Kudos

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.

Peter
0 Kudos