TNS Internal:NDR/Usage

From NSDLWiki

Jump to: navigation, search

Contents

[hide]

NDR Usage

JAR Files

JAR File Purpose
  • ncore_client-1.0.jar
contains client specific classes (XML based drivers)
  • repository-1.3.jar
contains interface definitions
  • xerces, etc.
other required dependencies
  • ncore_client_static-1.0.jar
contains all required jars to fulfill dependencies (created by jarjar tool which is an extension of ant)
  • ncore-client-admin-1.0.jar
executable jar that include ncore_client_static-1.0.jar and its executable


Including JAR Files in a Project

There are several options for including NDR related JAR files.

Adding All Dependencies by Hand

Include all the following jars in your project...

  • ncore_client-1.0.jar - contains client specific classes (XML based drivers)
  • repository-1.3.jar - contains interface definitions
  • xerces, etc. -- other required dependencies (Complete list TBA)


Include All Dependencies Using a Single Jar

Include a single jar that includes all dependencies for you...

  • ncore_client_static-1.0.jar - contains all required jars to fulfill dependencies (created by jarjar tool which is an extension of ant)
  • makes it ok that there may be different versions of some jars between what is required for NDR and what is required for the project

NOTE: jarjar allows for renaming of contents of a jar file to have a different path which avoids conflicts with projects that may include the generated jar file that use a different version of included jars. ncore_client_static-1.0.jar is created by jarjar.



Where is code that is going into JARs?

  • /repository
    • code of the interfaces and produces the jar of interfaces
    • code of implementation to Fedora
  • /toolkit
    • pull in jar of interfaces (repository-1.3.jar)
    • code of implementation of java toolkit



/toolkit

  • org.nsdl.repository.admin.tasks/*
    • cmd line app for making changes to NDR object
  • org.nsdl.repository.client/*
    • classes implementing NDR Rest API


Accessing NDR Rest API

http://ndrtest.nsdl.org/api/get/handle
http://ndr.nsdl.org/api/get/handle
http://ndr.nsdl.org/api/get/2200/20091229081004884T
Personal tools