Custom Web Application Integration
The ECMP Zero Footprint Client office integration can also be used from a custom web application. The document can be opened in the corresponding Microsoft Office application by navigating to a special URL. The custom web application is responsible for the creation of the correct URL. You can find the structure of this at URL at https://docs.microsoft.com/office/client-developer/office-uri-schemes. The URL must match the configuration of the ECMP ZFC Server. This diagram shows how the different elements should be combined together to build a valid URL.
The URL contains the following elements:
-
The
scheme-nameis coupled to the type of the document you want to open. For Microsoft Word documents the value isms-word, for Excel documentsms-exceland for PowerPoint you should use the valuems-powerpoint. Check the Microsoft documentation if you want to support other file types. -
The
server-urland the optionalpath-prefixshould correspond to the values specified in the application configuration in the General Configuration section. -
The
document-pathhas the following structure:
For the document path there are a few rules you have to follow:
- If the object store is hidden then this path should not include the name of the object store.
- If the document title does not end with a file extension then an extension corresponding to the file type should be appended to the document title, e.g.
.docxfor Microsoft Word documents. - The path may optionally contain extra information in the
tokensection. Note that this information may also contain extra forward slashes.
If you have constructed a valid path, then the simplest way to test this is to construct a simple href-link in your webpage:
<a href="ms-word:https://www.example.com/zfc/OS/editdocument/{80CFF080-0000-CF1D-931E-1AAE33E32773}/file-sample.docx">file-sample.docx</a>
This will open the document in Microsoft Word. The application will handle the authentication of the user.
You can also use JavaScript to open the Office document from a webpage. This function will open the URL supplied as the argument:
function openURI(uri) {
function createIframe(){
var iframe = document.createElement("iframe");
iframe.style.visibility = 'hidden';
iframe.style.display = 'none';
iframe.src = uri;
document.body.appendChild(iframe);
}
setTimeout(createIframe, 5);
}