Skip to content

One Click Edit

Using One-Click-Edit (OCE), you can edit a published document that you see on a target system directly from there. imperia observes for the associated workflow and approval mechanisms in the background:

  • imperia recognizes if a user is already logged and, if configured, automatically opens the login screen. The following section describes the configuration of the OCE toolbar.

  • You only need to install a browser extension to use OCE.

  • After OCE is installed, when a user logs in the respective develop system, and every time a page is called, the One-Click-Edit automatically sends the user's permissions, as well as information about the document to the develop system.

  • Users can call or see only the toolbar functions that they have access permissions to.

The NodeID and the system ID are stored encrypted within an imperia document, if the template is appropriately programmed. This is done by either a separate namespace or a meta tag. When using a meta tag, it is possible to also store the path and filename of the page in question. So, for example, copy pages can be removed from a live system independently from the master document or other copies.

Important information about the systemID

Note that when you copy a system, for example, for testing purposes, the SysID is also copied.

This causes problems when users want to unlock or edit a document on the test system using OCE. Since the copied SysID is read, the user cannot work on the test system, but works on the develop system from which the copy was made.

You must create a new copy of the SysID, so that this error does not occur. To do this, follow these steps:

  1. Delete the site/secure/sysid file in your test system.
  2. Then log on to the system. This automatically generates a new SysID.

  3. Reparse the full content of your test system so that the new SysID is included in the documents.

Now you can safely work on the test system.


Installing OCE#

OCE installer

The OCE installer (OneClick.exe) also supports silent installation and uninstallation.

  • To install OCE in silent mode use the following console line:

    `OneClick.exe /S`</br>The installation runs in the background.
    
  • To uninstall the OCE in the background use:

    `uninst.exe /S`
    

Tip

Under Account->Profile you can also download OCE as a bookmarklet which is suitable for Windows Server.


Create new OCE function#

1. Program the Controller

  • In order to create a user-defined OCE function, you have to reference to the controller first.
  • OCE controller are to be found under site/modules/core/Imperia/Controller/Document/Oce.
  • As a basis for your custom controller, copy one of the default ones, e.g. Meta.pm.
    In the context of Meta.pm pay attention to the following:

    • imperia allows you yo make a run-time check that guarantees that the controller is called from the corresponding button. This check is done by the security call

      my $access = $oce_conf->checkAccess($node_id);

      in the go() method body.

    • The tested parameters are defined in:

      $imperia*::Lib::Controller::Document::Oce::ALLOWED->{$imperia->uri(
          '/document/oce/meta'
      )} = {
          params => {
          __imperia_node_id => 1,
          directory         => 1,
          filename          => 1,
          },
          class => __PACKAGE__,
      };
      
      • These parameters correspond to the ones that you provide in the URL field in the One-Click-Edit Configuration dialog.
      • If this check fails, the system throws an “Insufficient privileges” error.

2. Create OCE button

Once you have created your controller, you can create the OCE function that will be displayed as a button in the OCE toolbar. Proceed as follows:

  1. Go to Menu->System->One-Click-Edit. The following page OCE CONFIGURATION opens: OCE configuration dialog
  2. Click on the Create new entry button. The dialog NEW ENTRY opens.
    In the following the options and entry fields are described by the example "Copy" : OCE configuration dialog - exmaple button "Copy"

    • Show in OCE toolbar (check box): With this checkbox the function is (de-)activated globally. By default (ticked check box), a function is always visible.
    • Label: Provide a “Label” for your button. In the OCE toolbar, this will appear next to the button.
    • Icon: Choose an “Icon” for your button.
    • URL: Provide the “URL” and parameters for your controller.
      As value for the URL, set one of the following:

      • An abstract controller path (no leading “/”), plus the desired cgi parameters. imperia assumes that your controller is under site/modules/core/Imperia/Controller/. Example:

        document/oce/my_controller?param=1
        
      • A URL that has a leading “/”. imperia interprets is as a relative to the DOCUMENT-ROOT path:

        /cgi-bin/my_script.pl?param=1
        
      • A fully qualified url:

        http://validator.w3.org/check?uri=<!--LIVE-CC:ABSOLUTE_URI-->
        
    • Condition : If needed, provide a “Condition” for the execution of the controller.
      Define an optional condition that must be met in order for the OCE function to appear in the toolbar. The notation is in the IF statements template syntax, for example: "<--XX-directory-->" NE "/ no\_quick\_edit" (in this example, the OCE doesn't appear in the indicated directory).

    • Tooltip
      Enter text that appears when a user holds the mouse pointer over an icon in the OCE toolbar.

    • Tooltip (without permissions)
      Enter text that appears when a user holds the mouse pointer over an icon in the OCE toolbar, but he or she does not have the necessary permissions.

    • Tooltip (condition mismatch)
      Enter text that appears when a user holds the mouse pointer over an icon in the OCE toolbar, but the set condition is not met.

    • Visible for groups: Define which groups will have access to the controller.

    • Required document permission: Define the required document permissions for the controller. Here, you set the minimum access permissions to documents that a user must have in order to use the function.

    • Allow execution when hidden (check box): Analog to the check box Show in toolbar, this checkbox also turns the function on and off globally, when the button is hidden (for security reasons), but should be still executable by entering its URL (extension).

One-Click-Edit and Copy Pages#

Usually One-Click-Edit works on the basis of documents. In case of “copy pages” documents, that means that if an OCE function is used, that will influence the whole document. For example, if one uses the function Erase, it will delete not only a document from a live system, but also all its existing copies. This behavior can be changed through a document's template or by using a variable in the system configuration.


imperia OCE Scripts#

Note

A parameter in the OCE configuration can hold the value of *. This setting makes the corresponding parameter optional and the system won't check it when verifying the access permission.
Setting a * value to a parameter is not advised for OCE buttons that are visible.

The following OCE features are available:


oce_edit#

Note

Please note, that this script is also connected to the OCE function quick edit!

This script opens a document for editing. If there is no document in the workflow, the last saved version is imported from the Archive.

Prerequired document permission

For this script following document access permission should be set:

  • read
  • write

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.

finished

If this parameter is set to true (or 1), the last finished version and not the last saved version is imported from the Archive.

__imperia_quick_edit

If this parameter is set, all workflow plug-ins that do not support QuickEdit are omitted.


oce_clone#

Note

Please note, that this script is also connected to the OCE function copy!

This script generates an almost identical clone of an imperia document. In the least, the new document is different in the meta variables __imperia_node_id, __imperia_created and __imperia_modified. Also the value of other meta variables can be changed using the appropriate parameters.

Prerequired document permission

For this script following document access permission should be set:

  • read
  • write
  • create

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.

__imperia_created, __imperia_modified

These two variables contain the current time in seconds since the epoch (seconds since 00:00:00, 01.01 1904 GMT for MacOS, and 00:00:00, 01.01.1970 for UNIX® and Windows®).

__imperia_uid

Contains the user ID of the currently logged in user.

__imperia_meta_expand

If there is no meta variable, this parameter is set to 1, regardless of its previous value. This parameter is processed by the MetaEdit plug-in. If it exists and is not 0, <!--XX-METAMODE--> expands to true. The parameter will be deleted after the first processing. Consequently, a new document is created, if the parameter has a value. The MetaEdit plug-in views it as newly created. This is used mainly for <!-- XX-count--> expansion in meta files.

Note

Under normal conditions, the directory meta field is always cleared before a document is cloned, because then it is initialized by the newly assigned category.

__imperia_parent

This parameter contains the NodeID of the parent document.

__imperia_children

The NodeID of the child document is appended to this list in the parent (!) document.


oce_erase#

This script deletes an imperia document from both target and develop systems. Furthermore, all archive information and relevant objects (images, etc.) are deleted.

Prerequired document permission

For this script following document access permission should be set:

  • read
  • write
  • create
  • delete

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.

force

If this parameter is set to true, the deletion is done without a confirmation dialog. Otherwise, a list of all deleted objects is displayed.


oce_delete#

A document can be deleted from all target system, using oce_delete.

Prerequired document permission

For this script following document access permission should be set:

  • read
  • write
  • create
  • delete

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.

directory

This is a directory on a target system.

filename

This is the filename of a document in a directory on a target system

copies

If you set this parameter to true, all copies of a document are removed.

del_develop

If you set this parameter to true, the delete action is also run on the develop system.


oce_history#

This script displays the document history.

Prerequired document permission

For this script following document access permission should be set:

  • read

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.


oce_info#

This script displays information about the corresponding document. Those information refer to the Metainfo and can be edited here, too.

Prerequired document permission

For this script following document access permission should be set:

  • write

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.


oce_meta#

There, the set meta-information can only be displayed not edited.


oce_linkcheck#

This script checks all internal and external links in a document.

Prerequired document permission

For this script following document access permission should be set:

  • read

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.

finished

If this parameter is set to 1 (true), then the last finished version is checked and not the last edited version, which is the default setting.

__imperia_quick_edit

If this parameter is set, all workflow plug-ins that do not support QuickEdit are omitted.


oce_reparse#

Note

Please note, that this script is also connected to the OCE function republish!

This script will reparse a document, so that changes are applied to a template. Optionally, the unlock will be enforced on all target systems.

Prerequired document permission

For this script following document access permission should be set:

  • read
  • write
  • create

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.

finished

If this parameter is set to 1 (true), the last finished version is used as the basis for the reparse and not the last edited one, which is the default setting.

publish

If this parameter is set to true, successfully reparsed documents are automatically published on the target systems. This will only work if a document has been published before the reparse.

publish_all

By setting this parameter, a document including its copy pages will be published with a short URL, e.g. &publish_job=/publish/5302/129353/uri:all.


oce_unpublish#

This script removes the document from all target systems.

Prerequired document permission

For this script following document access permission should be set:

  • read
  • create

The following parameters can be passed to the script:

__imperia_node_id

The NodeID of a document.

directory

This is the directory on a target system.

filename

This is the filename of a document in a directory on a target system.


oce_validate#

This script is used to validate a document for correct HTML at validator.w3.org.

Prerequired document permission

For this script following document access permission should be set:

  • read

The following parameters can be passed to it:

URL

Since the validation uses an external service, the full URI of the document on a live system is needed. To expand it use:

<!--LIVE:ABSOLUTE_URI-->

or

<!--LIVE-CC:ABSOLUTE_URI--> 

The second command escapes the URI.


oce_adoptAllRoles#

This script allows the user to adopt all roles available to him/her. If the function is enabled, the Adopt All Roles button is always visible in the OCE toolbar. However, if the current user has already adopted all available roles, the button is disabled.

When active, it points to /imp/roles/adopt_role/all. The Available Roles dialog opens in a new window (if so configured). Once all roles have been adopted, the user is redirected to the dashboard; the OCE toolbar is refreshed automatically.

In order for the function to work, you need to set a condition. By default, the condition is set to:

NOT <!--HAS_ALL_ROLES-->