Can anyone recommend an existing java file repository - java

that will allow my users to edit word documents locally in Word and have them saved back to the server when finished.
The project will be Grails based and I'm looking at things like WebDav but I would need security features that won't allow one user to access another users documents.
And unfortunately the test I ran opening a word document via a WebDav URL first downloaded the file rather than opening directly. So when saved, for example it just saved to c:\download\mydoc.doc.
So I'm looking for alternative ideas if anyone has any thoughts..

Look at this list http://java-source.net/open-source/content-managment-systems

Take a look on Alfresco.
Update
Enabled access protocols are listed in documentation and wikipedia.
CIFS/SMB
FTP
WebDAV
CMIS

Related

How to use or load flash file exists on different server

I want to use flash file stored on another server or repository. I am using below code in xsl to add flash file.
https://www.***.com/docs/swf/Spreadsheet.swf
The problem is I am unabele to create swfObject because that flash file is not getting loaded properly on browser. My xslt application is on another server which is trying to access .swf file using above code. I guess there might be domain related issue. I read somewhere about cross domain.xml file.
Is it really required in above scenario? If yes then where to keep that cross domain.xml file? The flash file that I want to access is on another repository which is not on any web server. So can anyone provide me solutions on this?

Java Application on Amazon Web Services with Mobile and Web Clients

Our new start-up company is trying to build a mobile app with an accompanied website. We are trying to setup our application on Amazon Web Services.
We have Java code running in an EC2 instance, which will store data in S3. We want clients (iOS and Web for now) to communicate with the Java Backend via a REST API. Ideally the website would be hosted under the same AWS account.
The Java Code and REST API are already set up in a very basic form, but the setup of the Website is unclear, since this is new to us all. We also would like to evaluate beforehand if such a setup is even feasible.
Since I am in charge of the Website i have already spend hours researching this specific setup, but i simply lack experience in cloud/backend development to come to a conclusion.
Here are some questions we would like to answer:
Where would the HTML files and accompanied JavaScript etc. files be stored?
How can data (images etc.) that is stored within S3 by the JAVA code be accessed from the Website directly?
How could something like bootstrapping of data within HTML files be achieved (in JSON format preferably)?
How could the server be set up to compress certain files like CSS or JavaScript?
Please point me into the right direction, any comment is appreciated.
Where would the HTML files and accompanied JavaScript etc. files be
stored?
Either on the same AWS EC2 box or a different one, just give it a static IP and link that IP to the domain you want, done. Just remember to have port 80 open as a firewall rule.
How can data (images etc.) that is stored within S3 by the JAVA code
be accessed from the Website directly?
The files will have some url that you can link to directly in your html so it's essentially just a url.
How could something like bootstrapping of data within HTML files be
achieved (in JSON format preferably)?
You have a number of choices here. You could potentially create some JSP files to generate the HTML and load the JSP files on access and cache them so they load up super fast. You could argue however, this is overkill and in some ways, the REST endpoint should be robust enough to handle the requests.
Part of me thinks you should endeavor to use the REST API for this information so you just have to manage one endpoint, why make an extra endpoint or over engineered solution for the HTML that you then have to maintain? Build once and reuse.
How could the server be set up to compress certain files like CSS or
JavaScript?
During the build process, run the files through a minify process. This is built into maven so you could do it automatically or by hand using something like jscompress. This Minify plugin shows how to automatically minify your resources. Consider you'll need to be using Maven though as your build tool.

Using Google spreadsheet without authentication

