-
RE: .NET API > Automatic merging of layers
awesome, thanks! -
.NET API > Automatic merging of layers
I'm writing a web service that I'm hoping to use in conjunction with Workflow Designer.
The desired outcome is to input a doc id in the workflow, along with other necessary parameters, and have the document automatically merge the layers.
However, I can't figure out how to actually get the merge to happen. I believe that I need section numbers for the document, but I'm not sure where to go from here. Here's my code so far:- public string mergeLayers(string uri, string userName, string passWord, string DWDocID, string fileCabinetName)
- {
- var message = "";
- try
- {
- ServiceConnection sc = ConnectToDocuWare(uri, userName, passWord);
- message = "Connected";
- var org = sc.Organizations[0];
- var fileCabinets = org.GetFileCabinetsFromFilecabinetsRelation().FileCabinet;
- var fileCabinet = fileCabinets.Where(f => f.Name == fileCabinetName).FirstOrDefault();
- var dialogInfoItems = fileCabinet.GetDialogInfosFromSearchesRelation();
- var dialog = dialogInfoItems.Dialog[0].GetDialogFromSelfRelation();
- var result = RunQuery(dialog, DWDocID);
- var doc = getDoc(result, dialog, DWDocID);
- var sections = doc.Sections;
- try
- {
- message = "trying merge";
- foreach (var s in sections)
- {
- new MergeAnnotationsParameters()
- {
- SectionNumber = int.Parse(s.Id)
- };
- message = "success";
- }
- }
- catch (Exception ex)
- {
- message = ex.ToString();
- }
- }
- catch (Exception ex)
- {
- message = ex.ToString();
- }
- return message;
- }
-
DocuWare SDK > Unable to modify dialog properties and field properties
Im trying to build an application that will make updates to dialog fields and properties but I'm having some issues getting the properties to update in my code.
for instance, if I have a list of fields in my application, I'm able to select each of them and look at certain field properties, such as whether the field is ReadOnly or Visible in the dialog.
However, it doesnt seem to work when I try to set the values of those fields by doing something like this
selectedField.Visible = true;
selectedField.ReadOnly = true;
Is this something that is possible with the SDK? -
OK, I just added another
OK, I just added another foreach loop to iterate through the list and retreive the values. Seems like way too much work to get this data though. Next I'll work on storing key, value pairs in a dictionary.
public static void getKeywords(DocumentsQueryResult DocResults)
{
foreach (Document doc in DocResults.Items)
{
Document document = doc.GetDocumentFromSelfRelation();
foreach (DocumentIndexField field in document.Fields)
{
if(field.ItemElementName.ToString() == "Keywords" )
{
DocumentIndexFieldKeywords keywords = (DocumentIndexFieldKeywords)field.Item;
foreach (var str in keywords.Keyword)
{
Console.WriteLine(str);
}
}
}
}}
Thanks for the help, I was spinning my wheels over this one.
-
link to documentation
Also, here's a link to more info from the documentation about the Keywords class: http://help.docuware.com/sdk/platform/html/P_DocuWare_Platform_ServerCli...
-
Additional info
So I've made some progress with this, though i don't know for sure if I'm on the right track. I figured out that after I use a DocumentQueryResult to get the results of a dialog expression, You can iterate through the documents in the results and call the .GetDocumentFromSelfRelation() method on each. This returns the keyword fields as well as the others, however the DocumentIndexFieldKeywords class does not have a GetEnumerator() method, so I haven't been able to actually retrieve the values stored inside the keyword fields, thogh I can get the fieldLabel and fieldName properties.
Here's what I've been working on, you just need to pass a DocumentQueryResult to the method and you should be able to see the actual keyword fieldNames listed. Any ideas how to get the values after this? I don't have a return type on the method yet because I'm still trying to figure out how to store and access the data, so I'm just printing out the info to the Console (.NET)
public static void getKeywords(DocumentsQueryResult DocResults)
{
foreach (Document doc in DocResults.Items)
{
Document document = doc.GetDocumentFromSelfRelation();
foreach (DocumentIndexField field in document.Fields)
{
if(field.ItemElementName.ToString() == "Keywords" )
{
Console.WriteLine(field.FieldName);
}
}
}}
-
DocuWare API - retrieve keyword fields
Using the DocuWare Platform Service APIs, I've been able to retrieve documents' field values, however I am not able to retreive keyword field/values using this method. The documentation doesn't show a good example of what needs to be done in order to achieve this.
I'm using the DocumentQueryResult method to return results.
Are there additional steps that need to be done in order to retreive keyword fields?