Hi Eduard

I've got that working in our version. I hadn't realised that OPTIONS requests were supposed to be picked up by the OnHandleOptionsRequest method (makes sense really!) , so I made a route map for those.  Had to make a / one too for the OPTIONS, then added the Allow and Public Header values to that section and it's working now!

thanks very much for your help

Wendy

Hi Eduard

I've been trying out your WebDAV implementation which I believe would be a really good fit for what we want. Thank you for putting that on GitHub!

What version of Cache does it require to work? We currently only have 2014.1.5 on our development box and I realised quite quickly that it must have been developed using a later version as the WebDav.AbstractREST class calls a method in OnHandleOptionsRequest that we don't have. Also you have an OnPreDispatch method in there which isn't a standard method in our %CSP.REST class, so I've ended up doing s sc=..OnPreDispatch(href,method,.continue) at the start of the various METHOD sections in the WebDav.REST class.

Also I was getting a error with your Route url statements initially. I was getting <REGULAR EXPRESSION> 27 %OnNew+3^%Regex.Matcher.1

so I had to change them

<Route Url="/:docname" Method="GET" Call="GET"/>
<Route Url="/:subdir1/:docname" Method="GET" Call="GET"/>
<Route Url="/:subdir1/:subdir2/:docname" Method="GET" Call="GET"/>

and that worked. In the zDispatchMap code in the .int routine it was ending up with Quit $ListBuild("","GET","GET"). I don't know if that is just another symptom of our version.

Our development box is Windows with it's own IIS

I can now at least get a document to come up when referencing it with ms-word:ofe|u|http://ipaddress:port/namespace/webdav/1.docx but it comes up as read-only. Do you have any advice why that might be. Is it our version of Cache?

I notice in the readme that it says to create a / web application. Did you literally mean "/"? If so presumably that would prevent the server from being used by anything else other than as a WebDAV server since all service requests would get diverted to the service? Although I did actually try creating a / web application and for some reason it didn't work anyway. Could that be part of why the documents are opening in read-only mode?

thanks

Wendy

I don't think the suggestions do what we want.  Correct me if I'm wrong but I think they both require user interaction in selecting a file with a browse button.

We've written a class to open various file types with their native applications or just in a browser window.  If the file is a word type file it opens with word. If they then edit that document, we want them to be able to click something to send those changes back up to the server.

Obviously we know there a long-winded route of getting the user to save it locally, user navigates to an upload page, clicks a browse button, manually select the file saved, then clicking an upload button, but (if there's a way ) we'd like them to click a button after they've finished editing which will save the file contents back to the original file on the server. 

Wendy

Anyone else got any ideas on getting this working so Invalid field always displays 0 or 1, but is also updateable from SQL?  Example class as follows:

Class Wendy.LTCodes Extends %Persistent [ StorageStrategy = LTCStorage ]
{

Property Code As %String;

Property Description As %String;

Property Invalid As %Library.Boolean [ SqlComputeCode = { set {*} = ##class(Wendy.LTCodes).GetInvalid({Code})}, SqlComputed, SqlComputeOnChange = Code ];

Index CodeIndex On Code [ IdKey, PrimaryKey, Unique ];

ClassMethod GetInvalid(WSCode) As %Boolean
{
    Quit +$G(^LTCODES(WSCode,"INVALID"))
}

Method InvalidGet() As %Boolean
{
    Quit ..GetInvalid(i%Code)
}

Method InvalidSet(value As %Boolean) As %Status
{
    Set ^LTCODES(i%Code,"INVALID")=value
    quit $$$OK
}

/// Do ##class(Wendy.LTCodes).SetData()
ClassMethod SetData()
{
    S ^LTCODES("N001")="ANYOLD DESC"
    S ^LTCODES("N001","INVALID")=1
    S ^LTCODES("N002")="C5 REPEAT 1"
    S ^LTCODES("N111")="SPECIMEN COMMENT"
    S ^LTCODES("N200")="MSUD SCREEN|MSUD"
    S ^LTCODES("N500")="Sickle Cell Screen"
}

Storage LTCStorage
{
<SQLMap name="LTCMap">
<Data name="Description">
<Delimiter>"|"</Delimiter>
<Piece>1</Piece>
</Data>
<Global>^LTCODES</Global>
<Subscript name="1">
<Expression>{Code}</Expression>
</Subscript>
<Type>data</Type>
</SQLMap>
<StreamLocation>^Wendy.LTCodesS</StreamLocation>
<Type>%CacheSQLStorage</Type>
}

}

Firstly thanks for your replies.

I've tried to incorporate your ideas into our code, but I find it's still not working.

But then I didn't really understand the use of Parameter InvalidGLVN = "^Utils.GlobalPropP";

I couldn't see that you're tell it where the "INVALID" node is set, so I've tried to create a self-contained class for my example:


 

Now with the Storage definition for Invalid (highlighted) that seems to override the compute code and the SQL works but it shows blanks on the rows where it's not set.

But when I remove the storage definition for Invalid and try to query the table with SQL it just falls over with

  [SQLCODE: <-400>:<Fatal error occurred>]

  [%msg: <Unexpected error occurred: <UNDEFINED>%0Go+1^%sqlcq.USER.cls2.1 *i%%CursorDatad(12)>]

Class Wendy.LTCodes Extends %Persistent [ StorageStrategy = LTCStorage ]
{

Property Code As %String;

Property Description As %String;

Property Invalid As %Library.Boolean [ SqlComputeCode = { set {*} = ##class(Wendy.LTCodes).GetInvalid({Code})}, SqlComputed, SqlComputeOnChange = Code ];

Index CodeIndex On Code [ IdKey, PrimaryKey, Unique ];

ClassMethod GetInvalid(WSCode) As %Boolean
{
    Quit +$G(^LTCODES(WSCode,"INVALID"))
}

Method InvalidGet() As %Boolean
{
    Quit ..GetInvalid(i%Code)
}

Method InvalidSet(value As %Boolean) As %Status
{
    Set ^LTCODES(i%Code,"INVALID")=value
    quit $$$OK
}

/// Do ##class(Wendy.LTCodes).SetData()
ClassMethod SetData()
{
    S ^LTCODES("N001")="ANYOLD DESC"
    S ^LTCODES("N001","INVALID")=1
    S ^LTCODES("N002")="C5 REPEAT 1"
    S ^LTCODES("N111")="SPECIMEN COMMENT"
    S ^LTCODES("N200")="MSUD SCREEN|MSUD"
    S ^LTCODES("N500")="Sickle Cell Screen"
}

Storage LTCStorage
{
<SQLMap name="LTCMap">
<Data name="Description">
<Delimiter>"|"</Delimiter>
<Piece>1</Piece>
</Data>
<Data name="Invalid">
<Node>"INVALID"</Node>
</Data>
<Global>^LTCODES</Global>
<Subscript name="1">
<Expression>{Code}</Expression>
</Subscript>
<Type>data</Type>
</SQLMap>
<StreamLocation>^Wendy.LTCodesS</StreamLocation>
<Type>%CacheSQLStorage</Type>
}

}

So is there a way I can get the above to work?