I'm trying to implement a GUI extension and I need to get the TCM URI of a Page Template.
How do I get it if I only have the WebDAV URL in Javascript?
It is not possible to pass a Webdav URL and get a TcmId using Aguilla. As an option you can implement a WCF service and register it as a model, then you can call to your WCF service passing the WebDav URL to get a TcmUri.
Example:
service.GetTcmUri("WebDavURL", function success(data) {}, function error(error) {});
The other option is to use Core Service API to fetch the object and get the TCM ID from the object. Core Service has .Read method which can help you get object from web DAV url.
I too was looking for a method in Javascript using the Tridion JS Framework to read an item or folder using WebDav. Without writing my own service that is...
Tridion 2011
I came close using the "$xml.loadXmlDocument" for an item and then creating my own request using "Sys.Net.WebRequest" for a folder.
Unfortunately, both are limited in data response, meaning you don't get item id or metadata.
I guess it's because they're using WebDav rather than a specific service.
Is it possible to use Core Services from Javascript, if it is then WebDav works fine in that API.
Thanks
Updated: Yes it is possible, but it's tricky. I created myself a prototype (customExecute) for Sys.Net.WebRequest to allow headers to be passed in, then set the content type to text/xml and a SOAPAction using the ICoreService format, the soap request was then passed as the body, once it complete I removed the namespaces and converted the content/metadata strings to elements... this worked well and allows access to CoreService generally from JS.