draw.io: cannot open xml file from URL (using the parameter "url=...." ) - url

I've installed draw.io on a local web server and want to open a xml file which resides on the same web server.
The documentation proposes the URL parameter url=url
This is my xml file:
https://draw.io.myorg/folder/test.xml
https%3A%2F%2Fdraw.io.myorg%2Ffolder%2Ftest.xml (encoded)
This is the URL which uses the URL parameter url=...
https://draw.io.myorg/folder/draw.io-master/war/?url=https%3A%2F%2Fdraw.io.myorg%2Ffolder%2Ftest.xml
The above URL ends up with the message "file not found".
Same error if I try to open this URL via "Open->From URL".
When I store the xml into a local file, I can open it with "Open-> Device ..."
However, the web server and the browser show me a failure when opening this file:
https://mdraw.io.myorg/folder/draw.io-master/war/proxy?url=https%3A%2F%2Fdraw.io.myorg%2Ffolder%2Ftest.xml
Obviously the parameter url causes some redirection to a proxy which does not exist?
Any help is appreciated!

Related

WOPI Host implementation, trying to render doc in iframe

I'm trying to get Wopi host implementation in Ruby on Rails application.
My domain is whitelisted under CSPP. Trying to get the file contents in iframe, but I just see "Word Online" and a loading gif, I return binary file contents of docx as response to ..wopi/files/:id/contents. I don't get any calls hitting my host server.
Sample wopi_src_url: https://word-view.officeapps-df.live.com/wv/wordviewerframe.aspx?ui=1033&rs=1033&dchat=false&IsLicensedUser=0&WOPISrc=https://sgdevwopi.test-wopi.sycamoreinformatics.com/wopi/files/31/contents?access_token=eyJhbGciOiJIUzI1NiJ9.eyJ1c2&access_token_ttl=160000000
Able to get the Wopi validation page in Iframe using .wopitest file. How should I proceed further? Or what am I missing? Please help.
Note: I'm using ngrok to make my local app server visible publicly with whitelisted domain.
I see to problems with your URL. You must ensure that
the URL is of the form http://server/<...>/wopi/files/(file_id) (so drop the /contents part - WOPI client will call the /contents endpoint automatically when necessary)
the WOPISrc parameter value is encoded to a URL-safe string
More info here and here.

How to redirect to the url in a .URL file in O365 OneDrive through Microsoft Graph API

Let's say I have a .URL file that's visible in the O365 OneDrive Web UI. Clicking on this file will correctly redirect me to the url in the contents, in this case http://www.bing.com. Is it possible, from my application using the Microsoft Graph API to ping that .URL file and open the url in a new tab?
I tried to download the file with an ajax call, view the contents, then redirect from there but any request with the #microsoft.graph.downloadUrl, webUrl, etc always attempts to download the file and not let me see the contents.
There isn’t a way via the Graph API to get the destination of a URL file directly. You would need to download the link file, parse the file to find the embedded URL and then redirect the browser to that URL.
You should be able to do all of that in client-side JavaScript. You would download the file via an Ajax request to the download url, and then you can parse the text content of that request to find the URL.
I know it would be ideal to have that information available directly from the API and that work is in our backlog, but right now you’ll need to do more of the heavy lifting.

Maximo 5.2 Can upload attachment to the server but can't view them on client side

