7

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?

1
  • 1
    How are you getting the WebDAV URL of the PT? Could you share your code? Commented Nov 6, 2013 at 21:57

3 Answers 3

5

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) {});
0
2

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.

-1

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.

5
  • Is it answer or question? Commented Nov 19, 2013 at 4:40
  • If you read the post you would have known it was a question regarding the use of Core Services. Commented Nov 19, 2013 at 23:51
  • Question shouldn't be posted as answer. Commented Nov 20, 2013 at 4:07
  • Question: Is it possible to use Core Services from Javascript? Commented Sep 29, 2014 at 20:45
  • I updated this with a possible solution, using Javascript, which I tried and tested successfully... does it qualify as an Answer now? Commented Jan 30, 2015 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.