oilsEvent* oilsNewEvent( char* event ) {
if(!event) return NULL;
+ osrfLogInfo(OSRF_LOG_MARK, "Creating new event: %s", event);
if(!__oilsEventEvents) _oilsEventParseEvents();
oilsEvent* evt = (oilsEvent*) safe_malloc(sizeof(oilsEvent));
evt->event = strdup(event);
if( code && textcode ) {
osrfHashSet( __oilsEventEvents, code, textcode );
success = 1;
- osrfLogDebug(OSRF_LOG_MARK, "Loading OILS Event: %s => %s",
- textcode, osrfHashGet( __oilsEventEvents, textcode) );
}
}
child = child->next;
}
+jsonObject* oilsUtilsFetchWorkstation( long id ) {
+ jsonObject* p = jsonParseString("[%ld]", id);
+ jsonObject* r = oilsUtilsQuickReq(
+ "open-ils.storage",
+ "open-ils.storage.direct.actor.workstation.retrieve", p );
+ jsonObjectFree(p);
+ return r;
+}
+
+
*/
char* oilsUtilsLogin( char* uname, char* passwd, char* type, int orgId );
+
+/**
+ * Fetches the requested workstation object by id
+ */
+jsonObject* oilsUtilsFetchWorkstation( long id );
+
<desc> Requested transaction object does not exist </desc>
</event>
+ <event code='1520' textcode='WORKSTATION_NOT_FOUND'>
+ <desc> Requested workstation object does not exist </desc>
+ </event>
+
<desc> There is an open circulation on the requested item </desc>
</event>
+ <event code='1702' textcode='WORKSTATION_NAME_EXISTS'>
+ <desc> A workstation with that name already exists </desc>
+ </event>
+
<event code='2000' textcode='BAD_PARAMS'>
<desc>
+__PACKAGE__->register_method (
+ method => 'register_workstation',
+ api_name => 'open-ils.actor.workstation.register',
+ signature => q/
+ Registers a new workstion in the system
+ @param authtoken The login session key
+ @param name The name of the workstation id
+ @param owner The org unit that owns this workstation
+ @return The workstation on success, WORKSTATION_NAME_EXISTS
+ if the name is already in use.
+ /);
+
+sub register_workstation {
+ my( $self, $connection, $authtoken, $name, $owner ) = @_;
+ my( $requestor, $evt ) = $U->checkses($authtoken);
+ return $evt if $evt;
+ $evt = $U->check_perms($requestor->id, $owner, 'REGISTER_WORKSTATION');
+ return $evt if $evt;
+
+ my $ws = $U->storagereq(
+ 'open-ils.storage.direct.actor.workstation.search.name', $name );
+ return OpenILS::Event->new('WORKSTATION_NAME_EXISTS') if $ws;
+
+ $ws = Fieldmapper::actor::workstation->new;
+ $ws->owning_lib($owner);
+ $ws->name($name);
+
+ my $id = $U->storagereq(
+ 'open-ils.storage.direct.actor.workstation.create', $ws );
+ return $U->DB_UPDATE_FAILED($ws) unless $id;
+
+ $ws->id($id);
+ return $ws;
+}
+
1;
char* password = words[2];
char* type = words[3];
char* orgloc = words[4];
- int orgloci = 0;
- if(orgloc) orgloci = atoi(orgloc);
+ char* wsid = words[5];
+ int orgloci = (orgloc) ? atoi(orgloc) : 0;
+ int wsidi = (wsid) ? atoi(wsid) : 0;
if(!type) type = "opac";
char buf[256];
char* mess_buf = md5sum(both_buf);
sprintf( buf2, "request open-ils.auth open-ils.auth.authenticate.complete "
- "\"%s\", \"%s\", \"%s\", %d", username, mess_buf, type, orgloci );
+ "\"%s\", \"%s\", \"%s\", %d, %d", username, mess_buf, type, orgloci, wsidi );
free(pass_buf);
free(mess_buf);