enterprise-content-management / documentum-rest-client-dotnet Goto Github PK
View Code? Open in Web Editor NEWReference implementation of Documentum REST .NET (C#) client
License: Apache License 2.0
Reference implementation of Documentum REST .NET (C#) client
License: Apache License 2.0
Hello,
Any help/direction with this is greatly appreciated. I'll get a couple items out of the way here:
I'm running into issues with the RestClient in the RepositoryExec.cs file any time ExecuteDQL<t>
is used. See code lines below for the exact issue:
string dqlUri = LinkRelations.FindLinkAsString(this.Links, LinkRelations.DQL.Rel);
string dqlUriWithoutTemplateParams = dqlUri.Substring(0, dqlUri.IndexOf("{"));
The problem is that LinkRelations.FindLinkAsString
returns a repository URI that is derived from the hreftemplate
link relation and is stripped of the template params and stores it in dqlUri
. Then the same operation is tried again outside of the Linkrelations.FindLinkAsString
function which causes a Sytem.ArgumentOutOfRangeException. Length cannot be less than zero.
exception. I get this any time the Feed<T> ExecuteDQL<T>(string dql, FeedOptions options)
function is called.
It should also be noted that the MonoReST solution has the same issue when trying to use the REST API in the AspNetWebFormsRestConsumer project. That project determines compatibility with the REST API by calling the D2Repository.isD2Rest()
function. If the isD2Rest()
function returns false
, then the site sets labels to red and says the target repository is not a D2 repository.
I'm pretty new to Documentum so some of this is foreign to me but I assume the RestClient project can be used with my version of Documentum since the overview says the 7.2 and 7.3 REST APIs are supported. I've also been using the RestDotNetFramework.docx documentation and have been able to use the RestClient project to connect and get references to my Repository, a targeted Cabinet.
What I've been able to do with the RestClient project:
I can provide code if that will help but I am currently at a standstill with this API and cannot move forward unless this is fixed or my mistake is pointed out so I can work around it. Any help is greatly appreciated.
Humbly,
Christopher
Hello,
I was using the Repository.GetFolderByQualification(string dql, FeedGetOptions)
function and getting null reference exceptions instead of what I expected to be a null Folder object. After digging through the code some more I found that the function I am using on Line 292 of RepositoryExec.cs
calls the generic GetObjectByQualification<T>(string dql, SingleGetOptions options)
function. This function prepends select r_object_id from
to the passed in dql statement which, in my case, resulted in dql like the following: select r_object_id from select r_object_id, r_folder_path from
.
Is this the expected behavior or should the line on 352 be removed?
Here's the code from RepositoryExec.cs
with a comment on the line in the code that is causing a problem:
/// <summary>
/// Get object by dql qualification
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="dql"></param>
/// <param name="options"></param>
/// <returns></returns>
public T GetObjectByQualification<T>(string dql, SingleGetOptions options)
{
dql = "select r_object_id from " + dql; //THIS LINE IS CAUSING THE PROBLEM
Feed<PersistentObject> feed = ExecuteDQL<PersistentObject>(dql, new FeedGetOptions { Inline = false });
if (feed.Entries == null || feed.Entries.Count == 0)
{
return default(T);
}
if (feed.Entries.Count > 1)
{
throw new Exception("The qualification '" + dql + "' has more than one object in repository.");
}
return Client.GetSingleton<T>(feed.Entries[0].Links, LinkRelations.EDIT.Rel, options);
}
How to get Virtual document and its child using rest api
First of all I want to say a big thank you for sharing your code.
I added the RestClient to my vs project (with content server and Rest version 7.1), the GetDocumentByQualification or GetObjectByQualification do not work. After adding some debug lines, i found out that the "links" in "feed" is empty, would appreciate if this can be fixed or provide the right way to use it.
I defined the option as the following:
FeedGetOptions DEFAULT_OPTIONS { get { return new FeedGetOptions { Inline = true, Links = true }; } }
And called the GetDocumentByQulification as the following:
RestRepository.GetDocumentByQualification("custom_document where i_latest_flag=1 and i_chronicle_id='" + ChronicleId + "'", DEFAULT_OPTIONS);
In the RepositoryExec.GetObjectByQualification function:
Feed feed = ExecuteDQL(dql, new FeedGetOptions { Inline = true });
The "entries[0]" in the "feed" does not contain any links:
2018-09-12 17:28:51,853 [1] DEBUG Emc.Documentum.Rest.DataModel.Repository -
{
"id": "https://xxx:8899/rest/repositories/myrep",
"title": "DQL query results",
"updated": "2018-09-12T17:28:51.811-04:00",
"total": 0,
"items-per-page": 0,
"page": 0,
"author": [
{
"name": "EMC Documentum"
}
],
"entries": [
{
"id": "https://xxx:8899/rest/repositories/myrep?inline=True&links=True&page=1&include-total=False&dql=select%20r_object_id%20from%20custom_document%20where%20i_latest_flag=1%20and%20i_chronicle_id='09031d4580be05cc'&index=0",
"title": "09031d4580be05cc",
"updated": "2018-09-12T17:28:51.811-04:00",
"author": [],
"content": {
"name": "query-result",
"properties": {
"r_object_id": "09031d4580be05cc"
}
},
"score": 0.0
}
],
"links": [
{
"rel": "self",
"href": "https://xxx:8899/rest/repositories/myrep?inline=True&links=True&page=1&include-total=False&dql=select%20r_object_id%20from%20custom_document%20where%20i_latest_flag=1%20and%20i_chronicle_id='09031d4580be05cc'"
}
]
}
Is there a plan to release this dot net REST client library as a NuGet package?
Hey, Im trying to consume a rest client but how to perform a search query on emc rest api, can you give any sample of it
Are you currently taking public contributions? I'm going through some of the code to get a handle on using the RestClient and have noticed some things that are either confusing or could be implemented in a slightly different way.
Hi Team,
I am trying to upate the properties of existing documentum using r_object_id. Could you please help me to update which method will help to do this.
For Ex: I have a document custom metadata column like record date and want to update this column using r_object_id.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.