As an alternative to the current implementation in WebfolderComponent, it should be possible to configure the manual locking of a document before uploading a new version by automatic locking.
If the application configuration is set to "automatic document lock", the "Lock document" button is omitted and the "Update document..." button is active. When the "Update Document..." button is clicked, the document lock is set, the user selects the new document and clicks "Update". The new version is uploaded and saved and the document lock is released again. The document lock is also released again when the dialog is closed or the user session times out. If the document lock fails because another user is trying to do the same thing, an error message is displayed informing about this fact.
Delimitation
WebFolder errors and questionable behavior were not fixed if it existed before this ticket. The WebFolder was only //enhanced// and not generally //revised//.
Code Migration
Turn feature on and off
- The desired behavior here is the new Top-Logic default. If you don't want it, you can turn on the old behavior, i.e. manual curling, application-wide via configuration:
{{#!xml <?xml version="1.0" encoding="utf-8" ?> <application xmlns:config="http://www.top-logic.com/ns/config/6.0">
<services>
...
<config service-class="com.top_logic.common.webfolder.ui.WebFolderUIFactory">
<instance manual-locking="true" />
</config>
...
</services>
</application> }}
- For TL 6.4:
{{#!xml <?xml version="1.0" encoding="utf-8" ?> <root>
<properties>
...
<section name="WebFolderUIConfig">
<entry name="manual-locking" value="true"/>
</section>
...
</properties>
</root> }}
- The behavior can also be configured per view(WebFolderComponent):
{{#!xml <component class="com.top_logic.common.webfolder.ui.WebFolderComponent"
manual-locking="true" />
</component> }}
Changed APIs
- The following methods got the additional parameter manualLocking : boolean. This comes from the enclosing WebFolderComponent from getManualLocking(). If there is none, the value comes from WebFolderUIFactory.getManualLocking().
- WebFolderColumnDescriptionBuilder.WebFolderColumnDescriptionBuilder(...)
- WebFolderFieldProvider.WebFolderFieldProvider(...)
- UpdateDialog.UpdateDialog(...)
- UpdateExecutable.UpdateExecutable(...)
- Uses of WebFolderColumnDescriptionBuilder.FULL_ACCESS_INSTANCE must use the constructor instead of this constant and pass the correct value for manualLocking. Unless you can't upload files in the WebFolder. (This occurs in two places in the base, which therefore continue to use this constant: Displaying versions of a document, and Displaying similar documents).
Test
TestWebFolderAutomaticLocking.script.xml