Posted Thu, 07 Nov 2019 20:54:14 GMT by Raymond Papa
I'm not sure if I'm missing something so simple, but I'm testing the .net api.

I'm able to connect using the sample code.

but for the UploadsingleFileToFileCabinet, there is no function for Upload document in filecabinet:
UploadDocument
Posted Thu, 07 Nov 2019 21:04:59 GMT by Joe Kaufman Manager
Raymond,

It looks like you don't have the extension methods for the FileCabinet object (of which UploadDocument is one).

Did you install all the proper NuGet packages so that your .NET solution has the DocuWare assemblies? That is where the extension methods reside, namely:
 
​​​​​​​​​​​​​​namespace DocuWare.Platform.ServerClient
{
    public static class FileCabinetExtensions
    {
        public static Document AddDocumentSections(this Document document, params FileInfo[] file);
        public static Task<DeserializedHttpResponse<Document>> AddDocumentSectionsAsync(this Document document, params FileInfo[] file);
        public static Section ChunkAddSection(this Document document, FileInfo file, int chunkSize = 0);
        public static ImportResult ChunkImportArchive(this FileCabinet fileCabinet, FileInfo file, ImportSettings importSettings);
        public static ImportResult ChunkSynchronize(this FileCabinet fileCabinet, FileInfo file, SynchronizationSettings synchronizationSettings);
        public static Document ChunkUploadDocument(this FileCabinet fileCabinet, FileInfo[] files, int chunkSize = 0);
        public static Document ChunkUploadDocument(this DialogInfo dialog, Document document, FileInfo[] files, int chunkSize = 0);
        public static Document ChunkUploadDocument(this DialogInfo dialog, Document document, FileInfo file, int chunkSize = 0);
        public static Document ChunkUploadDocument(this FileCabinet fileCabinet, Document document, FileInfo[] files, int chunkSize = 0);
        public static Document ChunkUploadDocument(this FileCabinet fileCabinet, Document document, FileInfo file, int chunkSize = 0);
        public static Document ChunkUploadDocument(this FileCabinet fileCabinet, FileInfo file, int chunkSize = 0);
        public static Section ChunkUploadSection(this Section section, FileInfo file, int chunkSize = 0);
        public static ImportResult ImportArchive(this FileCabinet fileCabinet, FileInfo file);
        public static ImportResult ImportArchive(this FileCabinet fileCabinet, FileInfo file, ImportSettings settings);
        public static ImportResult Synchronize(this FileCabinet fileCabinet, FileInfo file, SynchronizationSettings settings);
        public static Document UploadDocument(this FileCabinet fileCabinet, params FileInfo[] file);
        public static Document UploadDocument(this DialogInfo dialog, Document document, params FileInfo[] file);
        public static Document UploadDocument(this FileCabinet fileCabinet, Document document, params FileInfo[] file);
        public static Task<DeserializedHttpResponse<Document>> UploadDocumentAsync(this DialogInfo dialog, Document document, params FileInfo[] file);
        public static Task<DeserializedHttpResponse<Document>> UploadDocumentAsync(this FileCabinet fileCabinet, params FileInfo[] file);
        public static Task<DeserializedHttpResponse<Document>> UploadDocumentAsync(this FileCabinet fileCabinet, Document document, params FileInfo[] file);
        public static Task<DeserializedHttpResponse<Section>> UploadSectionAsync(this Document document, FileInfo file);
    }
}

Make sure the DocuWare NuGet packages are installed, rebuild your solution, and try again.

Good luck!
JoeK
Posted Thu, 07 Nov 2019 21:08:55 GMT by Raymond Papa
Thanks for the quick reply.

Yes, I think I do, I selected the DocwareWebclientIntegration in Nuget
Posted Thu, 07 Nov 2019 21:13:23 GMT by Raymond Papa
I see it now, looks like I was missing something :)
Posted Thu, 07 Nov 2019 21:14:17 GMT by Joe Kaufman Manager
Raymond,

