Folder Widget override document open

Options

Hi

We're using Folder Widget in our external app. Something like this

//csui/integration/folderbrowser2/folderbrowser2.widget
var browser = new FolderBrowserWidget(
      {
        connection: serverConnection,
        start: {id: FolderDataID }
      });
    browser.show({placeholder: '#content'});

In Content Server the default click on the documents is configured to open Overview page.

This way it also works in the widget. Is it possible to override that? Instead it would Download the document or open (viewer)

By using .extend or similar method? Within the widget code

csui/utils/commands/open

Thanks

Comments

  • This is configurable on the Admin pages, have you checked what setting you have and what impact it has on the Smart UI ?

  • Thanks, but in admin pages it is for general smart view users ( for all) . There we have Overview as needed for business
    But for widget that is embeded in App Y we need different behaviour
  • does it change in SmartUI if you change it in the Admin pages ? If it does and you have OScript experience you can probably patch the code to return the appropriate value for the activity you require without needing to touch the SmartUI code.

  • the change in admin pages affects both - generic smart view UI (the main interface for users) and also in the widget that is embedded in other apps.
    At the moment the default link is Overview page for documents.
    This is how it should stay there.
    But we need different behaviour in the widget in the external app. We want to have it Edit / Download there
  • @Uldis then the idea is to look where in OScript that setting is loaded, and then add an if statement around it so in most cases it returns the value from the Admin pages, in your specific cases it returns the other value you want and then Classic UI and Smart UI all work as normal with no additional code changes.

  • Thanks, but we will not consider Oscript since we only need the override in the widget (outside Content Server). More reasonable would be to extend/override the widget

  • Uldis- in the Smart View SDK documentation (at least 22.3 has it), might be worth looking at the docs and /doc/csui/utils/commands/open.document/csui.open.document.delegates.html

    The following boolean flags can be passed to this module inside the config object with require.config to set global command preferences:

    • allowPerspective: Enforce navigation to the document perspective instead of opening the document content. The default is false.
    • allowViewContent: View the document content using the best-fitting content plugin. The default is true. This can be used to forbid viewing the document content globally and enforce only its download.

    Example

    Prefer navigating to the document perspective. (Opening the content will never take place, because the document perspective is always available.)

    require.config({
      config: {
        'csui/utils/commands/open.document/csui.open.document.delegates': {
          allowPerspective: true
        }
      }
    });
    

    Haven't tried it, but wonder if you set allowViewContent to false where you set up your embedded widget whether this would at least force download of the content rather than whatever the default action is per admin page config.

    Also - /doc/csui/integration/folderbrowser2/folderbrowser2.widget.html#executingdefaultaction might be worth a look

  • Uldis
    edited March 8, 2023 #9
    Options
    Thanks
  • Where exactly is it possible to edit this code? How do i push those changes to the Content Server?

  • Code changes that @David Henshaw is saying gets done in a SmartUI extension project.The SmartView code is all Jave Script but for CS to get it one uses a CS Module(oscript).This is explained in the "getting Started" of the SmartUI SDK.