FatWire and Java - java

I would like to know what is the relationship between Java and FatWire.
I know it is possible to create templates using JSP but does it involve any standard Java programming? Also, is it possible to integrate it with MVC frameworks such as Spring or Grails?

Fatwire (now Oracle WebCenter Sites) is a CMS system originally based on an XML language. A JSP API (with the same features of the original XML language) was added later and it became prevalent. One of the biggest drawback of this design is that most of your coding must be done in JSP (that is a view only technology). So you have the (content) model and the view but not a controller layer.
But the real problem is that either you extend the Fatwire application with Java code (restarting the application server at each change, or using JRebel) or you have to code everything in JSP. Almost the website implementation I have seen so far uses a lot of JSP and some spare java classes, so websites have the tendency to be written with the crippled java available in JSP (you cannot share a class for example, or leverage the full Java OOP).
If you want to use full Java, you may use frameworks that implements MVC. For example, AgileSites (Disclaimer: I am the main developer of AgileSites). AgileSites basically uses JSP as interface to the CMS (as the documentation recommends) but those JSPs calls java code stored in hot swappable jar, built automatically while you do your development. So you can code everything using plain Java, without having to restart the application server at each change (only the jar, that is small, is rebuilt, when you save a file). On top of this Java enabling technology, AgileSites gives you plenty of features: clean separation of presentation from controller, using pure java controllers and pure html views, embedded unit testing support, an integrated build for continuous integration, scaffolding, a very simplified API covering 80% of normal needs (while giving full access to the full API) and more.

Fatwire templates can be developed using JSP, XML and HTML. Developing it using JSP has many advantages and Fatwire comes with JSP tags (called ICS tags) for standard based development. Most commonly you can see a JSP based template containing scriptlets of Java code invoking Fatwire's asset api which is implemented in Java.
Latest addition to this is Fatwire Web Experience Management (WEM) framework which are a collection of REST services with SSO that will enable you to write applications around Fatwire.
For example, I have developed REST based applications to integrate SVN, Translation systems and provisioning systems with Fatwire using Java.

Also, the latest Fatwire (Oracle Webcenter Sites) comes with set of developer tools called CSDT which is actually a Eclipse plugin that lets you develop templates within Eclipse (that has all the good features such as versioning, syntax checking) and facilitates local development, versioning of templates and continuous integration.

Yes, Java and FatWire can be used mutually. Code your java classes, wrap them and deploy in war or jar format in your app server lib folder. While coding inside JSPs, call your java classes or methods in JSPs and use them as required.

Related

Multiplatform Configuration Tool in Java

I am working on a configuration tool that needs to work in Windows, Solaris, and Linux. The GUI for the tool will communicate with a service thread that periodically reads information from certain hardware.
I want to use a web interface for the tool, essentially serving configuration options through dynamic HTML and CSS. This will ensure that the GUI looks consistent across platforms and I can avoid the use of applets (tool should be accessible through browser).
So my question is, is there any simple way to get Java to serve web pages (similar to WSGI in Python) and listen for HTTP POST events? I would like to only use the Java standard libraries, and the tool will more-or-less only be accessed by one person at a time.
There's the com.sun.net.httpserver package in the JDK, if you are determined not to use a library, but I recommend using something like Spring MVC for the HTML/HTTP handling combined with Maven for your build scripts. There's a bit of a learning curve, but you can probably just adapt one of the tutorial applications quite quickly.

Can I use JSP but not using JavaBean and Java EE?

I am developing a web application using JSP, but it seems that Java EE is very big for my application. I'm only doing something like a blog.
Can I use a pure JSP and ignore Java EE and the JavaBean and start a pure JSP project?
JavaSE on its own is not sufficient to use JSP, you need at least some components of JavaEE. Specifically, you need a servlet container, such as Jetty or Tomcat.
Neither of these requires (or even contains) the rest of the baggage that comes with a full JavaEE stack.
You don't need to download the huge Java EE packages as offered by sun.com/oracle.com. All it basically contains is the Glassfish server and eventually the Netbeans IDE. Glassfish is a fullfledged and heavyweight Java EE server.
The minimal requirement to develop and run JSP/Servlet is the following:
JDK (click the first Download JDK button) - about 75MB.
A JSP/Servlet container, I'd suggest Apache Tomcat - only about 7MB.
That's all. You have only to choose a development editor, which can be just Notepad. However to ease and speedup development, I'd recommend using an IDE like Eclipse for Java EE. It offers code completion, automatic builds (compilation), easy debugging, deploying to integrated server, etc.
That said, Javabeans is just a specification, say, a style of coding. Public classes with private properties and public getters/setters which represent real world data e.g. Person, User, Product, Order, etc. It doesn't require a download. You just have to write it yourself. However, to ease development and maintenance it's strongly recommend to use Javabeans in your code.
See also:
Is the sun tutorial the best way to learn how to make a Java webapp
Java web development - What skills do I need?
What is a Javabean and where are they used?
JSP tag info page
There's no requirement you use all the features of the Java EE server. There's also stand-alone servlet containers like Apache Tomcat.

What libraries are out there in Java/J2EE and .NET for Coldfusion?

I have always been doing web applications in coldfusion, and not long ago, I needed to generate bar codes for a particular web app, so I searched and one of the results was:
http://ricardo.parente.us/2008/09/printing-barcode-from-coldfusion/
In this solution, coldfusion utilizes Java's barbecue library to generate barcodes
In coldfusions documentation, I have always been reading things like:
ColdFusion is built on a J2EE-compliant Java technology platform. This lets ColdFusion applications take advantage of, and integrate with, J2EE elements. ColdFusion pages can do any of the following:
Include JavaScript and client-side Java applets on the page.
Use JSP tags.
Interoperate with JSP pages.
Use Java servlets.
Use Java objects, including JavaBeans and Enterprise JavaBeans.
Or
ColdFusion lets you access and use Microsoft .NET assembly classes as CFML objects. CFML applications can use .NET assemblies in the following ways:
Directly access and control Microsoft products, such as Word, Excel, or PowerPoint.
Use existing .NET components.
Use .NET assemblies that you create to leverage features that are difficult to use or not available in ColdFusion or Java.
The .NET classes that your application uses do not have to be local; your ColdFusion application can access .NET components that are located on remote systems, even systems that are located outside your firewall. Also, the ColdFusion system does not require .NET run-time software installed to use remote .NET components, so ColdFusion running on a UNIX, Linux, Solaris, or OS-X system can access and use .NET assemblies.
It did not dawn on me what all this really meant until I found the tutorial on barbecue. I saw that it is like there are other whole worlds of possibilities out there.
I would like to know what other libraries are out there in the Jave/J2EE & .NET platforms that be handy in web application development, just as the barbecue lib was?
You can post any that you found useful, Greatly Appreciated!
In terms of J2EE - lots of libraries have been useful to us. For example:
EHCache (prior to CF9's
implementation)
GeoIP (for IP
resolution)
Cryptography (use of a JCE for integrating with a HSM)
Also: We make extensive use of 3rd party software, and often this software has an API in Java or examples in Java. We can use that right away in ColdFusion - often just by dropping a .jar file into the CF classpath.
Very powerful stuff - it's a whole other world of usefulness :-P
We make extensive use of the Apache POI library to generate Excel files.
http://github.com/notnoop/java-apns for Apple Push Notification
http://www.coldfusionjedi.com/index.cfm/2010/9/13/Guest-Post-Apple-Push-Notifications-From-ColdFusion-in-Ten-Minutes-or-Less

Develop desktop applications view with HTML, as a web application