I have three packages installed:

DocuWare.RestClient
DocuWarePlatformApi
DocuWarePlatformApiCore

DocwareWebclientIntegration is more for URL integration, which I implement by simply including the assembly "DocuWare.WebIntegration.dll" in my .NET project as a direct reference. The namespace you should be using in your code is "DocuWare.Platform.ServerClient". The WebClient and Platform are two separate things, and the Platform SDK stuff is all a part of "Platform".

Thanks,
Joe Kaufman
 
Posted Thu, 07 Nov 2019 23:59:58 GMT by Raymond Papa
I was able to upload a doc and set an index field because I know what index field to use.

Is it programmatically possible to find out what the index fields are for a filecabinet?

The Fields property for my Filecabinets are 0.
Posted Fri, 08 Nov 2019 06:40:02 GMT by Phil Robson DocuWare Corporation Senior Director Client Services, Americas
Yes it is possible to get a list of File Cabinet attributes.
Please refer to the documentation.

https://developer.docuware.com/dotNet_API_Reference/PlatformServerClient/DocuWare.Platform.ServerClient.html

Look at the FileCabinetField Class.


Phil Robson
Senior Director Client Services, Americas.
Posted Fri, 08 Nov 2019 10:33:03 GMT by Raymond Papa

Is there any sample code how to get the FileCabinetField object?

I don't see that in the list of properties for the FileCabinet class.

thanks.
Posted Fri, 08 Nov 2019 13:47:05 GMT by Raymond Papa
Posted Fri, 08 Nov 2019 13:51:51 GMT by Raymond Papa

Dim sc = ServiceConnection = ServiceConnection.Create(uri, "dwadmin", "admin", organization:="test")

Dim org as Organization  = sc.Organizations(0)
Dim filecabinets as As List(Of FileCabinet)= org.GetFileCabinetsFromFilecabinetsRelation().FileCabinet
Dim fc As FileCabinet
Dim fcField As List(Of FileCabinetField)

For Each fc In filecabinets
            Console.WriteLine("You have access to the file cabinet: " & fc.Name)

            fcField = fc.Fields
            Console.WriteLine("fcField.Count " & fcField.Count)
            If fc.Name = "KTM Sandbox" Then
                Exit For
            End If
Next

all the fcField.Counts above are zero

Posted Fri, 08 Nov 2019 15:17:39 GMT by Joe Kaufman Manager
Raymond,

As far as I know, fields/indexing is all done at the Document level, not the FileCabinet level (all of my counts are zero, too, even when iterating over the List).

If you do something like this:
 
DocumentsQueryResult docs = conn.GetAllDocuments(cabID);
Document doc = docs.Items[0];
int fieldCount = doc.Fields.Count;

You will see the fields of the document, therefore from the cabinet definition.

Thanks,
Joe Kaufman




 
Posted Fri, 08 Nov 2019 15:22:32 GMT by Raymond Papa
yeah, I did something like that to get the index fields.

I think another way that I found is 
fields = filecabinet.GetDialogFromCustomSearchRelation().Fields
Posted Fri, 08 Nov 2019 15:28:09 GMT by Joe Kaufman Manager

Raymond,

Just remember that dialog fields are not the same as the document (file cabinet) fields. A dialog might be configured to only show a subset of the fields, so it is only by looking at the document itself that you can know what the full structure is.

Many layers of complexity!

Thanks,

Joe Kaufman

Posted Fri, 08 Nov 2019 16:43:50 GMT by Raymond Papa
Right about the subset of fields. I think there is a property for hidden fields, so I will have to double check.

Thank you for the warning!
Posted Fri, 08 Nov 2019 16:50:26 GMT by Joe Kaufman Manager
Not a problem.

You are probably right about dialogs knowing what is hidden -- that is handy!

Thanks,
Joe Kaufman

You must be signed in to post in this forum.