DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.ndr.util
Class ServiceDescription

java.lang.Object
  extended by org.dlese.dpc.schemedit.ndr.util.ServiceDescription

public class ServiceDescription
extends Object

Class to construct serviceDescription elements to be used in NDR Objects (i.e., MetadataProvider and Aggregator), as described at http://ndr.comm.nsdl.org/cgi-bin/wiki.pl?addMetadataProvider.

Version:
$Id: ServiceDescription.java,v 1.6 2009/08/19 18:25:45 ostwald Exp $
Author:
Jonathan Ostwald

Nested Class Summary
 class ServiceDescription.Image
          Class representing an Image attribute of the serviceDescription.
 
Constructor Summary
ServiceDescription()
          Constructor for the ServiceDescription object
ServiceDescription(Element element)
           
ServiceDescription(String title, String description, String identifier)
          Constructor for the ServiceDescription object, given title, description and type values.
 
Method Summary
 void addContact(Contact contact)
          Adds a contact instance to the serviceDescription.
 void addContact(String name, String email, String info)
          Creates a Contact instance and adds it to the serviceDescription.
 Element asElement()
          Returns serviceDescription as an dom4j.Element.
 List getContacts()
           
static ServiceDescription getFakeServiceDescription()
          Gets the fakeServiceDescription attribute of the ServiceDescription class
 ServiceDescription.Image getImage()
           
static void main(String[] args)
          The main program for the ServiceDescription class
static ServiceDescription makeServiceDescription(DleseCollectionDocReader reader, NDRConstants.NDRObjectType ndrObjType)
          Creates a service description instance based on information provided as DleseCollectionDocReader.
static ServiceDescription makeServiceDescription(NCSCollectReader ncsDocReader, NDRConstants.NDRObjectType ndrObjType)
          Creates a service description instance based on information provided as NCSCollectReader.
 void setDescription(String description)
          Sets the description attribute of the ServiceDescription object
 void setIdentifier(String type)
          Sets the identifier attribute of the ServiceDescription object
 void setImage(ServiceDescription.Image image)
          Sets the image attribute of the ServiceDescription object
 void setImage(String brandUrl, String title, String width, String height, String alttext)
          Creates an image instance and adds it to the ServiceDescription object
 void setTitle(String title)
          Sets the title attribute of the ServiceDescription object
 void setType(String type)
          Sets the type attribute of the ServiceDescription object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceDescription

public ServiceDescription()
Constructor for the ServiceDescription object


ServiceDescription

public ServiceDescription(String title,
                          String description,
                          String identifier)
Constructor for the ServiceDescription object, given title, description and type values.

Parameters:
title - NOT YET DOCUMENTED
description - NOT YET DOCUMENTED
type - NOT YET DOCUMENTED

ServiceDescription

public ServiceDescription(Element element)
Method Detail

addContact

public void addContact(String name,
                       String email,
                       String info)
Creates a Contact instance and adds it to the serviceDescription.

Parameters:
name - contact name
email - contact email
info - contact info

addContact

public void addContact(Contact contact)
Adds a contact instance to the serviceDescription.

Parameters:
contact - The Contact to be added

getContacts

public List getContacts()

setImage

public void setImage(String brandUrl,
                     String title,
                     String width,
                     String height,
                     String alttext)
Creates an image instance and adds it to the ServiceDescription object

Parameters:
brandUrl - image brandUrl
title - image title
width - image width
height - image height
alttext - image alttext

setImage

public void setImage(ServiceDescription.Image image)
Sets the image attribute of the ServiceDescription object

Parameters:
image - The new image value

getImage

public ServiceDescription.Image getImage()

setTitle

public void setTitle(String title)
Sets the title attribute of the ServiceDescription object

Parameters:
title - The new title value

setDescription

public void setDescription(String description)
Sets the description attribute of the ServiceDescription object

Parameters:
description - The new description value

setType

public void setType(String type)
Sets the type attribute of the ServiceDescription object

Parameters:
type - The new type value

setIdentifier

public void setIdentifier(String type)
Sets the identifier attribute of the ServiceDescription object

Parameters:
type - The new identifier value

asElement

public Element asElement()
Returns serviceDescription as an dom4j.Element.

Returns:
NOT YET DOCUMENTED

main

public static void main(String[] args)
                 throws Exception
The main program for the ServiceDescription class

Parameters:
args - The command line arguments
Throws:
Exception - NOT YET DOCUMENTED

makeServiceDescription

public static ServiceDescription makeServiceDescription(NCSCollectReader ncsDocReader,
                                                        NDRConstants.NDRObjectType ndrObjType)
Creates a service description instance based on information provided as NCSCollectReader.

Parameters:
ncsDocReader - reader for a ncs_collect record.
Returns:
serviceDescription instance

makeServiceDescription

public static ServiceDescription makeServiceDescription(DleseCollectionDocReader reader,
                                                        NDRConstants.NDRObjectType ndrObjType)
Creates a service description instance based on information provided as DleseCollectionDocReader.

Parameters:
reader - reader representing a dlese_collect record
Returns:
serviceDescription instance

getFakeServiceDescription

public static ServiceDescription getFakeServiceDescription()
Gets the fakeServiceDescription attribute of the ServiceDescription class

Returns:
The fakeServiceDescription value

DLESE Tools
v1.6.0