I am used to develop web applications in Java (Struts, Spring, JSP...). But now I want to develop a desktop one. I never liked to design windows in Java (AWT, Swing, SWT): too much work for an ugly interface. So I think it could be a good idea if could take advantage of my web-app skills. One option is to modify the SWT Browser and make calls to a Java function instead of HTTP requests. A very good add-on would be use of JSP. Finally, I thought that probably there is some framework or tool for this.
Do you think that what I propose is a good idea?
There is available some framework for this?
I need this for light applications. So I think that embedding an Tomcat server and using it with HTTP requests is not a good idea.
Edit: One example application could be a folder comparer: you specify two folders and the app shows you which folders and files are different. In this case, I think opening an external browser is ugly. Bloated application (with its server, MVC, etc) wouldn't be the best choice.
If you have used the JavaScript library - ExtJs - then you can use it with Adobe AIR to build good looking desktop based web app.
Building app's in Adobe AIR is also simple and elegant with the flex builder ide.
If your option goes to embed a light server, check winstone is not fully J2EE compliant but should be enough for what you need.
About the browser, I am not a big fan of swt myself, it complicates a lot cross-platform deployment, so probably worth to keep an eye on jwebpane, not quite ready yet, but probably the solution you'll need.
I wouldn't discount embedding a web server. I've done this before with a web start application embedding Jetty.
The download was pretty fast, the server starts up and you can use BrowserLauncher to immediately drive your browser to the embedded server, and hence your application. Jetty is designed to be modular and have a small footprint, so you can probably cut it down to the bare necessities.
There are several options: You can use the plugin API of Firefox and develop your app in there. You can use HTML, JavaScript, the built-in database, all the browser features and access the OS level.
Or you could try PyQt (Python and Qt) which allows to write simple applications very quickly.
[EDIT] The main problem you're facing is security: For security reasons, JavaScript apps (running in a HTML page) can't access local OS resources. So unless your browser allows you to write plugins in JavaScript (which is only true for FF AFAIK), there is no way to write an application which uses HTML as the "view" without the help of something else.
Moreover, HTML is very limited when it comes to features for applications. HTML is designed to be a "static document view" not an "application". You can do things like GMail but if you compare GMail to any real mail app (Outlook, Thunderbird, Notes), you'll see quickly that real desktop apps offer a lot more features.

Java beginner web-development toolkit/environment

