Skip to content

tsugicontrib/tsugi-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tsugi for Java - Library Code

Apereo Incubating badge

Deprecated: As of November 2018, this effort is deprecated. We are in the process of developing a new technology / apprach that will allow Tsugi tools to be built in a wide range of environments connected to the core of Tsugi using web services wather than through the database as is done in this approach.

This is a Java version of the PHP Tsugi API (https://github.com/tsugiproject/tsugi-php). This repository is the API and base JDBC implementation. I have recorded a simple Video Introduction to Java Tsugi.

Pre-Requisites

You should install Tsugi PHP and set it up:

https://github.com/tsugiproject/tsugi

This sets up all the database tables.

API Documentation

http://tsugiproject.github.io/tsugi-java/apidocs/index.html

Using from pom.xml

This artifact is in Sonatype, add these entries your pom.xml as follows:

<dependency>
    <groupId>org.tsugi</groupId>
    <artifactId>tsugi-java</artifactId>
    <version>0.2-SNAPSHOT</version>
</dependency>

<dependency>
   <groupId>org.tsugi</groupId>
   <artifactId>tsugi-util</artifactId>
   <version>0.2-SNAPSHOT</version>
</dependency>

In order to get the snapshot versions add this to your pom.xml:

<repositories>
   <repository>
     <id>ossrh</id>
     <name>Sonatype</name>
     <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
     <layout>default</layout>
     <snapshots>
       <enabled>true</enabled>
     </snapshots>
   </repository>
 </repositories>

Or you can put this in your~/.m2/settings.xml:

<settings>
  ..
  <profiles>
    <profile>
       <id>allow-snapshots</id>
          <activation><activeByDefault>true</activeByDefault></activation>
       <repositories>
         <repository>
           <id>snapshots-repo</id>
           <url>https://oss.sonatype.org/content/repositories/snapshots</url>
           <releases><enabled>false</enabled></releases>
           <snapshots><enabled>true</enabled></snapshots>
         </repository>
       </repositories>
     </profile>
  </profiles>
</settings>    

Database Setup

This is expecting that PHP Tsugi already is installed running and its database is created and available on localhost:8889 using the default account, password, and database name and that the tables already exist. If you want to change this, edit the file

src/main/resources/tsugi.properties

The Sample Servlet

Once you have tsugi-java checked out and passing the unit tests, it is time to play with the sample servlet at:

https://github.com/tsugiproject/tsugi-java-servlet

And follow the instructions in its README.md - not that there is some overlap because it tells you to first install and configure this repository (java-tsugi).

https://github.com/tsugiproject/tsugi-java-servlet/blob/master/README.md

Building from Source

To produce a jar file and drops it into your maven repository.

mvn clean install

The unit tests actually want a live database. To install without unit tests, use

mvn -DskipTests clean install

Generating Tsugi API JavaDocs

Make sure you are in master:

git checkout master
git status (there should be no pending changes)

mvn javadoc:javadoc

Make sure you are happy by looking at:

open target/site/apidocs/index.html

When you are happy:

tar cfv apidocs.tar apidocs
git checkout gh-pages
tar xfv apidocs.tar
rm apidocs.tar

git commit -a
git push
git checkout master

A sweet one-line version of the four steps is:

tar cfv apidocs.tar apidocs; git checkout gh-pages; tar xfv apidocs.tar; rm apidocs.tar

For those of us who like to say things like "!tar" in the command line when doing the same things more than one time. :)

Other Source Code

A Sample servlet using this code

https://github.com/tsugiproject/tsugi-java-servlet

Tsugi low-level API library this depends on (formerly sakai-basicltiutil)

https://github.com/tsugiproject/tsugi-util

Releasing to SonaType

To sign the artifacts, install the GPG tools:

https://gpgtools.org/

Locations:

https://oss.sonatype.org/#nexus-search;quick~tsugi-util
https://oss.sonatype.org/#nexus-search;quick~tsugi-java

Make sure ~/.m2/settings.xml looks like this:

<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>drchuck</username>
      <password>your-sonatype-password</password>
    </server>
  </servers>
<profiles>
  <profile>
     <id>allow-snapshots</id>
        <activation><activeByDefault>true</activeByDefault></activation>
     <repositories>
       <repository>
         <id>snapshots-repo</id>
         <url>https://oss.sonatype.org/content/repositories/snapshots</url>
         <releases><enabled>false</enabled></releases>
         <snapshots><enabled>true</enabled></snapshots>
       </repository>
     </repositories>
   </profile>
</profiles>
</settings>    

Deploy:

mvn -DperformRelease=true clean javadoc:jar install deploy -Dgpg.passphrase=Whatever
mvn clean # afterwards

Documentation:

http://central.sonatype.org/pages/apache-maven.html

About

The Java Version of Tsugi API and Default Implementation (deprecated)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages