|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.evdb.javaapi.operations.BaseOperations
com.evdb.javaapi.operations.EventOperations
public class EventOperations
Class encapsulating event operations
Sample code for dealing with events:
//Create our operation objects
EventOperations eo = new EventOperations();
Event e = eo.get("E0-123-1234-00");
e.setTitle("New Event Title ");
eo.modify(e);
e = eo.get("E0-123-1234-00");
assertEquals(e.getTitle(), "New Event Title ");
| Field Summary |
|---|
| Fields inherited from class com.evdb.javaapi.operations.BaseOperations |
|---|
serverCommunication |
| Constructor Summary | |
|---|---|
EventOperations()
|
|
| Method Summary | |
|---|---|
void |
addCategory(java.lang.String seid,
Category category)
Add a category to an event |
void |
addComment(java.lang.String seid,
Comment comment)
Add a comment to an event |
void |
addImage(java.lang.String seid,
Image image)
Add an image to the given event |
void |
addLink(java.lang.String seid,
Link link)
Add a link to an event |
void |
addPerformer(java.lang.String seid,
Performer performer)
Add a performer |
int |
addProperty(java.lang.String seid,
Property property)
Add a property |
void |
addTags(java.lang.String seid,
java.util.List<Tag> tagList)
Add tags to an event |
Event |
create(Event e)
Creates a new event. |
void |
deleteCategory(java.lang.String seid,
Category category)
Remove a category from an event |
void |
deleteComment(Comment comment)
Delete a comment |
void |
deleteImage(java.lang.String seid,
Image image)
Remove the image |
void |
deleteLink(Link link)
Remove a link from an event |
void |
deletePerformer(java.lang.String seid,
Performer performer)
Remove a performer |
void |
deleteProperty(java.lang.String seid,
Property property)
Delete a property |
void |
deleteTags(java.lang.String seid,
java.util.List<Tag> tagList)
Add tags to an event |
Event |
get(Event e)
Fills in the data for an event given an event object |
Event |
get(java.lang.String seid)
Get an event from the EVDB website |
java.util.List<Property> |
getProperties(java.lang.String seid)
Return a list of properties |
java.util.List<Tag> |
getTags(java.lang.String seid)
List the tags for a given SEID |
Event |
modify(Event e)
Modifies an existing event |
void |
modifyComment(Comment comment)
Modify a comment |
void |
restore(java.lang.String seid)
Restores (un-withdraws) an event |
SearchResult |
search(EventSearchRequest searchRequest)
Event search request |
void |
withdraw(java.lang.String seid,
java.lang.String withdrawNote)
Withdraws an event |
| Methods inherited from class com.evdb.javaapi.operations.BaseOperations |
|---|
addComment, addImage, addLink, addProperty, deleteComment, deleteImage, deleteLink, deleteProperty, getUnmarshaller, listProperties, listTags, modifyComment, modifyTags, unmarshallRequest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventOperations()
| Method Detail |
|---|
public Event get(java.lang.String seid)
throws EVDBRuntimeException,
EVDBAPIException
seid - SEID to lookup
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public SearchResult search(EventSearchRequest searchRequest)
throws EVDBRuntimeException,
EVDBAPIException
EventOperations eo = new EventOperations();
//create the search request for music events in San Diego
EventSearchRequest esr = new EventSearchRequest();
esr.setKeywords("music");
esr.setLocation("San Diego");
SearchResult sr = eo.search(esr);
assert(sr.getTotalItems() > 1);
//here is our list of results
List events = sr.getEvents();
searchRequest -
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public Event get(Event e)
throws EVDBRuntimeException,
EVDBAPIException
e - Event to lookup, must have an SEID
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public Event create(Event e)
throws EVDBRuntimeException,
EVDBAPIException
EventOperations eo = new EventOperations();
//set our start date
Calendar calStart = Calendar.getInstance();
calStart.set(2007, 11, 22, 15, 15);
Event e = new Event();
e.setTitle("API test event");
e.setDescription("An API Test Event");
e.setFree(true);
e.setStartTime(calStart.getTime());;
List tagList = new ArrayList();
//add some tags
tagList.add(new Tag("ttest9"));
tagList.add(new Tag("music"));
e.setTags(tagList);
//create the event
Event newEvent = eo.create(e);
assertNotNull(newEvent.getSeid());
e - The new event object
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public java.util.List<Tag> getTags(java.lang.String seid)
throws EVDBRuntimeException,
EVDBAPIException
seid -
EVDBRuntimeException
EVDBAPIException
public java.util.List<Property> getProperties(java.lang.String seid)
throws EVDBRuntimeException,
EVDBAPIException
seid -
EVDBRuntimeException
EVDBAPIException
public void addTags(java.lang.String seid,
java.util.List<Tag> tagList)
throws EVDBRuntimeException,
EVDBAPIException
seid - Event SEIDtagList - The list of tags to add
EVDBRuntimeException
EVDBAPIException
public void deleteTags(java.lang.String seid,
java.util.List<Tag> tagList)
throws EVDBRuntimeException,
EVDBAPIException
seid - Event SEIDtagList - The list of tags to add
EVDBRuntimeException
EVDBAPIException
public void addComment(java.lang.String seid,
Comment comment)
throws EVDBRuntimeException,
EVDBAPIException
seid - comment -
EVDBRuntimeException
EVDBAPIException
public void modifyComment(Comment comment)
throws EVDBRuntimeException,
EVDBAPIException
comment -
EVDBRuntimeException
EVDBAPIException
public void addImage(java.lang.String seid,
Image image)
throws EVDBRuntimeException,
EVDBAPIException
seid - image -
EVDBRuntimeException
EVDBAPIException
public void deleteImage(java.lang.String seid,
Image image)
throws EVDBRuntimeException,
EVDBAPIException
seid - image -
EVDBRuntimeException
EVDBAPIException
public void deleteProperty(java.lang.String seid,
Property property)
throws EVDBRuntimeException,
EVDBAPIException
seid - property -
EVDBRuntimeException
EVDBAPIException
public int addProperty(java.lang.String seid,
Property property)
throws EVDBRuntimeException,
EVDBAPIException
seid - property -
EVDBRuntimeException
EVDBAPIException
public void addPerformer(java.lang.String seid,
Performer performer)
throws EVDBRuntimeException,
EVDBAPIException
seid - performer -
EVDBRuntimeException
EVDBAPIException
public void deletePerformer(java.lang.String seid,
Performer performer)
throws EVDBRuntimeException,
EVDBAPIException
seid - performer -
EVDBRuntimeException
EVDBAPIException
public void addCategory(java.lang.String seid,
Category category)
throws EVDBRuntimeException,
EVDBAPIException
seid - category -
EVDBRuntimeException
EVDBAPIException
public void deleteCategory(java.lang.String seid,
Category category)
throws EVDBRuntimeException,
EVDBAPIException
seid - category -
EVDBRuntimeException
EVDBAPIException
public void deleteComment(Comment comment)
throws EVDBRuntimeException,
EVDBAPIException
comment -
EVDBRuntimeException
EVDBAPIException
public Event modify(Event e)
throws EVDBRuntimeException,
EVDBAPIException
e - The event object
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public void addLink(java.lang.String seid,
Link link)
throws EVDBRuntimeException,
EVDBAPIException
seid - SEID to addlink - Link object
EVDBRuntimeException
EVDBAPIException
public void deleteLink(Link link)
throws EVDBRuntimeException,
EVDBAPIException
link - Link object to remove
EVDBRuntimeException
EVDBAPIException
public void withdraw(java.lang.String seid,
java.lang.String withdrawNote)
throws EVDBRuntimeException,
EVDBAPIException
seid - SEID of the event to withdrawwithdrawNote - Note explaining the withdraw
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public void restore(java.lang.String seid)
throws EVDBRuntimeException,
EVDBAPIException
seid - SEID of the event to restore
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||