Data generation is a useful feature that allows bulk importing of test data documents into CMIS compatible repository. Additionally it can populate metadata of documents with values coming from predefined dictionaries.

Sample script for generating thousands of documents can look like this one below.

Here is a brief description of what the script does:

* it will load three dictionaries from files /tmp/disciplines, /tmp/types, /tmp/subtypes. The dictionaries are simple text files where values are separated by new line characters. From the dictionary values Cartesian product will be calculated so for example, having three dictionaries:

* it will import each file in content-path location (“/media/kbryd/Media/work/sample_data/department”) to a location in repository defined with linking-rule: /Repository/${discipline}/static/${doctype}/sub/${docsubtype} – each ${} variable will be replaced by a value coming from appropriate dictionary.
* naming-rule defines what the object name should be. It can use variables from the dictionaries plus a few additional: ${file_name}, ${file_size}, ${file_path}, ${file_ext}, ${file_mime}
* mapping defines the mapping for populating metadata of each document, e.g. in this case discipline attribute will be populated with value of discipline.

ls: cannot access '/opt/docker/volumes/07a1d0711833af526d08809118ae880fce4d6c537d4246c2fc332fceca0cde9a/_data': No such file or directory
ls: cannot access '/opt/docker/volumes/0d88bab60c8f5023a22f3ff15b35ab585c66b476f2e6615db06f50fefb2bc970/_data': No such file or directory
ls: cannot access '/opt/docker/volumes/0e4e14e289b25a65d0ee597bc7810c6f09961d13a059293a357c425b46534f5a/_data': No such file or directory
ls: cannot access '/opt/docker/volumes/18c2481850150cab1c46b0bdc9178e959c05dd4a205a45510c20467c6b95e473/_data': No such file or directory
ls: cannot access '/opt/docker/volumes/2275d260b670d10d026f1be776a9d32b9a26e23d513cca63add039e9451e3454/_data': No such file or directory
ls: cannot access '/opt/docker/volumes/28252f4885f02615e33d1ed2fdc4b45ebb21d38b933457760090f9f3b68f4e09/_data': No such file or directory

which means that only 20 volumes are actually valid, rest of them point to nonexistent folders on the hard drive.

Composer is good when it works, but when it stops is a real PITA to understand what is going on. Sometimes cleaning a project helps, sometimes, re-importing does the magic, but sometimes nothing works. Almost.

So I had this issue that a perfectly fine Composer project one day simply stopped building. At all. All I was getting was this error message:

I have just released a new repoint release, version 0.2.0. Head to the repoint’s github project to get the executables for Linux and Windows. If you would like package for Mac OS please leave a comment and I will add it as well.

What’s new? Well, in the 0.1.0 version I have added a new dialog that shows ACL in a nice and readable way:The feature is available from the right click menu from the tree and also from the DQL results viewer. In future this feature will also allow editing of ACLs.

In 0.2.0 I have added one more feature that I had on my TODO list since forever

It is now possible to add a docbroker and a docbase from that docbroker without need to edit dfc.properties. You can still use dfc.properties, but if need to quickly connect to a different docbase which is not in your dfc.properties then now it is possible 🙂

If you have ideas, bug reports etc. please use github or comments below to let me know

If you are tired of maintaining manually all those new DFC jars in your Maven repository then I have something for you. A script that will automatically convert list of DFC jars into a ready to use local Maven repository.

I am not going to copy & paste guide how to use it, just please go to my github project:

D2 Lockbox can be a real PITA to install but it surely is even more PITA when it is installed in a VM. Thing is that even if you have a properly installed D2 Lockbox it will stop functioning after each VM reboot.

It took me long hours to notice what is wrong, I was changing the setup, double checking it with the documentation a few times and everything seemed just fine…Funny enough after changing the setup I was doing a reboot – “just in case” 🙂

So, the lesson I have learnt is that VirtualBox VM should not be restarted after Lockbox was configured. It is better to use “VM Pause” otherwise D2.lockbox file will have to be re-generated.

