Last week, we discussed a possible implementation of the direct access to renditions. This icon is drawn an a document, which das renditions at the newest version. Clicking on that icon opens a panel which lets the user select one of the renditions to download or delete.
Selecting one of the renditions will download this rendition or (if permissions allow it)( delete the rendition.
The whole thing is based on a cell renderer. This relies on the extension point node.state.icons which is (as always) declared in the extensions.json file:
This basically declares the required view named “rendition.view.js” as responsible to draw the icon at sequence position 60.
This is the template used for the view.
The image is drawn cia the css seen above.
Encapsulating this inside a link allows to make the svg clickable.
Enable the direct access
The first point is the decision, if the cell renderer is to be drawn or not. This is a static method at the view, returning true or false. We dont have ony clue if the nodeid does have a rendition at the newest version, so we have to implement a new REST command at the server to get the information. The REST must be called synchronously.
This is done via a simple XMLHTTPRequest. If the result is true, we return true and store the number of each rendition types at the node in the prototype for further processing.
Then lets take a look on the events:
This means, a click on the class of our link in the template will call onOpenView. Before we look at that, look at this in the templateHelpers:
Open the Panel after the click
Remember, we got the number of each rendition types from the server? We want tzo display these numbers as a tooltip over the icon, so this is the way to formet the output string. A note to the knights of the holy JS-grail: Referencing this.__proto__ instead of finding the prototype via object maybe depreciated, but at least its also in ECMA 6! So nowadays its a valid method.
When we click on the icon, we want to open a DialogView from the sdk toolkit with an embedded view (SelectView) in the method onOpenView:
Before we open this view, we call the server to get the renditionlist of this node via XMLHTTPRequest. If we get the list (status=200) we intiantiate the view (selview1) and display the DialogView containing the instantiated view at the bin_modal default EL anchor.
Then lets show this region and store a event handler (string “submit”), which is listening on the view selview1 for that string. If it receives that string, the DialogView is closed.
Next week, we’ll examine the SelectView.
Missed something in the Posts? Here are the parts already posted:
Using OpenText Content Server as as developer, you have to face it sooner or later: Write an application in smartUI. This will give you a lot of experience for smartUI projects, especially on the Cost/Times/Materials base.
I did chose to build a product called SMART TOOLS with Renditions and Multilingual Metadata Support. Product means, it can be sold by other OT partners as well.
This is a multipart post. Today we talk about the basics of the application running in Content Server 20.2. Additional posts will explain the usage and some technical aspects
SMART TOOLS includes these features:
Adds support for Multilingual Metadata to smartUI
Automatic Translations for the multilingual data using Microsoft Azure REST service (as nobody speaks all languages on this planet)
Add print lists (to get a list of the data entered for editing)
Add/edit mlm data directly
Integrated in the standard nodelist widget using the property manager
Adds support for Renditions
List all Versions and Renditions
Use “view as webpage” as a base viewer
Add Renditon as command
A cell icon marks all documents in the document list having renditions at the newest version. Clicking on the icon will open a window to show all renditions. Download or delete a rendition.
The SMART Tools are build for Content Server 20.2. A a considerable amount of new REST services also to be implemented in the Content Server.
Integration is simply direct in the nodelist widget using the property manager.
By clicking in the first icon in the list, the property manager opens.
The panels adressed by this menu are the multilingual metadata panel (with the two fields Name and Description) and the rendition panel. Here you see the mlm panel with the autotranslate Icon (the globe at the right).
This is the rendition panel which shows all renditions attached to all versions.
The SMART TOOLS support a couple of UI languages like
This is one example on the multilingual metadata dialog using German, French and English.
The nls feature of smartUI is nice, isn’t it? I even tried it (experimental) for Arabic, and it worked!
Lets go more in detail in the next posts, as this here is intended to be a simple overview.
Next week I will describe the multilingual metadata support of smartUI
depending on the skills of the attendees.
Here, an EVENT Management system in the Content Server is built from the scratch. Events can be anything, from a Music Concert to Keysessions or anything else. To manage Events, all necessary Notes, Documents, Feedbacks can be stored in the Content Server.
Each event is mapped to a Business Workspace and has several folders to hold all documentation and feedback. Events can be related to other events. Each Event is containing Documents according to the template and has a Team of Coworkers. We also implement a Dashboard to see all Events in smartUI. If an Event is clicked in the Dashboard then the corresponding Connected WorkSpace Business Object is opened. Both parts, the Dashboard and the Business Workspace correspond via REST Service, which is also to be implemented during this workshop.
Uses the Content Server 16.2.10, the smartUI SDK and the D3 library, which is part of the smartUi SDK.
New: We are offering custom widget development. Interested? Send an e-mail to merz at ebit-company.de stating the purpose of the widget and requesting aqoute
Beeing Content Server Trainer, I was asked to provide a training “How to program a Widget for the new Content Server GUI” to several customers. This is about the content of such a training and the reason why such a training is technically really advanced.
Basic Training (newest version 1.005 from Feb/2018)
The basic training is very compact and lasts 5 days.
First, lets take a look on the components:
As a prerequisite, a firm knowledge of CSIDE, How to build a module, the Node Structure and whats to do with Content server Nodes is necessary.
At the end of the training, you’ll have a working knowledge of:
Content Server Perspectives. What are they and how you can use them to provide a user specific interface.
Content Server REST. This is the only possibility for the client to communicate with the server, so its mandantory to know the REST interface from the application point of vue. And, as REST can be very slow due to unneccesary data, its also mandantory to know, how to add REST services to the Content Server to get the data you want in the fastest way.
Next is the infrastructural world of the sdk.
There are several components, which must be understood prior to build a Widget.
yeoman is a scaffolding system, which will be used by a Opentext extension to initialize the development folder. It also creates the skeleton of a Content Server module, which is used as a “Carrier” for our Widget(s)
backbone.js is the base framework to be used
marionette.js is an extension to backbone.js, making Views easier.
handlebars.js is the html templating framework used in the sdk
bootstrap.js/binf.js is originally the public domain CSS/JS framework from Twitter for the appearance of the Widget. Binf is the Opentext variant, allowing to override CSS without negative effects
Next is the SDK itself. Due to time restrictions, in the base training are only the base functions, the advanced training covers the other aspects. It contains
Installing the SDK
Building the Demo Widget
CSS Style Overrides binf
General Overview of the SDK
Content of the SDK
Routing (Preview of the Advanced Training)
Define a new NodeType
Create a Widget
Mockup and Test Data. How to setup mockup REST data. How to build test facilities in the SDK
Anatomy of the Hello Widget. A walktrough through this widget
Anatomy of the MyAssignment Widget
Add another Widget to the Content Server. Change the Hello Widget and add additional fields
Build a Custom Widget to be used as Client with a custom REST service. Here, a custom widget is build, which uses an extended version of the custom REST service from Part 2.
If time allows: Some Tips and Tricks from a “Work-in-Progress” Widget
Advanced Training (Version 1.005 Feb/2018)
OK, thats the basic training. There are a lot of additional things inside the SDK, but to understand these, there must be a couple of weeks with practical experience in between. The advanced part has beed remodelled to include a couple of interesting things. The advanced part contains:
Chapter 1 Extended SDK Parts
Carousel Widget View
Workflow (new in Content Server 16.2)
Workflow in smartUI
Writing Workflow Extensions
New REST API Support (16.2) for Workflows
Widgets not part of the SDK
xECM: Header Widget with Business Object Infos
xECM: Snapshot of current document Attachments
xECM: Dossier View Widget
Engineering Doc Management: Search
xECM: Office365 Groups
Chapter 2 Extended SDK Features
Build Language Packs for Internationalization
Implementation and Inheritance from “CommandModel”
Custom URL Router. Routing, adding custom Routers. Using Routers as Navigation.
Behaviours. What are Behaviours?
Mixins. What are Mixins? All available Mixins.
Browsable Support for Collections. Using the “Browsable” support for Model-Collections.
Chapter 3 Additional Things to consider
Tips and Tricks (Work in Progress- List can change)
Add a OTDS Ticket already in the browser to the connection object
Re-using a OTDS Ticket as LLCookie
Checking the paths in the test/index.html
Using Helpers for supporting a select box with Handlebars
Adding non CSUI supported JQuery functions in a view
Handlebars advanced. A deeper look into Handlebars
LESS advanced. A deepter look into LESS, the CSS language used in Bootstrap
Accessibility in Bootstrap. What can be done to add support for screenreades etc to Bootstrap/Binf? Whats to avoid? Which tools are available
Best Practices in Development
As you can see, there is a lot of stuff. The basic training last 5 days, the advanced training 2. But on the other side, you’ll get happy users with your new Widgets.
And that’s all what counts.
One of the nicest things in the content server area is, you can set Access Control Lists not only for the owner or the default group of a node, and you can add or revoke rights to the node for virtually all users and groups defined in the content server.
Here, we want do discuss how to do this using Content Server Web services. First, let’s see how ACLs are organized. A simple object would display something like this:
On the left hand side, you see the default access, there is always one Owner, one default group and a public group.
If you want to assign further access, you can select a user or a group by clicking on the bottom at the lower left hand side. This will select a user or a group. (Btw: It’s recommended to use groups instead of users)
On the right hand side, there are the ACLs for the selected user/group on the object. Here, we used the Administrator, therefore all rights are switched on.
Ok, how to use this on a c# client?
First, the ACLs for a given user are called NodePermissions. Use them like this. Let’s say, this is utils.setNodeRights(….)
/// Creates a Noderight Structure and returns it
/// <param name="rights">"all" or see (see,seecontents)</param>
/// <param name="id">the member ID for this node rights</param>
/// <param name="type">Owner, Ownergroup, Public or ACL </param>
public DocumentManagement.NodeRight setNodeRights(string rights, long id, string type )
DocumentManagement.NodePermissions newPerm = new DocumentManagement.NodePermissions();
newPerm.SeeContentsPermission = true;
newPerm.SeePermission = true;
newPerm.AddItemsPermission = true;
newPerm.DeletePermission = true;
newPerm.DeleteVersionsPermission = true;
newPerm.EditAttributesPermission = true;
newPerm.EditPermissionsPermission = true;
newPerm.ModifyPermission = true;
newPerm.ReservePermission = true;
DocumentManagement.NodeRight newRight = new DocumentManagement.NodeRight();
newRight.Permissions = newPerm;
newRight.RightID = id;
The Nodepermissions is simply a container with the single access rights set to true or false.
When the definition is finished, the NodePermissions must be encapsulated in a structure called NodeRight. This contains the ACLs defined and the user/group for the ACL. Use the id as long integer, this is the unique identifier of a user/group in the content server. You can use MemberServices to get this number, if you know the login-name.
Then, the system wants to know, which kind this user/group is. Use ACL, if these are additional users/groups, or use something like Owner, Ownergroup or Public, if the ACLs should belong to the predefined entities.
How to use this?
First, login to the Webservices.
Second. Get the node, onto which you want to set ACLs.
Forth. Set the ACLs for the standard entities (if needed). Define a NodeRight for every entity (user/group) you want to set. Define these 2 right groups.
// setup standard permissions for base ACL group
DocumentManagement.NodeRight newRightstandardGroup = utils.setNodeRights("see", standardGoupID, "ACL");
DocumentManagement.NodeRight newRightsmanagerGroup = utils.setNodeRights("all", managergroupID, "ACL");
The nodesrights on a node can contain something or be null. First, lets check, if the thing is null.
if (nodesrights == null)
Console.WriteLine("Nodesrights not found- no external Users/groups assigned");
Console.WriteLine("Setting a group with rights see/seecontent");
DocumentManagement.NodeRight allrights = new DocumentManagement.NodeRight;
allrights = newRightstandardGroup;
allrights = newRightsmanagerGroup;
nodeRights.ACLRights = allrights;
docclient.SetNodeRights(ref otauth, pargs.nodenumber, nodeRights);
Console.WriteLine("All Rights and Groups set --- Finish");
In this case we simply define a NodeRight array with two entries containing our new RightstandardGroup and our newRightmanagerGroup.
Let’s store them into our newly created array.
Let’s store this array in our nodeRights under ACLRights. This will change our copy of our structure which we downloaded before.
Next is simply a SetNodeRights with the nodenumber and the updated nodeRights array to write our changes back to the server.
If there are already entries, you should set them like this:
// Just display the first Entry of the first assigned Users/groups
DocumentManagement.NodeRight right = nodesrights;
DocumentManagement.NodePermissions nperms = right.Permissions;
// check, if we do habe the groups already set
int newLen = nodesrights.Length;
// copy rights into new longer Array
DocumentManagement.NodeRight allrights = new DocumentManagement.NodeRight[newLen+2];
for ( int i = 0; i < newLen;i++ )
allrights[i] = nodesrights[i];
allrights[newLen] = newRightsmanagerGroup;
allrights[newLen + 1] = newRightstandardGroup;
nodeRights.ACLRights = null;
nodeRights.ACLRights = allrights;
docclient.SetNodeRights(ref otauth, pargs.nodenumber, nodeRights);
Console.WriteLine("All Rights and Groups set --- Finish");
In this case, our nodesrights come from the nodeRights.ACLRights, because there are alredy entries.
Now, let’s do the same thing like we did on a new structure. But, we don’t want to delete existing entries, lets simply add our new RightstandardGroup and our newRightmanagerGroup to the ACLRights array.
One thing, if finished, first set the nodesRights.ACLRight to null and then fill it with the new extended ACL array.
Then do a SetNodeRights with the nodenumber and the updated nodeRights array to write our changes back to the server.
Finished. Quite easy, isn’t it?
BTW: There is no equivalent to do this on the REST api at the time of this post.
If you are thinking on using Content Server Webservices (CWS´) you may wonder how to activate this on a standard Content Server Installation. Normally, right out of the box, CWS is not active or installed, although you got the license to use it in your basic license.
As Administrator, you have to do a couple of things to activate CWS.
Decide which architecture you will use.
CWS can be used inside of the Microsoft Internet Information Server or inside a Java Application Server like Tomcat. Both ways to activate will be described here.
Locate the CWS Software
Look in your install directory of the content server. There, you will find a directory named “webservices”.
Here, there are three entries:
dotnet contains all CWS service definitions for use inside the Microsoft IIS
java contains all webapps for use inside the Tomcat application server
java6 contains the same thing as in 2. but for use with java 6.
Installing CWS inside the Microsoft Internet Information Server IIS
First, let’s examine how to install CWS inside IIS. Switch to the dotnet subdirectory, then to cws (do not use les-services, this is an old version supporting legacy clients)
Locate the .svc files you wish to install and use in CWS.
Open the IIS Manager. Create a new Application at the default web site
Enter the path to the dotnet\cws directory , enter for example CWS as alias.
Remark: IIS must be configured to
execute .NET 2.0 apps
allow “Read” and “Script” rights to the new app
execute WCF (can be ensured for example by “%SystemRoot%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -i” (check, if something changed, if you are using newer versions)
allow “Read” and “Execute” rights for the ID of the Application pool on $OTHOME/webservices/dotnet
And (don’t forget), ensure that your webservides will use the same port as your content server uses. If you use a nonstandard port (not 2099) you need to change the port in the file $OTHOME\webservices\dotnet\cws\web.conf
If you use the standard port, there is nothing for you to do.
Installing CWS in Tomcat
Alternatively, you can use Tomcat as a base for CWS.
In this case, go to the java6 base directory in the webservices dir.
In this dir, you’ll find the war (web application archive) files, which you need to deploy.
Deploy the cws.war file either to the TOMCAT\webapps directory or use the Tomcat service manager to deploy this file.
Don’t forget, if you changed your port number of your content server from 2099 to something else, change also the value in the web.xml of the unpacked cws web app.
If you don’t use the same port numbers, the whole system will listen to different ports and will do nothing.
Test your installation
Your installation is correct, if a browser, pointing to
http://127.0.0.1:8080/cws/services/DocumentManagement (Tomcat) or
This example uploads the file c:\test.txt with the name of “MyFile123” under the folder with the node id 485336. This snipped relies on a previous login. The subtype of the file to be uploaded is “document” (144). The authorization token is saved under the variable name of “otcsticket”.
This example does not consider any categories (mantadory or not). We’ll discuss this in a later post.
Declare all variables needed. This is done by defining the array bodyData. At least there must be the subtpe, the parent_id, the name and the local file name.
Fire an AJAX request to the URL, where your content server is, Use “api/v1/nodes” as REST command.
Put the authorization ticket in the header field
Put the bodyData in the data field
Set the Mime Type to “application/x-www-form-urlencoded”
If the request is done, process the “success” or the “failure” clauses
Put some nice HTML around it, add the authorization code and then you are done.
(At least for this example. Normally, you should provide some name check for the node name)
To authenticate with a JAVA client against a Content Server, you should first create all client proxys. This example can be used against a Servlet Container, like Tomcat. Here, it is assumed, that it runs on port 8080.
The creation of the proxys must be done manually by typing
wsimport -keep http://yourserver:8080/cws/services/Authentication?wsdl[add all services you want to use]jar cvfM webservices.jar com/opentext/*
Add the webservices.jar file in the build path of your Java application.