As an alternative to the current implementation in WebfolderComponent, it should be possible to configure automatic locking to replace the need to manually lock a document before uploading a new version.
If the application configuration is set to "automatic document lock," the "Lock Document" button is removed and the "Update Document..." button becomes 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. The document lock is also released when the dialog is closed or the user session times out. If the document lock fails because another user is currently attempting the same action, an error message is displayed explaining the situation.
Scope
Bugs and questionable behavior in WebFolder that existed prior to this ticket have not been fixed. WebFolder has only been //extended// and not generally //revised//.
Code Migration
Enabling and Disabling the Feature
- The behavior described here is the new Top-Logic standard. If you do not want this behavior, you can enable the old behavior—that is, manual locking—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 have been given the additional parameter ` manualLocking: boolean `. This value is obtained from the enclosing ` WebFolderComponent ` via `getManualLocking()`. If none exists, the value is obtained 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 `. Otherwise, you cannot upload files to the WebFolder. (This occurs in two places in the base code, which therefore continue to use this constant: displaying a document’s versions and displaying similar documents.)
Test
TestWebFolderAutomaticLocking.script.xml