Sometimes it is useful to display some message to the user from the code running on the server side (in D2-Plugin). At the first sight there doesn’t seem to be a way to do this but thanks to Dariusz R. (thanks!) who has decompiled half of D2 code 🙂 we have learned that it is actually possible. And it is also extremely simple:

The trick is to use D2fsExceptionManager.throwD2SilentException(D2fsContext context, String eventName, String messageToPublish) exception with appropriate event name and message, for example:

I have been working on customization of D2 for the last 1.5 years and I think that I am in a good position to share some knowledge I managed to gather. I am going to start a series of blog posts explaining some less obvious tricks that I find useful.

So, lets start with customizing D2 menus…

There are two ways of doing it, one way involves using D2-Config, you can simply click on “Go to…/D2 Menu” and then configure order of menu items, change their conditions etc.
This is fine, but this is not always the best way of doing it. For example, what if you would like to add more advanced conditions which are not available in vanilla D2? Or what if you would like to dynamically create menu items? This simply can’t be done by using just the D2-Config. In more advanced projects it is often better to have the menus customized via XML in a D2 plugin than in D2-Config, this also allows better control of changes (as all files are in VCS some sort).

Okay, enough introduction, lets see some example. Lets assume that we would like to add a static D2 menu that will open some dialog.
In order to achieve this goal it is good to understand how D2 plugins work. At the moment lets only focus on a typical plugin folder structure:

The menu layout XML file is stored in src/main/resources/xml/menu, so lets create a file MenuContextDelta.xml there with following content:

The name of this file is important, it is a ‘delta’ file containing differences that merged with the base MenuContext.xml (that is stored in D2FS4DCTM-WEB-4.5.jar) will produce the final MenuContext.xml.

What the XML code does is pretty simple, we define a new menu item, that will be inserted after menuContextEdit menu item (that is ‘Edit’) in the Context menu (this is implied by name of the MenuContextDelta.xml file). When clicked, the new menu item will show dialog named ‘SampleDialog’.

Now, what if we would like to have a dynamic menu item? Lets say the requirement is to list available custom actions e.g “Publish to system A”, “Publish to system B” etc. when the menu is selected.

In order to implement it we need two files: first one adds the main menu item that contains reference to the second file (please note src=”PublishSubmenu”), second one points to the Java class that will generate available submenu options based on the current document selection (as available publishing systems depend on the selected document):

Merely adding the value to the attributes Map is not enough to pass the value to the dialog. It is also important to add that attribute name to the DIALOG_LIST_PARAM value. Then in the dialog buildDialog method you can access the parameter value like this:

It is hard to believe that there was no basic (well, even extremely basic) tool that would allow exporting some folders and documents from a CMIS repository (Alfresco in my case) to a file-system in a hassle free way. Thanks to the OpenCMIS library writing such tool took around one hour and here is the result:

This tool can be very useful when used together with cmis-upload-maven-plugin (https://github.com/karolbe/cmis-upload-maven-plugin) for writing Unit tests. For example, you can export some files (e.g. configuration) from a repository that are required by your unit test, then you put them in your AMP project and, finally, using cmis-upload-maven-plugin you can automatically upload those files to your test repository that it started during execution of your unit tests (mvn test).

So here is an example. Let’s assume that you have a project that needs some configuration in the repository, let’s name it ‘stamper’. In order to make the bootstrap process more convenient you need to add following section to your pom.xml file:

I guess everyone using Documentum on a daily basis knows what dqMan and repoint applications are. Life of a Documentum developer would be very difficult if those tools were not available. I tried so many times to get used to dqMan but I simply couldn’t, there is just something wrong with the User Interface…So even though repoint application felt like ‘beta’ version I was still preferring using repoint to dqMan.

I’ve had this plan since long time ago to restart development of repoint as it seems like the original author abandoned the project. And it finally happened. I have just committed a Maven friendly repoint project to github:

https://github.com/karolbe/repoint-r

If you would like to play with it you can grab the sources and use Maven to build it, just run:

mvn clean install

and after some time you will find repoint application for your architecture (linux, windows, macos) in following folder: repoint-eclipse-repository/target/products/Repoint

So far I have only removed some deprecated RCP code but I have some bigger plans for that application. Depending on my spare time I am going to work on: