Jbilling + Ruby - java

Are there ready solutions (gems, plugins, libraries, etc) for integration ruby (rails) applications and jbilling?
I didn't find even api client for ruby.
I need someone to share his experience with integration. Jbilling has web-service (SOAP ,Java RMI, Burlap) but there is no specific gem for easy accessing and editing data via API.
JRuby 1.6.0 was Released yesterday.
Lines from jbilling manual "All of the API classes are located in the jbilling_api.jar file located in your jBilling
distribution.
The API also makes use of several third-party libraries, such as the Log4j library and
Commons Logging, which provides a powerful logging infrastructure; Spring, which
handles configuration and remoting; CXF, a SOAP library; and Hessian, for
Hessian/Burlap support. You'll therefore need to provide the log4j.jar, commons-
logging.jar and spring.jar files in your class path, if your project does not already
include them.
"
Is that good practice to include so many jars in jruby rails application ?

You can try making your app run on JRuby and using the Java libraries directly. We did an experimental branch of our own app for a similar reason and found some useful projects in the process:
https://github.com/nicksieger/warbler/
https://github.com/calavera/trinidad
In the end we didn't go for JRuby, for various reasons that weren't necessarily of a technical nature.

What version of jB are you using? You could use this project as an example to do your integration.
You can also build such a project from scratch using wsdl2 java utility. Typically, you can access jBilling wsdl at localhost:8080/jbilling/services/jbilling?wsdl assuming jb is running on your local at port 8080.

Related

Importing/using Java classes in Grails

I have an existing RESTful service created with Jersey, for which I created 2 clients (also Java), one using the Jersey client API, and one using Apache HTTP client.
I don't have much frontend experience- I've used Spring/Java a little bit and understand the basic concepts, but I thought I would try learning Grails. I wanted to just use Grails for the front-end (So, no reliance on GORM), and use my existing service for business logic/interaction with storage). Would it be possible for me to just include the jar w/ my existing client and use it in my Grails controller, or will I need to write a new Groovy client for it using a Groovy (or an already included java library)?
I'd also be happy to get opinions on if this seems like a good idea, or if it seems pointless to use Grails if I'm not taking advantage of GORM/Grails data persistence functionality? I figured I could still get the advantage of 'convention over configuration', and maybe some other advantages of the framework, but again I'm pretty new to web development so I'd appreciate any advice.
You can use your existing java client in grails. If your existing client jar is in a maven repo then you can specify dependency for the jar in BuildConfig.groory. or else you can just drop the jar inside your grails projects lib directory.
Also, if your client code depends on any third party jars, you will have to specify dependency for that third party jars in BuildConfig.groovy - See grails docs for how to specify dependencies.
If you want, you can use grails rest-client-builder plugin to write your client too.

Which .JAR do I use to embed Jetty?

I'm at the point in my application where I would like to have an HTTP Server embedded into my project that updates the page in real-time using AJAJ(Similar to AJAX). However, I have no idea where to begin and the amount of tutorials on this subject are fairly limited, so I decided to go with a name that I've heard quite a few times before, Jetty
So, I downloaded Jetty and read through some documentation, and I'm staring at their beginner tutorial asking myself, "Which one of these f*kin jars do I use?" There's like 9,001 of them. Not to mention that there's like 1200 folders that all contain 1500 more jar files each.
Okay, I'm over exaggerating, but take a look.
It's fairly, uhm... confusing. This is much different than most libraries that are a single jar file, this is just... insane.
Anyway, I'm trying to figure out what all I need to be able to use JQuery, AJAX(AJAJ), and basic HTML features.
I'd suggest you to start with this simple tutorial and jetty-all jar
Embedding Jetty Webinar recording
Embedding Jetty docs
jetty-all different versions downlad
To followup on Gas's answer.
jetty-all doesn't have 100% of Jetty.
It used to, hence the name.
However, today its impossible to have 100% of jetty, as many components can conflict with each other.
If you use maven, or gradle, or ant+ivy, then you'll likely want to depend on:
org.eclipse.jetty:jetty-webapp
org.eclipse.jetty.websocket:javax-websocket-server-impl
let the transitive nature of those build tools pull in the rest.
This would get you "started" easily enough.
There are also plenty of example projects that use embedded jetty.
See:
Embedded Jetty: with JSP enabled
Embedded Jetty: with various WebSocket configurations
Embedded Jetty: using Servlet 3.0 features
Embedded Jetty: using Servlet 3.1 features
Embedded Jetty: various Logging configurations
Some use 100% embedded jetty (without a war file, or WEB-INF, or web.xml), some use a war file built elsewhere.
Jetty uses maven so it can participate in the global central artifact repository, and that we have 2 developers on Jetty that are also developers on Maven.
If you want to manage the dependencies yourself, then you will need to know intimately the purpose and role/purpose/relationship/requirements of every jar file that you are going to add into your project. (and answering that is way out of scope for stackoverflow)
You have many build tool options to make managing the dependencies easier:
Apache Maven
Gradle/Grails
Apache Buildr
Apache Ivy (an add-on for Apache ant)
Groovy Grape
Scala SBT (for working with Scala on top of Java)
Leiningen (for working with Clojure on top of Java)
Maven isn't required, you could use any of the above tools.
Tip: Maven and Gradle are the best integrated in various IDEs (like Eclipse IDE and IntelliJ)

How to deploy java application on different server?

If i want to deploy one application on different servers like Open Source Glassfish or TomEE. How can I achieve that without having to include different libraries for each application server? As an example if would like to use Jersey as the rest framework and eclipselink as the persistence framework i have to make sure both support these frameworks. But in case of TomEE it's shipped with other implementations like OpenJPA.
Is it possible to ship the dependencies only with the project and not in combination of server libraries + project libraries?
What is a good way to achieve server compatibility?
Any information or link which describes a solution or help me understand why it's done this way would be great.
Thanks in advance
This is more of a application server classloading issue and usually all application servers have a provision for a configuration file which you can put in your application and instruct the server to load the libraries included in the web application instead of the one present in application server. For e.g., Weblogic has a weblogic.xml file which is put in WEB-INF of war application and where you can instruct server to prefer the application packaged libraries. For JBoss there is similar configuration file jboss-deployment-structure.xml. This way it is easier to have a self contained application which contains all dependencies even if the server has equivalent libraries. Also you can upgrade to higher version of libraries than supported by application server otherwise you have to resort to all sort of hacks.
Easy solution I can think of is using ant task to create war file for each servers. You can have at most 2-3 servers in reality like tomcat ee, jboss and glasfish. So create 3 ant tasks for each like tomcatWar, jbossWar and glassfishWar and each ant task makes sure required jars are shipped as well in the war. This is more easy and extendable solution, also easy to understand and modify for new requirements.

Does Sakai have the ability for plugins?

The company I currently work for builds enterprise software for educational facilities. I just finished a plugin for one of their products that integrates it into Moodle. This was simple and quick because all I had to do was create the source code and then bundle it up into a .zip.
Now they are coming to me wanting me to do the same thing for facilities using Sakai. I have realized that Sakai is basically compiled java running on a server.. yet am wondering if it has any plugin based or modification system I can utilize to integrate our product into it?
Also thanks in advance. :)
Sakai has 2 main methods for developing a new plugin (also sometimes called a tool).
LTI (1.0 and 2.0) - Sakai 10 supports the IMS LTI 1 and 2 specifications (it is the first LMS to have support for both). Older versions of Sakai (2.7 or newer) support LTI 1.0. This standard allows development of a tool which runs on it's own server but integrates with the learning system via a launching protocol.
Sakai tool webapp - Any Java webapp can be integrated into Sakai as a tool by adding a meta file (tool.xml), adding some parts to the web.xml, and optionally loading CSS/JS in the header and using Java APIs to access the Sakai kernel. More details about that are available in the Sakai wiki: https://confluence.sakaiproject.org/display/BOOT/Sakai+Programmer+Manual
In addition to the "tool plugins" mentioned by Zach above, Sakai also supports extensions to authentication via the UserDirectoryProvider API. Most of the common authentication methods (password, Shibboleth, LDAP, Active Directory, CAS) are already supported, but custom ones are not that difficult to write as well.

Shared java resources in XPages applications

I try to implement most of the logic in any XPages application in Java. I don’t like the idea of attaching the jars or java code in the NSFs. I want to create repositories of java code that is available in all applications on a given server (maven). I know about the Domino/jvm /lib/ext folder. I also know I can use the JavaUserClassesExt=pathToJava resources in notes.ini
So the question is, are those methods mentioned above the best options to share java resources in an pure XPages environment or should I consider other alternatives?
You might check out this link, it will show you the basics of creating an "extension library"
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/creating_an_xpages_library#Create+the+library+class
that you can use to implement a java jar across the whole server and replicate using the updatesite template to all your domino servers.
The XPages way to create shared resources for all applications for a given server is to code an OSGi plug-in (a.k.a. extension library). This way you can clearly declare the dependencies of your NSFs, it will survive reinstalls upgrades and when you use the updatesite.nsf approach can be shared between servers too.
There's a book detailing how to build one.

Categories

Resources