Ok I know Maximo 5.2 is horribly outdated but currently I just want to get the attachment working. So here is the situation:
I have an old server (running 2000) with a folder being shared on the network with the name of F$. I have tried that the attachment uploading functionality works fine: users can attach any file to a work order and that file will be copied into a specified folder in the F: drive of the server. But when I try to access to that file from the client side -- that is, click on the link within the work order (from attachment tab in Maximo webapp) in order to view the attachment -- I get a 404 response. So in a way it's like I am able to write to the server but somehow I can't read or download it from the client side.
UPDATE:
I found out that after you've uploaded a file to the server, it can be accessed from the link http://servername:port/doclinks/drawings/filename from any other client side desktop in the browser. However within the Maximo web app, the webpage javascript automatically parse the link as http://servername/f$/MAXIMO/doclinks/drawings/filename -- It returns redundant part and withno port number. Is this returned link configurable through settings or do I have to dig into the JSP?
You need to set up virtual directory mapping on weblogic
http://docs.oracle.com/cd/E11035_01/wls100/webapp/weblogic_xml.html
The files are on the server. You just to correctly map the doclinks root on the file system to make it accessible to the web. You are getting a 404 error because the mapping is wrong.
In c:\maximo\applications\maximo\maximouiweb\webmodule\WEB-INF look for weblogic.xml
Add an entry:
<virtual-directory-mapping>
<local-path>/apps/maximo/</local-path>
<url-pattern>/doclinks/*</url-pattern>
</virtual-directory-mapping>
The entry above sits between <weblogic-web-app> and </weblogic-web-app>
The above example would mean your doclinks directory on the server is /apps/maximo/doclinks/
You would need to edit weblogic.xml, redeploy your maximo.ear along with your doclinks.
Because you are getting http://servername/f$/MAXIMO/doclinks/drawings/filename, particularly the f$/MAXIMO part, it tells me your F<PATH>\\MAXIMO\\doclinks = http://servername:port/doclinks mapping in your doclinks.properties is not correct. If you are on the Maximo host, via remote desktop or whatever, and you open Windows Explorer, what do you need to put in the address bar to access the attached documents folder? You said it's on F$, but F<PATH> in your properties file will translate into F:, not F$. So, you need to change your doclinks.properties
from: F<PATH>\\MAXIMO\\doclinks = http://servername:port/doclinks
to: \\\\servername\\F$\\MAXIMO\\doclinks = http://servername:port/doclinks

xsl file Access Denied except on host machine

Here is an example of the start of an XML file we build, note that is is Accessing "CCD.xsl" for the style sheet.
'<?xml version="1.0"?>'
'<?xml-stylesheet type="text/xsl" href="' + 'C:\CDA\Schemas\CCD.xsl"?>'
'<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
Anytime this xml loaded into a TWebBrowser from a remote user accessing the server they get the following error
"Access is denied. Error processing resource 'file:///C:/CDA/Schemas/CCD.xsl'."
WebBrowser1.Navigate(TempFileName); //TempFileName = C:\data\CCR_Record_3336557.xml
Any Ideas on how this could be resolved?
If you need additional information let me know..
Thanks, appreciate the help.
You have two problems, both stemming from the fact that the XSL reference is to a local file on the C drive.
Problem #1 (the one giving you the error) is that your browser is blocking attempts to access local file system resources from a remotely-downloaded XML file. So the browser throws a security error when trying to render that XML file. That's the immediate error you're seeing. Adjusting security settings or changing browsers won't solve your problem because of problem #2.
Problem #2 is that your client presumably doesn't have an XSL file on their local hard drive at C:\CDA\Schemas\CCD.xsl. It's on the C drive of the remote server. You can't just put it on a network share because of problem #1, so you'll need to serve it through the same mechanism you serve the XML file. Then change your URI for the XSL file to something like http://myserver/schemas/ccd.xsl.

Error downloading file from a given URL

I am trying to download the given URL:
http://www.addic7ed.com/original/9521/7
but when i try to download the file using my Java Code:
URL url = new URL("http://www.addic7ed.com/original/9521/7");
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
FileOutputStream fos = new FileOutputStream("abc.srt");
fos.getChannel().transferFrom(rbc, 0, 1 << 24);
The html page gets downloaded whereas the file to be downloaded should be a .srt extension file.
But when I try to download the above link using Internet Download Manager the file gets downloaded.
IDM converts the above given URL into http://www.addic7ed.com/srtcache/Supernatural/Supernatural%20-%2004x06%20-%20Yellow%20Fever.720p%20CTU.English.orig.Addic7ed.com.srt
So my question is how to achieve this in JAVA...?? Are there any API available to achieve this.
Have you looked at the HTML file? I suspect that it is actually an error page from the server, and that it contains clues about what is actually going on.
Here are some possibilities:
Maybe you need to supply authentication credentials.
Maybe the server is sending a redirect (3xx) response, and that the client side is not performing the redirect.
Maybe you need to set some extra headers to make the server realize that it should not turn the response as HTML. For example, an Accept header.
But note that the details will depend on the server that you are trying to talk to.
If I was trying to download files programmatically in Java, I would either use HttpUrlConnection or the Apache HttpClient libraries. Both will give you more control over the download process than simply using URL.openStream()
This is probably because the http response from http://www.addic7ed.com/original/9521/7 is a 302 redirect which your java code is not correctly handling. IDM correctly handles the redirect. A great tool to use if you are on a *nix based systme, or have cygwin installed on windows is curl.
curl -v http://myurl
will display all the http traffic information (request/response)
Have you tried with?
URL url = new URL("http://www.addic7ed.com/original/9521/7");

Resources