All,
I have an application that is built on GAE, I want to use google spreadsheet (data) API to expose some reports. To do so I've been reading https://developers.google.com/google-apps/spreadsheets/ and trying to adopt it to my needs.
In my case really users who are looking at the reports are already authenticated by my application so I don't want to use OAuth 1.0 or 2.0 to authenticate them again. My use case is very simple.
- Users login to my application
- Then click on a link
- I generate a report in shape of a google spreadsheet and redirect user to the report page.
As I'm reading the documentation I can't figure how to do this without getting the user to authenticate again. Please note I don't want to create a document in user's google doc folder, I want to create one in my folder and have the to see it.
Thanks for your pointers.
Amir
Added: I was thinking about this and another challenge I guess is I have to adda document to my folder for each report and share it?! I was hoping I can simply stream the report to user's browser but I guess that's out of question!
If you want to generate the Google Doc in your own folder, then your authentication is what would be required on the backend, with a sharing level of public.

How to provide access to an external resource (file) for a GlassFish web application?

I am a bit of a GlassFish beginner, so please forgive my ingnorance on the subject.
Basically we are serving a game website, and to make the client downloadable by our web app we copy it into a directory within domain1. The problem with this is that when redeploying the web app the client downloadable is lost and we have to copy it across again.
I'd like to be able to store the client downloadable in some external location and have GlassFish provide access to it.
I could just hardcode the link into the web app, but then we would lose portability so that's the reason for having GlassFish handle it.
I could also put the client downloadable into our database but that seems like poor use of a database and could also result in poor database performance.
The third option I have found is to add a custom resource mapping from some name to the file location, and then provide a method in one of my beans to retrieve the file location. This seems like a lot of work just to have an external resource, I feel like there must be an easier way.
So what should I do?
With GlassFish you can define an alternate document root to serve files from outside the war. From the documentation:
Alternate Document Roots
An alternate document root (docroot)
allows a web application to serve
requests for certain resources from
outside its own docroot, based on
whether those requests match one (or
more) of the URI patterns of the web
application's alternate docroots.
To specify an alternate docroot for a
web application or a virtual server,
use the alternatedocroot_n property,
where n is a positive integer that
allows specification of more than one.
This property can be a subelement of a
sun-web-app element in the
sun-web.xml file or a virtual server
property. For more information about
these elements, see sun-web-app in
Oracle GlassFish Server 3.0.1
Application Deployment Guide.
So you could configure something like this:
<property name="alternatedocroot_1" value="from=/ext/* dir=/path/to/ext"/>
Refer to the documentation for full details.
The link to your downloadables needn't be in the same application as the game servlets, right?
One solution would be to create a new "pseudo" application containing only a web.xml and your static file content. You would of course not deploy it in war form (well, only if you really want to) but just copy the files into the unpacked directory when you want to change content. I use a setup like this to serve a bunch of files from a Web app server I run.
At work, in an "enterprise" kind of environment, we do things differently. We have an Apache HTTPD server working as the front end. It forwards to the app server for stuff that needs to be done in Java, but any static content, as well as cookie management, SSL, load balancing and other "web server-y" stuff is done by HTTPD. This yields a bit of a performance advantage with heavily loaded sites and lots of big but static files. It also lets us split the work among different physical boxes, which again can help with performance.

web based java application to read LDAP

I want to make a web based Java application that reads an LDAP compliant directory and creates a record in a database for each user and group in the directory.
How can i go about it?
I've used the Spring LDAP module to interact with directories. It works very well, same as all Spring code. You would use whatever relational database technology you wish to write to the database. If you're already using Spring, this won't be difficult. In this case you'd create a connection to an LDAP to read the data and another to the database to write it.
But there's a question here that's worth asking: Why do you feel like you need to duplicate the data? The DRY principle would discourage you from doing so. Wouldn't it be better to have all the information in one place or the other?
I don't see how being web-based will affect things, so long as the web server has access to the LDAP directory - you'd use classes under javax.naming.
If you want to access a directory which the browser has access to but not the web server, you'll need to write code to run on the client instead - possible a JNLP application with appropriate access to make network connections.
The general API for talking to directory services (including LDAP) in Java is JNDI (javax.naming).
The official documentation for LDAP is rubbish, but there's a good tutorial on JavaWorld here.

Categories