How can I pull remotely stored PDFs to be viewed in Ionic? - angularjs

I have a site where PDFs are uploaded and stored (all exactly the same way) as (publicly available) attachments on a web page.
Using an Ionic app, I want to query the site and pull in the PDFs as a list where each item can be opened and read in the app. The PDFs would remain on the site/server, but would be available through the Ionic interface to be read as pages.
What kind of setup or services would I need for something like this?

It seems to me like you'd want an API that simply lists the available PDFs and the URL/Location for them. That would be better than the ionic app trying to parse HTML from your existing site (which is what it sounds like you're considering). Then the ionic app can call this service and get the PDF listing in JSON, which is very natural.
Then if the PDFs are externally accessible (meaning no token/security required), the display of the PDF should be a simple window.open() call.

Related

Content Management Api to POST media files from external source

I am looking for a solution in episerver to add media files from external sources into episerver.I am aware that episerver has recently released Episerver Content Management API to post contents within Episerver.Is it possible to use this for media files as well.As this is newly introduced in episerver, i cant find any references other than the documentation within epi which has more of CRUD operations on Content.Can someone please point out some reference links for me to get this started?
Any input is appreciated.
Regards,
The content management API is useful if you want to create a headless website that talks to Episerver via an API to get content.
Depending on what you want to use the media for will depend on the optimal approach. I assume you want the content editors to be able to pick these items from within the CMS? If so there are two main appraoches:
You could write a scheduled task using the content repository API to import the media into the Episerver media library
The other option is to create a content provider, so the media is available in the editor, read this to learn how to do it. This option is more fidley so I would go with option 1 if possible.
If you just want to render images on a web page, then call the API using AJAX. Job done!

Mobile app with data from TYPO3

I don't know anything about TYPO3.
I have a potential client who pushes content on a website through TYPO3 and now wants to expose some of this content in a mobile application I'm supposed to develop.
I use to implement mobile apps with Ionic.
So I have two questions:
1) Is there a way to read TYPO3 content as a web service so I can call it in my Ionic app ?
2) Is TYPO3 able to expose some part of his content in a responsive website so I just have to configure it and show that website in my webview?
In TYPO3 you can configure any kind of output. That can be the same content in the same structure as the original website.
You can configure additional pagetypes.
jsonPage = PAGE
jsonPage {
typeNum = 1234
config {
disableAllHeaderCode = 1
:
}
:
}
Often this is done for a print-view or a pure text view without tags.
In this way you can output the page content as e.g. JSon or XML.
I even did an output once as PHP includes which had the pagecontent in php-variables.
So you can request abstract data, or the same data with another rendering than the normal page like a special responsive rendering.
Even if you do not want to use TYPO3 at all, you can still make your own queries using php/mysql as all content and page related data (at least should be)is stored in the database and is well sorted there.
(Which is much more work than defining a new pagetype as mentionned above - but could also be an option)

LinkedIn share links to PDF documents

I am trying to create buttons on a web page that allow users to share links to PDF documents on LinkedIn. LinkedIn loads a window without any errors but offers no link or preview of the PDF or any indication of what is being shared.
Here are the two methods I have tried. First the plugin method.
<script type="in/share" data-url="http://example.net/DocumentDownload.aspx?Command=Core_Download&entryID=114"></script>
And, secondly with a custom url.
TEST
Encoding the url makes no difference.
The above links are direct document links from a DNN web site using Document Exchange. If I change the urls to any html page it works fine and LinkedIn seems to be able to extract the useful information right from the page and use that for the share details.
Can LinkedIn handle this kind of thing? There is nothing to guide me on the type of links that can be shared. I can't find any information about it. There are no errors in the web console.
Not sure, but you should try to provide LinkedIn with the link that has .pdf at the end, like http://example.com/documents/file1.pdf. I guess LinkedIn just checks the URL if it has .pdf file at the end to decide if it is a PDF document or not.
I have no problem sharing pdf's on LinkedIn. Check it out...
https://www.linkedin.com/sharing/share-offsite/?url=https://www.revoltlib.com/anarchism/the-conquest-of-bread/view.pdf
Works perfectly fine. And view.pdf is a script, not a file, either, so, it's not looking for a PDF file to analyze, so much as headers that indicate you have a PDF file available to analyze, so, in PHP, at DocumentDownload.aspx, we would do...
header('Content-type: application/pdf; charset=utf-8');
This header let's the sharing app know that it can analyze the document as a PDF file and extract useful information from it, as you can see from the screen shot.

Save web data into PostGIS

Is it possible to store harvested data from a website(Nestoria) upon implementing their APIs using PHP?
I am able to extract the data using PHP and it displays the result on a web browser, but I need to dump or save them into my PostGIS database. (I am using XAMPP and PostGIS on windows 7)
Most companies wouldn't have a problem with you doing that, for instance Ebay's API. However, as Mapperz pointed out - Nestoria's terms require you not to compete with them for originality of the content. So, any data that comes from their API and stored in your database should not be able to be indexed by search engines.
This isn't as difficult to comply with as you might think. You could have the content loaded through an iframe that uses the "NoIndex, NoFollow" meta tag attribute in the HTML of the page being loaded, or pull the content from the database to your page's DOM using AJAX/JavaScript after the page has loaded.
I personally would go with the second option (AJAX).

Pre Poulate a Text Field with a URL

I have a mobile simulator at http://businessmobilewebsite.com/tester/ and was wondering if there is a script or way to populate the text field so that I can send a sampole of the customer mobile website to them.
Maybe I need to change it to a php file or something.
So I would like to send them to say
http://businessmobilewebsite.com/tester/?url=http://speedie.mobi/luchetti/#
Quentin
That website uses javascript within the page to load the entered URL within their "emulator" and does support passing parameters as the web page is not a "real" web form.
If you have a specific question about the functionality of a specific website, then why not contact them http://businessmobilewebsite.com/contact/
There are alternative online mobile emulators which do support the funcitonality you require, such as:
http://iphonetester.com/?url=http%3A%2F%2Fspeedie.mobi%2Fluchetti%2F
or
http://emulator.mtld.mobi/emulator.php?webaddress=speedie.mobi/luchetti/&emulator=sonyK750

Resources