Page 1 of 1

Using SharePoint document ID to reference files

Posted: Thu Mar 06, 2014 5:43 pm
by Rodrik
Would it be possible (and feasible) to use URLs referencing SharePoint's document ID (of the form https://mycompany.com/MyDITALibrary/_la ... EJK-59-405) instead of usual filename-based URL?

It strikes me that if this were possible, it would mean that files could be moved around and renamed in the SharePoint library without breaking references to them.

Regards

Rodrik

Re: Using SharePoint document ID to reference files

Posted: Thu Mar 06, 2014 6:25 pm
by adrian
Hi,

What type of documents do you keep on SharePoint (DITA, DockBook, other)?
In theory that would be possible, but note that it also means you will bind them to that server/library and they will be difficult to export/move from there.
Make sure you use a clean URL that points to an ID:

Code: Select all

http://<Server_Name>/_layouts/DocIdRedir.aspx?ID=<Document_ID>
The one you provided was very library and layout specific, so that may break after moving it.

Regards,
Adrian

Re: Using SharePoint document ID to reference files

Posted: Fri Mar 07, 2014 4:28 pm
by Rodrik
Thank you Adrian.

I have in mind DITA files. I take your point about the disadvantage of binding the files to the library. I did try out your suggestion but with no luck.

I used the following map:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>Test map - using SharePoint ID</title>
<topicref href="https://<server_name>/_layouts/15/DocIdRedir.aspx?ID=ABCDEFG-59-563" format="dita"/>
</map>
Although Oxygen is able to resolve the topic title in the DITA Maps Manager, when I run the PDF transformation an error is returned:

[DOTX008E] File 'C:\Users\rodrik\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\PYEIUN0J\temp\pdf\https:\<server_name>\_layouts\15\DocIdRedir.aspx?ID=ABCDEFG-59-563' does not exist or cannot be loaded.

Regards

Rodrik

Re: Using SharePoint document ID to reference files

Posted: Mon Mar 10, 2014 3:47 pm
by Radu
Hi Rodrik,

How exactly are you producing the PDF from the DITA content?
Are you using Oxygen or are you doing this on the server side? Do you have a CMS which is installed on the server side and works over the Sharepoint installation there?

Regards,
Radu

Re: Using SharePoint document ID to reference files

Posted: Mon Mar 10, 2014 5:55 pm
by Rodrik
Hi Radu

For this test I simply generated a PDF using the Oxygen XML Author's Apply Transformation Scenario(s) (using the default DITA Map PDF scenario). The map and referenced topic are stored in a SharePoint 2013 library and I opened the map in XML Author using the Open URL option. There is no other CMS. I should point out that there is absolutely no problem generating output from a map that uses standard references to SharePoint resource, such as the following:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>Implementation Guide</title>
<topicref href="fd2b1d06-1535-40dc-b4dd-770d2c192fa2.dita"/>
</map>
Regards
Rodrik

Re: Using SharePoint document ID to reference files

Posted: Tue Mar 11, 2014 3:38 pm
by Radu
Hi Rodrik,

We are having trouble replicating this issue on our side, we enabled the
Document ID Service
but still cannot make the "Document ID" column appear on the resources view, we'll try further.

Anyway, the error you obtained:
[DOTX008E] File 'C:\Users\rodrik\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\PYEIUN0J\temp\pdf\https:\<server_name>\_layouts\15\DocIdRedir.aspx?ID=ABCDEFG-59-563' does not exist or cannot be loaded.
is quite strange, are you sure you open the DITA Map from Oxygen (using the Open URL action or the Data Source Explorer with a configured connection)? Because the file path seems to lead to the Internet Explorer's local temporary files cache, as if you clicked on the DITA Map in Internet Explorer and chose to open it with Oxygen, case in which the DITA Map is brought to the local file system in the Internet Explorer Temporary Files folder.

Regards,
Radu