Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

Monday, March 16, 2015

DRF File and PCDOCS Link Handler for eDOCS DM

Couple years ago I created a handler for DRF files, OpenText eDOCS DM document links. The purpose of the tool was to give users the ability to open eDOCS DM documents in read-only mode if they (the users) do not want to install eDOCS DM Extensions.

Today I'm publishing the tool, its full source code, and some basic documentation:
EDocsLinkHandler

The best part of this package is, of course, the full source code (C# / .NET 4 / Visual Studio 2013). It's my implementation of DM WCF API helpers, and it even includes unit tests! :-)

Although the helpers only implement the logon, search, and document download functionality, they may serve as a starting point for anyone developing for DM with WCF API. After two years since the code was written, I still like it, maybe with the exception of the way I implemented the DMSearchResults class... Well, consider it as a free demo. Enjoy!

Wednesday, March 11, 2015

DM WCF AutoLogin Sample

I've put together some files in a folder on my Google Drive that
a) Demonstrate how to use eDOCS DM WCF API.
b) Illustrate the Auto Login vulnerability (security issue DM-32057), if your DM server is not patched.

The Creating Powerful eDOCS DM Client Step-by-step.pdf document describes how to start using DM WCF API in 7 simple steps.

Source.zip contains full source code (C# / .NET 4.5 / Visual Studio 2013) of the demo created with the instructions from the above document.

Demo.zip contains the executable compiled from the source code in Source.zip. You can launch it, if you don't want to recompile. Before launching the exe, you should open ConsoleApplication1.exe.config in Notepad and specify a) the name of your DM server (2 places); b) the user name in your DM library; c) the user's domain name.

Disclaimer: The instructions, source code and the executable are provided "as is", for demo purposes only and without warranty of any kind.

Saturday, December 28, 2013

eDOCS DM Server Log Parser - Part 2: Implementation

This is the second post about parsing Hummingbird DM / OpenText eDOCS DM server logs. Part #1 is here.

In this part I'm going to briefly explain the structure of the log parser just in case anyone may want to recompile, modify or extend it. However, if you simply want to get the DM Log Parser executable and use it, please feel free to jump directly to Part #3 - Usage of this article series.

The EDocsLogParser solution is implemented in C# / Visual Studio 2013 and consists of 3 projects.



EDocsLog is a Class Library and this is the core of the parser. The LogFile class represents a log file as a string array. The LogParser class is responsible for converting the log file into an array of events. It applies a set of predefined rules to the log lines. Rules are based on regular expressions. The rules return a RuleResult object, which tells the parser how to recognize event blocks (chunks) and to convert them into events. The result of the LogParser execution is an array of events. The events are serializable to XML via System.Xml.Serialization.
The parser performs two runs on a DM Server "raw" log file. On the first run, it applies the header and footer rules (see Part 1 for details about event blocks) and forms event stubs or chunks. The second run applies the inner or "body" rules to extract additional data from the recognized event block. The second run only processes the log lines within the previously found chunks. It also benefits from Task Parallel Library (TPL) for faster processing of the array of chunks.



EDocsLogParser is a WPF application. It allows you to pick a directory with DM Server logs and then to convert all of them into XML files. It calls the LogParser.Parse method for every log file and displays the progress.


EDocsLogTests is a set of unit tests for the EDocsLog classes.


Currently, the log parser can extract SQL events from a DM Server log file. It works for any log file, but, apparently, events will be extracted only if the log file was created with Log SQL, Log SQL & Calls, or Log All logging level:


Full source code of EDocsLogParser: https://github.com/dotnetnick/edocs/

Sunday, November 3, 2013

Trustees - How to Get or Set Access Rights to Documents in eDOCS DM

PCDDocObjectClass of DM API has a few methods to work with a document's trustees - the list of users or groups who have access to the document: FetchTrustees, GetTrustees, SetTrustees, UpdateTrustees, etc. eDOCS DM 5.3.1 DM API Reference Guide.pdf includes corresponding code samples.

Saturday, November 2, 2013

Friday, November 1, 2013

How to Programmatically Create Profile in eDOCS DM using .NET

Before you can upload a file into an eDOCS DM library, you need to create a document profile. Profile is metadata of your document. Technically speaking, it's a record in the PROFILE table in the DM database. Of course, we are not going to insert a data record directly into the database. We will be using DM API to let the DOCSFusion application server to execute all necessary business logic (which we do not know much about). However, we are not going to use DM API directly for the reasons explained earlier, but will create a method in our DMApiHelpers library.

Monday, October 28, 2013

Exception-based Error Reporting for DM API Helpers

As mentioned before, DM API calls are old-styled HRESULT functions, which return 0 (S_OK), to indicate the successful execution, or an error code. On the other hand, .NET developers commonly expect handling an exception, if something has gone wrong, not an error code.

Sunday, October 27, 2013

Managed Helper Classes (Library) for eDOCS DM API

OpenText (Hummingbird) eDOCS DM API is ActiveX-based. It looks like it's been written decades ago and it's quite "low-levelish". Error reporting is based on return codes and not on exceptions. And it's syntax is VB6-like that is common for ActiveX components.