Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

DMX Webservice
Last Post 03/15/2010 10:11 AM by Peter Donker. 5 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Diego
New Member
New Member
Posts:12


--
06/29/2009 10:00 AM

 

Hi Peter,
We have to create an application in our DNN intranet environment that have to integrate with your DMX document module.
 
First of all I explain you some features needs:
  • Keep tracking of document expire date
  • Automatically sending mail some days before expiration
  • Creating expiration event reminder on a shared calendar
  • Keep tracking of various document versions after a expiration
The application will be develop using ASP.NET and C# in a separate module, but using DMX document system as document storage for take advantage of functionality (DAV, SEARCH, etc). The choice of create a separate module is to reduce total time of development. The best way, for out opinion, is to integrate all that functions on DMX.
 
But, I think that the best way to do that is to use DMX Web Services. WS permits us to have sufficiently abstract interface layer to DMX module, and I sees all basic features we need (upload entry methods, upload new version, update entry, deleting, etc..)
 
This afternoon I have tried to add Web Reference to Visual Studio, some methods works (LogIn, collection details, etc..) fine but some (like GetEntry or UploadEntry) doesn’t work.
  • On GetEntry method, the result dataset not containing tables definitions and rows (I have tried with SOAPUI and I can see xml raw stream of data)
  • On UploadEntry method, the first parameter is a dataset, but I haven’t the schema to define that dataset and the rules to populate of data .
 
Finally, the question are:
  • There is a documentation about using web service features?
  • I think return value of GetEntry and parameter of UploadEntry isn’t a dataset, true?
  • Do you have a precompiled proxy or sample to call web services methods?
  • There is a license limitation? If true, we can upgrade our basic license just paying the difference, like partial source code version?
  • There is a simplest way to integrate DMX with our application? What are the features of partial source code version of DMX?
 
Thanks in advice.

Diego

 

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
06/30/2009 11:31 PM
- in touch with Diego by email as well -
Walter Nicholls
New Member
New Member
Posts:8


--
03/04/2010 11:41 AM

Hi Peter

I seem to have same problem as Diego, in particular GetEntry does not work.

DNN 5.2.0 with DMX 5.2.2; Using VS.NET 2008 - add web reference (not Service Reference)  - this seems to work although some of the types are missing, eg have LoginCredentials class but not EntryInfo.  Testing on localhost, so licence not activated - I doubt this is issue however.

I have successfully used GetPortalCollectionlist and GetCollectionContents() - these return System.Data.DataSets which I can query using LINQ. By doing this I've got code that looks for a particular file name in a particular folder, and if it is not there already it uploads it via SimpleCreateCollection / SimpleUploadNewEntry. Fantastic.

GetEntry() however returns an empty dataset with no tables in it as Diego states. Not fantastic.

My best guess is that this is related to another issue logged on this forum back in 2008, suggesting that the schema for EntryInfo disappeared from the WSDL between DMX 04.02.03. and DMX 04.03.02 ?

As it stands, GetEntry() appears to be useless, and I'm not even trying to go near SetEntry despite the fact that it would be useful.

(All I want to do with GetEntry is retrieve the MD5 hash, so I'm going to try a workaround using the result of GetCollectionContents...)

[ P.S. I'll just slip in an wish while I'm at it: a way to look at and set permissions on entries via the webservice. I haven't thought through the ins and outs of this yet ]

Walter Nicholls
New Member
New Member
Posts:8


--
03/04/2010 10:38 PM

Quickly I'll just confirm that GetCollectionContents gives me all the information I need for now.  Also customised the ShortList module for per-user folders and that works great.

On the wish list side though, I've written a function FindEntryByPath(  "/Path/To/Title" ) - which returns an EntryID (or -1 if not found). It would improve performance considerably if this was in DMXWebServe.asmx.  Here's the code (roughly):

// DMX is a web service client object
 internal int FindEntryByPath(int nBaseCollectionId, string[] sPath, string sAttribute)
 {
     // Do by traversing each collection
int nCurrentEntryID = nBaseCollectionId; foreach (string sName in sPath) { if (!string.IsNullOrEmpty(sName)) { // Don't get recursive for performance! // there may be 10000 files we don't want..
             DataSet ds = DMX.GetCollectionContents(nCurrentEntryID, false); 
             var var_query = (
               from vm_TABLE_PK in ds.Tables[0].AsEnumerable()
               where vm_TABLE_PK.Field(sAttribute) == sName
               select vm_TABLE_PK).FirstOrDefault();

                    if (var_query == null)
                    {
                        // Nothing found
                        return -1;
                    }
                    nCurrentEntryID = var_query.Field("EntryID");
                }
            }
            return nCurrentEntryID;

        } // FindEntryByPath(int , string[], string )
        internal int FindEntryByPath(string sPath)
        {
            return FindEntryByPath(0, sPath.Split('/'), "Title");
        } // FindEntryByPath(string)

This code also could be made quite a bit better if it was server-side! I've left some of  the extra stuff out (eg case-insensitive compare) for clarity.  Small problem in that it only returns the first matching file - but that's all what I wanted. Replace the FirstOrDefault() with Single() or whatever and deal with the errors..

Walter Nicholls
New Member
New Member
Posts:8


--
03/04/2010 10:43 PM

P.P.S - I could just keep adding ideas to this, but I'll restrain myself to pointing to the weird thing ActiveForums has done to the code ..  that should be (let's see if some whitespace fixes)

   in ds.Tables [ 0 ] . AsEnumerable ( )
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
03/15/2010 10:11 AM
Hi Walter,

Thanks for the contribution. Currently I'm looking at an overhaul of the UI and the possibility of going for a full SOA. So the UI uses a better and more structured service that others could also leverage. This needs time to work out though.

Peter
You are not authorized to post a reply.