How to programmatically deploy static html pages to heroku? - java

Problem:
I want to host static html pages (+ some imgs), but have them be uploaded to the host programmatically.
Current Solution:
I use github to store my html pages, and push my files to a remote repository using an API called jGit. I can view my website using an online tool that displays html sites from github's raw source code. People told me this is abusing github so I want to move away from doing this.
So I heard about Heroku. Is it possible to upload my files to heroku using jGit? Are there any limitations to this? Are there better/easier alternatives?
Thanks for any guidance in advance.

Heroku is to run your server, If you are just looking for static HTML hosting, explore GitHub Pages/ S3/ netlify
I would recommend GitHub Pages as you are already using GitHub.

Related

How to create java web form with spring, bootsrap, javascript that calls java method?

this is my first question on stackoverflow and I'm really confused..
I'm new with java and very confused at this moment. I'm planning to create a java web service with spring that handles a webform and a portable scanner device. I get this project for my first in new workplace but I can't move on. I don't know what are the neccesery steps to succeed.
What I want from the Application running step-by-step:
Open in an executable file that
Open a new browser window on localhost and shows a form
Filling out form with input fields, checkbox items, dropdown list,
commentbox,
AND Option for file upload from local and/or call startScan() java method.
startScan() = take photo from device and saves it to project's root folder and rename it as formatted date: "yymmdd_hhmmss"
submitButton()
onSubmitButton() the form data should be saved in database that
later i can download as xml
I have read lot of blogs and watch tutorials but that causes me confused. JPA? Hibernate? REST? REACT? I would like to create a very simple app that can display the form on window browser that is easy to access with bootsrap.
What is the neccesery toolset for doing this as simple as possible?
mysql? postgresql? which of these I can implement, what should i install locally?
If I could came out from back end to front that would be awesome..
Goal: Create a localhost database system that handles the form and scanner device method in a fancy css view.
Now, I'm using eclipse with spring. What are the neccesery dependencies? what are the local requirements for this kind of project? Please, help me with any advices..
I am very grateful for everything
Thank you in advance
I designed something similar, a simple two-page web application with login functionality and application main page that supports database operations and scanning functionality.
I would recommend you to go step-by-step since documentation is also as important, to be able to clearly visualize the project objectives, to know the constraints before-hand, make modifications on-the-fly and as a reference for your peers.
As a newbie with Java development, these are some basic steps and links which I feel would be helpful:
Project Scope Document (Web based tool: Draw.io)
Project Plan Document
Site Map (Web based tool: Draw.io)
Front-end Wireframing (Web-based tool: Balsamiq)
Back-end Wireframing (Microsoft Excel)
Back-end Flow chart (Web-based tool: Draw.io)
Front-end development (Technologies: HTML5, CSS3, Bootstrap 3, JavaScript; Tool: Brackets)
Back-end development (Technologies: PL/SQL or MySQL, Java, JDBC, Servlet, JSP, JSTL; Tools: SQL Developer, JBoss Studio)
Integrating Scanner (Third-party Java APIs)
Technology Stack: This is a simple and very generalized stack preference. You could customize it according to your needs.
Helpful Links on getting started: Java Web Terminology, JBoss Hello-world tutorial, Simple Java web application
Tools: Draw.io and Balsamiq are easy to use web based tools. You could use Bootstrap to make a quick fancy front-end. Brackets is a nice front-end code-editor supporting live-previews. SQL Developer is a wonderful tool if you're using Oracle SQL. JBoss Eclipse IDE has in-built application server which you can use for testing on localhost.
Note: All tools and technologies listed here are either free or include a trial version.
Hope that helps!

build lucene web application with tomcat

I had developed a lucene search engine (with Lucene 5.2.1) and now I want to embed it into a very simple web application (it has demonstrative purpose, it will run in localhost).
This web application should let the user insert some keywords and navigate through search results (in other words it should let the user read the index that I had created, with appropriate html formatting). I had already made some simple html GUI with Bootstrap.
I'm very new to web applications, but I had been told that a good idea would be embedding Lucene in a TomCat server. I had visited this link, but it's quite old and not very detailed. I have tried to look for "lucene tomcat" but I get results about SolR or very specific posts.
Can anyone please suggest me a good resource or a general approach to my issue?
Many thanks
My solution:
I wrapped my search engine library into a JAR file.
I downloaded zipped version of TomCat 8 and installed it into my Eclipse environment as a new Runtime Enviroment.
I made a Dynamic Web Project in Eclipse (see this video lesson) using TomCat 8 server.
I put the JAR into my webapp (should be something like WebContent\WEB-INF\lib\searchEngine.jar)
I created a Servlet to handle user input.
I did the rest using very simple JSP pages, embedding Java code that uses my JAR (I know, that is not so good but it works!)
Cheers!

Export data from a webpage

I want to export some data mostly strings and images from a html webpage to the java\android program that I want to write, can anyone give me a hint about that?
You could use the HTTPClient Library of Apache.
On this site Link you can find examples for it.
And if you want to go that way, remember to download the apache logging jar as well, as it is a dependency of the HttpClient Library

Download Jar file from private GitHub repo in Java

I have 3 private GitHub repos, using Java, I would like to login to my account, and download a jar file from the RAW section of the repo. A simple task if the repos were public. But not so when private.
I have thought about using Apache2's HttpClient. However I have no clue (and googling didn't help either) how GitHub's auth is laid out.
I thought there might be some kind of library for GitHub in Java, but the only Lib I can find doesn't allow downloading of files (here). Only logging in to the GitHub auth and pushing commits/fetching repos, etc. Which isn't what I am looking to do.
Any help is greatly appreciated, thanks.
Since I can't create an answer.
Using the API here
You can create a download service and download the repo. I've not worked out how yet, but I'm pretty sure it's possible, and I will update this answer once I've done it. I need to grab the "IRepositoryIdProvider"
You can use Apache common's HttpClient library to give better control of the credentials/cookies/auth stuff to allow you to get the access. I think that is the problem, right?

Playn - is it possible to deploy on Apache server?

I understand that it's a GWT, but if it compiles to Javascript, can the generated html module compile to such a packaging that I can just deploy it on Apache, assuming I don't have any backend communications?
Yes. This is basically what I was getting at with this question. For the HTML port, you are effectively building a GWT application, which is just an HTML page hosting a bunch of cleverly obfuscated Javascript.
You can find the relevant Google documentation here:
How do I change the location of my cache/nocache HTML files?

Categories