I have been tasked to develop an interactive website using java & mysql: using servlets to retrieve & massage data, applets to do special handling of the data client-side, and to handle requests from the client for different data views.
What would you recommend as an proper general-purpose toolkit/environment for web development using java.
I need to know what to use for the following:
Server side (tomcat?/?)
CMS
Editor / IDE
General tools/utilities
Directed (special purpose) tools/utilities
Testing and QA tools/utilities/techniques
Reference material (both on- & off-line)
Please evaluate the suggested solution(s) and supply alternatives/improvements/support.
Suggested Java web-development toolkit/environment
By cdb:
Server side:
Tomcat6
CMS:
Drupal (not necessary in preliminary phase)
Editor/IDE:
NetBeans (good for a beginner)
General tools:
(Almost everything is in NetBeans... go for it later)
Directed (special purpose):
(Almost everything is in NetBeans... go for it later)
Testing and QA:
JUnit and use Firebug (Do manual testing first)
Reference material:
HeadFirst Series on JSP, JavaScript, etc.
SCRIBD (online)
[edit]
Framework:
Spring Web MVC 2.5 - (this seems to contain most of the other frameworks)
Options distilled from the answers
Server side
Apache Tomcat - "HTTP web server environment for Java code to run"
Jetty - "HTTP server, HTTP client and javax.servlet container"
GlassFish - application server (based on Tomcat + more features)
JBoss - application server ("J2EE based application server implemented in 100% Pure Java")
CMS
Drupal
Editor / IDE
Eclipse - IDE
NetBeans - IDE
IntelliJ - propriety IDE
General tools/utilities
Maven - ".. a tool that can now be used for building and managing any Java-based project."
log5j also here[SourceForge] - "java logging library for Java versions 5 and above"
Directed (special purpose) tools/utilities
CruiseControl - team based "tool and an extensible framework for creating a custom continuous build process"
Spring Framework (- design)
Testing and QA tools/utilities/techniques
Watij - "Java API created to allow for the automation of web applications"
HtmlUnit - "It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc..."
Firebug - (Firefox) "edit, debug, and monitor CSS, HTML, and JavaScript live in any web page"
Hudson - "Building/testing software projects [...] Monitoring executions of externally-run jobs"
LiveHttpHeaders - view & edit http request headers live
JUnit - "framework to write repeatable tests"
Reference material (both on- & off-line)
A List Apart - "For people who make websites"
Java - TiJ
Server side
Tomcat6
CMS
Drupal (not necessary in prilim phase)
Editor / IDE
NetBeans (good for a beginner)
General tools/utilities
(Almost everything is in NetBeans... go for it later)
Directed (special purpose) tools/utilities
(Almost everything is in NetBeans... go for it later)
Testing and QA tools/utilities/techniques
JUNIT and use FireBug (Do manual testing first)
Reference material (both on- & off-line)
HeadFirst Series on JSP, JavaScript, etc.
SCRIBD (online)
For web-development I use (and would recommend) the following:
JSP/Servlet API
Spring MVC
JQuery
XHTML & CSS
Fitnesse
With regards to resources, all these technologies are well documented on their respective sites, the only exception being XHTML & CSS for which I'd suggest http://www.alistapart.com.
With regards to editors both IntelliJ and (I believe) Eclipse have very good HTML, CSS, JSP and JavaScript editors.
Also use Firefox (as Brian has suggested) with both the Web Developer plugin and Firebug - both of these are indispensable.
Tomcat and Jetty are both well-known/supported servlet containers. If you're building a deployable for customers you may want to test on both, if you don't control the deployment.
For testing, check out (along with your normal unit test frameworks of JUnit/TestNG) Watij and/or HtmlUnit. These will allow you to automate the actual web/browser interactions and will save you a world of grief in the long run. The downside is that you'll have to invest some time in setting up your tests.
Related to automated tests, I think you need an automated build / continuous integration system. Numerous abound in the Java world. Two common ones are CruiseControl and Hudson.
For a lot of the above, standard Java/development tooling applies e.g. the 'standard' IDEs (Netbeans/Eclipse/Intellij - Intellij is worth paying for, btw). The same applies for CMS and there are lots of resources on this website about the pros/cons of SVN/Git/Mercurial etc. It's worth checking that your choice of CMS integrates with your IDE.
I would check out Firebug for simplifying development (on Firefox). It makes the front end development a lot easier. LiveHttpHeaders will ease diagnosis of issues relating to HTTP transfer.
CMS
Tortoise SVN
Editor / IDE
eclipse
General tools/utilities
Maven (build and deploy tool)
Cruise Control
GWT/ext-GWT/ICEFaces - web component technology
Spring - dependency injection framework
Hibernate - ORM
Axis 2.0 web service development kit
Jboss
Directed (special purpose) tools/utilities
log5j - for logging
Testing and QA tools/utilities/techniques
- Watij
- Firebug
- QTP for automated testing
- Junit Perf (Junit test cases for performance testing.)
Reference material (both on- & off-line)
Java docs of each of the technologies
Google ofcourse :)
Try vcl.js is all in one (front end and backend) enterprise web development tool,
Visual Component Library- include Page,Grid,Input,Gauges,Charts and many more
Pure JavaScript
Single page application
.Net Backend
Data binding
Twitter bootstrap
Simple database query execution
Routing
AMD - Module loader
I guess the idea is that you don’t need to learn jquery,Sammyjs or any other framework
First paragraph edited by request of slashmais : This answer is not really aligned with others, and the rephrased question. It's more of a complement to other answers.
I believe the personal preferences are really important in choosing between technologies. I see it as (dis)liking some things, and choosing the technologies that correspond. The rest of the answer gives examples:
For example, suppose I believe the developer's actions should be checked in real-time as much as possible, to receive immediate feedback, and also completion if possible, and avoid early so many errors. This (dis)liking determines some preferences:
use a statically type language (like java)
use an IDE that compiles as you type (like Eclipse)
any Xml must be validated, via strict xsd. If the content have references to other information (such as java code), then it should be checked (like Spring checking for bean classes).
for the view technology, because it depends on my java code, I must have a verification that includes my actual java code. An idea could be to code my view in Java. (like Wicket).
my properties need to be in properties files for translation. But using String keys in my code (or view) is not acceptable. I would run a small tool that create java enums from each property file, and my code would reference the enums.
... and so on
Other example, suppose I strongly prefer "Convention over Configuration". That is, I agree to follow stricts rules in my project, getting much less plumbing to do manually (because default values fit):
Maven is the build tool of choice. It will impose many constraints, but also provide out-of-the-box many "build" features...
For a web application, I couldn't use Struts 1, because they are these huge configuration files in struts-config.xml, mostly with plumbing code. I would definitely switch to something like Spring MVC, that has default values for mapping urls to controllers.
and so on ...
Other example, suppose I believe so much in the Model-View-Controller separation, for clarity and reuse, that I want to stretch it a bit. I could use:
in the view, I would cleanly separate my model (clean Html, no formatting, no script), my view (or formatting, external css only), and my controller (javascript, using the non-obstrusive javascript policy).
in the webapp, I could use Spring MVC to separate well those layers.
in the business (this example is a bit constrived :-) ), I could have a rich domain model, use extensively the command pattern ("controllers"), and expose explicitely my business services as an interface API ("view").

Categories

Resources