ARSperl

 view release on metacpan or  search on metacpan

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	SV * in
	CODE:
	{
	  ARQualifierStruct *qual;
	  HV *h_dummy;
	  HV *h;
	  int rv = 0;	  

	  AMALLOCNN(qual, 1, ARQualifierStruct);
	  (void) ARError_reset();

	  if( SvTYPE(SvRV(in)) != SVt_PVHV ){
		  ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARQualifierStruct: not a hash value" );
		  RETVAL = NULL;
		  goto ars_qualifier_ptr_end;
	  }
	  h = (HV* ) SvRV((SV*) in);
	  if( ! SvTRUE(hv_scalar(h)) ){
		  RETVAL = qual;
		  goto ars_qualifier_ptr_end;

ARS.xs  view on Meta::CPAN

	char *			schema
	char *			qualstring
	char *			displayTag
	CODE:
	{
		int                ret = 0;
		ARStatusList       status;
		ARQualifierStruct *qual;
		AMALLOCNN(qual, 1, ARQualifierStruct);
		Zero(&status, 1, ARStatusList);
		(void) ARError_reset();
		ret = ARLoadARQualifierStruct(ctrl, schema, displayTag, qualstring, qual, &status);
#ifdef PROFILE
		((ars_ctrl *)ctrl)->queries++;
#endif
		if (! ARError( ret, status)) {
			RETVAL = qual;
		} else {
			RETVAL = NULL;
			FreeARQualifierStruct(qual, TRUE);
		}

ARS.xs  view on Meta::CPAN

void
__ars_Termination()
	CODE:
	{
#if AR_EXPORT_VERSION <= 3
	  int          ret;
#endif
	  ARStatusList status;
	  
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_reset();
#if AR_EXPORT_VERSION <= 3
	  ret = ARTermination(&status);
	  if (ARError( ret, status)) {
	    warn("failed in ARTermination\n");
	  }
#else
	  (void) ARError_add(AR_RETURN_ERROR, AP_ERR_DEPRECATED, "__ars_Termination() is only available when compiled against ARS <= 3.2");
#endif
	}

void
__ars_init()
	CODE:
	{
#if AR_EXPORT_VERSION <= 3
	  int          ret;
#endif
	  ARStatusList status;
	
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_reset();
#if AR_EXPORT_VERSION <= 3
	  ret = ARInitialization(&status);
	  if (ARError( ret, status)) {
	    croak("unable to initialize ARS module");
	  }
#else
	  (void) ARError_add(AR_RETURN_ERROR, AP_ERR_DEPRECATED, "__ars_init() is only available when compiled against ARS <= 3.2");
#endif
	}

ARS.xs  view on Meta::CPAN

	char *			name
	int			port
	int			progNum
	CODE:
	{
		int 		ret = 0;
		ARStatusList	status;

		RETVAL = 0;
		Zero(&status, 1, ARStatusList);
		(void) ARError_reset();
#if AR_EXPORT_VERSION >= 4
		ret = ARSetServerPort(ctrl, name, port, progNum, &status);
		if (! ARError(ret, status)) {
			RETVAL = 1;
		}
#else
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, 
		"ars_SetServerPort() is only available in ARS >= 4.x");
#endif
	}

ARS.xs  view on Meta::CPAN

			SAFEPRT(password),
			SAFEPRT(lang),
			SAFEPRT(authString),
			tcpport,
			rpcnumber) 
		    );

		RETVAL = NULL;
		Zero(&status, 1, ARStatusList);
		Zero(&serverList, 1, ARServerNameList);
		(void) ARError_reset();  
#ifdef PROFILE
	  /* XXX
	     This is something of a hack... a safemalloc will always
	     complain about differing structures.  However, it's 
	     pretty deep into the code.  Perhaps a static would be cleaner?
	  */
		ctrl = (ARControlStruct *)MALLOCNN(sizeof(ars_ctrl));
		Zero(ctrl, 1, ars_ctrl);
		((ars_ctrl *)ctrl)->queries = 0;
		((ars_ctrl *)ctrl)->startTime = 0;

ARS.xs  view on Meta::CPAN

				goto ar_login_end;
	    		}
	    		server = serverList.nameList[0];
			DBG( ("changing s_ok to 0, picked server %s\n",
				SAFEPRT(server)) );
	    		s_ok = 0;
	  	}
	  	strncpy(ctrl->server, server, sizeof(ctrl->server));
	 	ctrl->server[sizeof(ctrl->server)-1] = 0;

		/* set the tcp/rpc port if given */

		ret = ARSetServerPort(ctrl, ctrl->server, tcpport, rpcnumber,
					&status);
		if (ARError(ret, status)) {
			DBG( ("ARSetServerPort failed %d\n", ret) );
			ARTermination(ctrl, &status);
			ARError(ret, status);
#ifdef PROFILE
			AP_FREE(ctrl);
#else

ARS.xs  view on Meta::CPAN

ars_VerifyUser(ctrl)
	ARControlStruct *	ctrl
	CODE:
	{
		int ret = 0;
		ARBoolean	adminFlag  = 0,
				subAdminFlag = 0,
				customFlag   = 0; 
		ARStatusList status;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);

		ret = ARVerifyUser( ctrl, &adminFlag, &subAdminFlag, &customFlag, &status );

		/* printf( "ret = %d, adminFlag = %d, subAdminFlag = %d, customFlag = %d\n",
			ret, adminFlag, subAdminFlag, customFlag ); */

		if(! ARError(ret, status)) {
		    RETVAL = newHV();
		    sv_2mortal( (SV*) RETVAL );

ARS.xs  view on Meta::CPAN

		}
	}
	OUTPUT:
	RETVAL

void
ars_GetControlStructFields(ctrl)
	ARControlStruct *	ctrl
	PPCODE:
	{
	   (void) ARError_reset();
	   if(!ctrl) return;
	   XPUSHs(sv_2mortal(newSViv(ctrl->cacheId)));
	   XPUSHs(sv_2mortal(newSViv(ctrl->operationTime)));
	   XPUSHs(sv_2mortal(newSVpv(ctrl->user, 0)));
	   XPUSHs(sv_2mortal(newSVpv(ctrl->password, 0)));
#ifndef AR_MAX_LOCALE_SIZE
	   XPUSHs(sv_2mortal(newSVpv(ctrl->language, 0)));
#else
	   XPUSHs(sv_2mortal(newSVpv(ctrl->localeInfo.locale, 0)));
#endif

ARS.xs  view on Meta::CPAN

	   XPUSHs(sv_2mortal(newSVpv(ctrl->authString, 0)));
#endif
	}

SV *
ars_GetCurrentServer(ctrl)
	ARControlStruct *	ctrl
	CODE:
	{
	  RETVAL = NULL;
	  (void) ARError_reset();
	  if(ctrl && ctrl->server) {
	    RETVAL = newSVpv( ctrl->server, strlen(ctrl->server) );
	  } 
	}
	OUTPUT:
	RETVAL

HV *
ars_GetProfileInfo(ctrl)
	ARControlStruct *	ctrl
	CODE:
	{
	  RETVAL = newHV();
	  sv_2mortal( (SV*) RETVAL );
	  (void) ARError_reset();
#ifdef PROFILE
	  hv_store(RETVAL,  "queries", strlen("queries") , 
	  	   newSViv(((ars_ctrl *)ctrl)->queries), 0);
	  hv_store(RETVAL,  "startTime", strlen("startTime") , 
		   newSViv(((ars_ctrl *)ctrl)->startTime), 0);
#else /* profiling not compiled in */
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_OPT_NA, 
			     "Optional profiling code not compiled into this build of ARSperl");
#endif
	}

ARS.xs  view on Meta::CPAN

	RETVAL

void
ars_Logoff(ctrl)
	ARControlStruct *	ctrl
	CODE:
	{
		int          ret = 0;
		ARStatusList status;
		Zero(&status, 1, ARStatusList);
		(void) ARError_reset();
		if (!ctrl) return;
#if AR_EXPORT_VERSION >= 4
		ret = ARTermination(ctrl, &status);
#else
		ret = ARTermination(&status);
#endif
		(void) ARError( ret, status);
		/*AP_FREE(ctrl); let DESTROY free it*/
	}

ARS.xs  view on Meta::CPAN

	ARControlStruct *	control
	char *			schema
	unsigned long		changedsince
	unsigned long		fieldType
	PPCODE:
	{
	  ARInternalIdList idlist;
	  ARStatusList     status;
	  int              ret = 0;
	  unsigned int     i = 0;
	  (void) ARError_reset();
	  Zero(&idlist, 1, ARInternalIdList);
	  Zero(&status, 1, ARStatusList);
#if AR_EXPORT_VERSION >= 3
	  ret = ARGetListField(control,schema,
	  			fieldType,
	  			changedsince,
#if AR_CURRENT_API_VERSION >= 17
				NULL,   /* &objPropList (undocumented by BMC) */
#endif
	  			&idlist,

ARS.xs  view on Meta::CPAN

	ARControlStruct *	control
	char *			schema
	char *			field_name
	PPCODE:
	{
	  int              ret = 0;
	  unsigned int     loop = 0;
	  ARInternalIdList idList;
	  ARStatusList     status;
	  ARNameType       fieldName;
	  (void) ARError_reset();
	  Zero(&idList, 1, ARInternalIdList);
	  Zero(&status, 1, ARStatusList);
	  ret = ARGetListField(control, schema,
	  			AR_FIELD_TYPE_ALL, 
	  			(ARTimestamp)0,
#if AR_CURRENT_API_VERSION >= 17
				NULL,   /* &objPropList (undocumented by BMC) */
#endif
	  			&idList,
	  			&status);

ARS.xs  view on Meta::CPAN

	char *			schema
	PPCODE:
	{
	  int              ret = 0;
	  unsigned int     loop = 0;
	  HV   *fields, *h;
	  char *hkey;
	  SV   *hval, **hvalName;
	  I32  klen;

	  (void) ARError_reset();

	  fields = fieldcache_get_schema_fields( ctrl, schema, TRUE );
	  if( ! fields ){
		goto get_fieldtable_end;
	  }

	  hv_iterinit( fields );
	  while( (hval = hv_iternextsv(fields,&hkey,&klen)) ){
		if( strcmp(hkey,"0") == 0 )  continue;
		h = (HV* ) SvRV(hval);

ARS.xs  view on Meta::CPAN

			    c = (items - 2) / 2;
	  AREntryIdType     entryId;
	  ARFieldValueList  fieldList;
	  ARInternalIdList  getFieldIds; 
	  ARStatusList      status;
	  int               ret = 0, rv = 0;
	  unsigned int      dataType = 0, j = 0;
	  HV               *cacheFields;
	  
	  RETVAL=NULL;
	  (void) ARError_reset();
	  Zero(&entryId, 1, AREntryIdType);
	  Zero(&fieldList, 1, ARFieldValueList);
	  Zero(&getFieldIds, 1, ARInternalIdList);
	  Zero(&status, 1, ARStatusList);
	  if (((items - 2) % 2) || c < 1) {
	    (void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	  } else {

	    cacheFields = fieldcache_get_schema_fields( ctrl, schema, FALSE );
	    if( ! cacheFields ){

ARS.xs  view on Meta::CPAN

	char *			schema
	char *			entry_id
	CODE:
	{
	  int            ret = 0;
	  ARStatusList   status;
#if AR_EXPORT_VERSION >= 3
	  AREntryIdList  entryList;

	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  if(perl_BuildEntryList(ctrl, &entryList, entry_id) != 0)
		goto delete_fail;
	  ret = ARDeleteEntry(ctrl, schema, &entryList, 0, &status);
	  if (entryList.entryIdList) AP_FREE(entryList.entryIdList);
#else /* ARS 2 */
	  RETVAL = 0; /* assume error */
	  if(!entry_id || !*entry_id) {
		ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_EID);
		goto delete_fail;

ARS.xs  view on Meta::CPAN

	char *			locFile
	PPCODE:
	{
		ARStatusList    status;
		AREntryIdList   entryList;
#if AR_EXPORT_VERSION >= 4
		ARLocStruct     loc;
#endif
		int		ret = 0;

		(void) ARError_reset();
		Zero(&entryList, 1, AREntryIdList);
		Zero(&status, 1, ARStatusList);
#if AR_EXPORT_VERSION >= 4
		/* build entryList */
	 	ret = perl_BuildEntryList(ctrl, &entryList, entry_id);
		if(ret)
			goto get_entryblob_end;
		switch(locType) {
		case AR_LOC_FILENAME:
			if(locFile == NULL) {

ARS.xs  view on Meta::CPAN

	{
	  int               ret = 0;
	  unsigned int      c = items - 3, i;
	  ARInternalIdList  idList;
	  ARFieldValueList  fieldList;
	  ARStatusList      status;
#if AR_EXPORT_VERSION >= 3
	  AREntryIdList     entryList;
#endif

	  (void) ARError_reset();
	  Zero(&idList, 1, ARInternalIdList);
	  Zero(&fieldList, 1, ARFieldValueList);
	  Zero(&status, 1, ARStatusList);
	  if (c < 1) {
	    idList.numItems = 0; /* get all fields */
	  } else {
	    idList.numItems = c;
	    idList.internalIdList = MALLOCNN(sizeof(ARInternalId) * c);
	    if (!idList.internalIdList)
	      goto get_entry_end;

ARS.xs  view on Meta::CPAN

	  int              field_off    = 5;
	  int              staticParams = field_off;
	  ARSortList       sortList;
	  AREntryListList  entryList;
	  ARStatusList     status;
	  int              ret = 0;
#if AR_EXPORT_VERSION >= 3
	  AREntryListFieldList getListFields, *getList = NULL;
	  AV              *getListFields_array;
	
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  Zero(&entryList, 1, AREntryListList);
	  Zero(&sortList, 1, ARSortList);

	  if ((items - staticParams) % 2) {
		/* odd number of arguments, so argument after maxRetrieve is
		optional getListFields (an array of hash refs) */
	
		if (SvROK(ST(field_off)) &&
			(getListFields_array = (AV *)SvRV(ST(field_off))) &&
			SvTYPE(getListFields_array) == SVt_PVAV) {
	
			getList                = &getListFields;
			getListFields.numItems = av_len(getListFields_array) + 1;
			AMALLOCNN(getListFields.fieldsList, getListFields.numItems,
				AREntryListFieldStruct);
	
			/* set query field list */
			for (i = 0 ; i < getListFields.numItems ; i++) {
				SV **array_entry, **hash_entry;
				HV *field_hash;
	
				/* get hash from array */
				if ((array_entry = av_fetch(getListFields_array, i, 0)) &&
					SvROK(*array_entry) &&
					SvTYPE(field_hash = (HV*)SvRV(*array_entry)) == SVt_PVHV) {
	
					/* get fieldId, columnWidth and separator from hash */

ARS.xs  view on Meta::CPAN

	
					strncpy(getListFields.fieldsList[i].separator,
						SvPV(*hash_entry, PL_na),
						sizeof(getListFields.fieldsList[i].separator));
				}
			}
		} else {
			(void) ARError_add( AR_RETURN_ERROR, AP_ERR_LFLDS_TYPE);
			goto getlistentry_end;
		}
		/* increase the offset of the first sortList field by one */
		field_off ++;
	  }
#else  /* ARS 2 */
	  Zero(&status, 1,ARStatusList);
	  (void) ARError_reset();
	  if ((items - staticParms) % 2) {
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
		goto getlistentry_end;
	  }
#endif /* if ARS >= 3 */
	
	  /* build sortList */
	  Zero(&sortList, 1, ARSortList);
	  if (c) {
	  	sortList.numItems = c;

ARS.xs  view on Meta::CPAN

	  ARPropList propList;
#endif
#if AR_EXPORT_VERSION >= 6
	  ARInternalIdList idList;

	  Zero(&idList, 1, ARInternalIdList);	  
#endif
#if AR_EXPORT_VERSION >= 8L
	  Zero(&propList, 1, ARPropList);
#endif
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
#if AR_EXPORT_VERSION >= 6
	  if (fieldIdList && (SvTYPE(fieldIdList) == SVt_PVAV)) {
		idList.numItems = av_len(fieldIdList) + 1;
		AMALLOCNN(idList.internalIdList, idList.numItems, ARInternalId);
		for (i = 0 ; i < idList.numItems ; i++ ) {
			SV **array_entry;
			if ((array_entry = av_fetch(fieldIdList, i, 0)) &&
			    SvROK(*array_entry)                         &&
		 	    (SvTYPE(*array_entry) == SVt_PVIV) ) {

ARS.xs  view on Meta::CPAN

void
ars_GetListContainer(ctrl,changedSince=0,attributes=0,...)
	ARControlStruct *	ctrl
	ARTimestamp		changedSince
	unsigned int		attributes
	PPCODE:
	{
	  ARStatusList 		status;
	  int          		i, ret, rv = 0;

	  (void) ARError_reset();	  
	  Zero(&status, 1, ARStatusList);

	  if(items < 1 || items > 200){  /* don't overflow clist[] */
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	  }else{
	  	ARContainerTypeList	containerTypes;
		int			count;
		int clist[256];
		ARContainerOwnerObjList ownerObjList;
# if AR_EXPORT_VERSION >= 8L

ARS.xs  view on Meta::CPAN

	  char                   *helpText = CPNULL;
	  ARAccessNameType        owner;
	  ARTimestamp             timestamp;
	  ARAccessNameType        lastChanged;
	  char                   *changeDiary = CPNULL;
	  ARPropList              objPropList;
	  int            tlist[] = {ARREF_ALL};
	  /* int                     i; */
	  ARDiaryList             diaryList;

	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  Zero(&refTypes, 1, ARReferenceTypeList);
	  Zero(&assignedGroupList, 1, ARPermissionList);
	  Zero(&groupList, 1, ARPermissionList);
	  Zero(&adminGroupList, 1, ARInternalIdList);
	  Zero(&ownerObjList, 1, ARContainerOwnerObjList);
	  Zero(&references, 1, ARReferenceList);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(&objPropList, 1, ARPropList);

ARS.xs  view on Meta::CPAN

void
ars_GetListServer()
	PPCODE:
	{
	  ARServerNameList serverList;
	  ARStatusList     status;
	  int              ret = 0;
          unsigned int     i = 0;
	  ARControlStruct  ctrl;

	  (void) ARError_reset();  
	  Zero(&serverList, 1, ARServerNameList);
	  Zero(&status, 1, ARStatusList);
	  Zero(&ctrl, 1, ARControlStruct);
#if AR_EXPORT_VERSION >= 4
	  /* this function can be called without a control struct 
	   * (or even before a control struct is available).
	   * we will create a bogus control struct, initialize it
	   * and execute the function. this seems to work fine.
	   */
	  ARInitialization(&ctrl, &status);

ARS.xs  view on Meta::CPAN

	  ARAccessNameType    owner;
	  ARAccessNameType    lastChanged;
	  char            *changeDiary = CPNULL;
	  ARStatusList     status;
	  SV              *ref;
	  ARQualifierStruct *query;
	  ARDiaryList      diaryList;

	  AMALLOCNN(query,1,ARQualifierStruct);

	  (void) ARError_reset();
	  Zero(&assignedGroupList, 1, ARInternalIdList);
	  Zero(&groupList, 1, ARInternalIdList);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(lastChanged, 1, ARAccessNameType);
	  Zero(&diaryList, 1, ARDiaryList);
	  Zero(&status, 1, ARStatusList);
	  Zero(&actionList, 1, ARActiveLinkActionList);
	  Zero(&elseList, 1, ARActiveLinkActionList);
	  Zero(&schemaList, 1, ARWorkflowConnectStruct);

ARS.xs  view on Meta::CPAN

				 (ARList *)&groupList,
				 (ARS_fn)perl_ARInternalId,
				 sizeof(ARInternalId)), 0);
		hv_store(RETVAL,  "executeMask", strlen("executeMask") , newSViv(executeMask),0);
		hv_store(RETVAL,  "focusField", strlen("focusField") , newSViv(focusField), 0);
		hv_store(RETVAL,  "controlField", strlen("controlField") , 
			newSViv(controlField), 0);
		hv_store(RETVAL,  "enable", strlen("enable") , newSViv(enable), 0);
		/* a bit of a hack -- makes blessed reference to qualifier */
		ref = newSViv(0);
		sv_setref_pv(ref, "ARQualifierStructPtr", (void*)query);
		hv_store(RETVAL,  "query", strlen("query") , ref, 0);
		hv_store(RETVAL,  "actionList", strlen("actionList") ,
		     perl_ARList(ctrl, 
				 (ARList *)&actionList,
				 (ARS_fn)perl_ARActiveLinkActionStruct,
				 sizeof(ARActiveLinkActionStruct)), 0);
		hv_store(RETVAL,  "elseList", strlen("elseList") ,
		     perl_ARList(ctrl, 
				 (ARList *)&elseList,
				 (ARS_fn)perl_ARActiveLinkActionStruct,

ARS.xs  view on Meta::CPAN

	  ARDiaryList      diaryList;
	  ARWorkflowConnectStruct  schemaList;
	  ARPropList       objPropList;
#if AR_CURRENT_API_VERSION >= 13
	  unsigned int errorFilterOptions;
	  ARNameType   errorFilterName;
#endif

	  AMALLOCNN(query,1,ARQualifierStruct);

	  (void) ARError_reset();
	  Zero(&actionList, 1, ARFilterActionList);
	  Zero(&elseList, 1, ARFilterActionList);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(lastChanged, 1, ARAccessNameType);
	  Zero(&diaryList, 1, ARDiaryList);
	  Zero(&status, 1,ARStatusList);
	  Zero(&schemaList, 1, ARWorkflowConnectStruct);
	  Zero(&objPropList, 1, ARPropList);
#if AR_CURRENT_API_VERSION >= 13

ARS.xs  view on Meta::CPAN

	    hv_store(RETVAL,  "name", strlen("name") , newSVpv(name, 0), 0);
	    hv_store(RETVAL,  "order", strlen("order") , newSViv(order), 0);
		hv_store(RETVAL,  "schemaList", strlen("schemaList") , /* WorkflowConnectStruct */
			perl_ARNameList(ctrl, schemaList.u.schemaList), 0);
		hv_store(RETVAL,  "objPropList", strlen("objPropList") ,
			perl_ARPropList(ctrl, &objPropList), 0);
	    hv_store(RETVAL,  "opSet", strlen("opSet") , newSViv(opSet), 0);
	    hv_store(RETVAL,  "enable", strlen("enable") , newSViv(enable), 0);
	    /* a bit of a hack -- makes blessed reference to qualifier */
	    ref = newSViv(0);
	    sv_setref_pv(ref, "ARQualifierStructPtr", (void *)query);
	    hv_store(RETVAL,  "query", strlen("query") , ref, 0);
	    hv_store(RETVAL,  "actionList", strlen("actionList") , 
		     perl_ARList(ctrl, 
				 (ARList *)&actionList,
				 (ARS_fn)perl_ARFilterActionStruct,
				 sizeof(ARFilterActionStruct)), 0);
	    hv_store(RETVAL,  "elseList", strlen("elseList") ,
		     perl_ARList(ctrl, 
				 (ARList *)&elseList,
				 (ARS_fn)perl_ARFilterActionStruct,

ARS.xs  view on Meta::CPAN

ars_GetServerStatistics(ctrl,...)
	ARControlStruct *	ctrl
	PPCODE:
	{
	  ARServerInfoRequestList requestList;
	  ARServerInfoList        serverInfo;
	  int                     i = 0, ret = 0;
          unsigned int            ui = 0;
	  ARStatusList            status;

	  (void) ARError_reset();
	  Zero(&requestList, 1, ARServerInfoRequestList);
	  Zero(&serverInfo, 1, ARServerInfoList);
	  Zero(&status, 1, ARStatusList);
	  if(items < 1) {
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	  } else {
		requestList.numItems = items - 1;
		AMALLOCNN(requestList.requestList,(items-1),unsigned int);
		if(requestList.requestList) {
			for(i=1; i<items; i++) {

ARS.xs  view on Meta::CPAN

	  ARAccessNameType	     owner;
	  ARAccessNameType	     lastChanged;
	  char		    *changeDiary = CPNULL;
	  ARStatusList	     status;
	  int                ret = 0, i = 0;
	  HV		    *menuDef = newHV();
	  /* SV		    *ref; */
	  ARDiaryList        diaryList;
	  ARPropList         objPropList;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&objPropList, 1, ARPropList);
	  Zero(&menuDefn, 1, ARCharMenuStruct);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(lastChanged, 1, ARAccessNameType);
	  Zero(&diaryList, 1, ARDiaryList);
	  RETVAL = newHV();
	  sv_2mortal( (SV*) RETVAL );
	  ret = ARGetCharMenu(ctrl, name, &refreshCode, &menuDefn, &helpText, 

ARS.xs  view on Meta::CPAN

				av_push(a, newSViv(menuDefn.u.menuQuery.labelField));
				hv_store(menuDef, "labelField", strlen("labelField"),
					newRV_noinc((SV *)a), 0);
			}
#endif
			hv_store(menuDef,  "valueField", strlen("valueField") ,
				newSViv(menuDefn.u.menuQuery.valueField), 0);
			hv_store(menuDef,  "sortOnLabel", strlen("sortOnLabel") ,
				newSViv(menuDefn.u.menuQuery.sortOnLabel), 0);
			/* ref = newSViv(0);
			sv_setref_pv(ref, "ARQualifierStructPtr", 
				dup_qualifier(ctrl,
					(void *)&(menuDefn.u.menuQuery.qualifier)));
			hv_store(menuDef,  "qualifier", strlen("qualifier") , ref, 0); */
			hv_store( menuDef, "qualifier", strlen("qualifier"),
				newRV_inc((SV*) perl_qualifier(ctrl,&(menuDefn.u.menuQuery.qualifier))), 0 );

			hv_store(RETVAL,  "menuQuery", strlen("menuQuery") , 
				newRV_noinc((SV *)menuDef), 0);
			break;
		case AR_CHAR_MENU_FILE:

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	char *			name
	ARQualifierStruct *     qual
	CODE:
	{
		ARCharMenuStruct menuDefn;
		ARStatusList     status;
		int              ret;

		RETVAL = &PL_sv_undef;
		(void) ARError_reset();
		Zero(&menuDefn, 1, ARCharMenuStruct);
		Zero(&status, 1,ARStatusList);
		DBG( ("-> ARGetCharMenu\n") );
		ret = ARGetCharMenu(ctrl, name, NULL, &menuDefn, 
					NULL, NULL, NULL, NULL, NULL, 
#if AR_EXPORT_VERSION >= 5
			      		NULL,
#endif
			     		&status);
		DBG( ("<- ARGetCharMenu\n") );

ARS.xs  view on Meta::CPAN

	  ARTimestamp          timestamp;
	  ARAccessNameType           owner;
	  ARAccessNameType           lastChanged;
	  char                *changeDiary = CPNULL;
	  ARDiaryList          diaryList;
	  ARCompoundSchema     schema;
	  ARSortList           sortList;
	  ARPropList           objPropList;
	  ARNameType           defaultVui;

	  (void) ARError_reset();
	  Zero(&status, 1,  ARStatusList);
	  Zero(&assignedGroupList, 1, ARPermissionList);
	  Zero(&groupList, 1, ARPermissionList);
	  Zero(&adminGroupList, 1, ARInternalIdList);
	  Zero(&getListFields, 1, AREntryListFieldList);
	  Zero(&indexList, 1, ARIndexList);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(lastChanged, 1, ARAccessNameType);
	  Zero(&diaryList, 1, ARDiaryList);

ARS.xs  view on Meta::CPAN

	char *			schema
	int			changedSince
	PPCODE:
	{
	  ARNameList   nameList;
	  ARStatusList status;
          ARPropList   propList;
	  int          ret = 0;
          unsigned int i = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&nameList, 1, ARNameList);
	  Zero(&propList, 1, ARPropList);
#if AR_EXPORT_VERSION >= 8L
	  Zero(&propList, 1, ARPropList);
#endif
	  ret=ARGetListActiveLink(ctrl,schema,changedSince,
#if AR_EXPORT_VERSION >= 8L
                     &propList,
#endif

ARS.xs  view on Meta::CPAN

	  ARFieldMappingStruct  fieldMap;
	  ARDisplayInstanceList displayList;
	  char                 *helpText = CPNULL;
	  ARTimestamp           timestamp;
	  ARAccessNameType            owner;
	  ARAccessNameType            lastChanged;
	  char                 *changeDiary = CPNULL;
	  ARDiaryList           diaryList;
	  ARPropList            objPropList;

	  (void) ARError_reset();
	  Zero(&Status,      1, ARStatusList);
	  Zero(&defaultVal,  1, ARValueStruct);
	  Zero(&assignedGroupList, 1, ARPermissionList);
	  Zero(&permissions, 1, ARPermissionList);
	  Zero(&limit,       1, ARFieldLimitStruct);

	  Zero(fieldName,    1, ARNameType);
	  Zero(&fieldMap,    1, ARFieldMappingStruct);
	  Zero(&displayList, 1, ARDisplayInstanceList);

ARS.xs  view on Meta::CPAN

	  char                *checkSum = CPNULL;
	  char                *description = CPNULL;
	  char                *helpText    = CPNULL;
	  ARAccessNameType     owner;
	  ARAccessNameType     lastChanged;
      char                *changeDiary = CPNULL;
	  ARPropList           objPropList;
	  ARDiaryList           diaryList;
	  int                  ret;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&content, 1, ARImageDataStruct);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(&objPropList, 1, ARPropList);
	  Zero(&diaryList,   1, ARDiaryList);

	  ret = ARGetImage(ctrl, name, 
		 		&content,
		 		&imageType,

ARS.xs  view on Meta::CPAN

	    if(changeDiary) {  AP_FREE(changeDiary);  }
	    if(imageType)   {  AP_FREE(imageType);  }
	    if(checkSum)    { 	AP_FREE(checkSum);  }
	    if(description) {  AP_FREE(description);  }
	    FreeARImageDataStruct(&content, FALSE);
	    FreeARPropList(&objPropList, FALSE);
	  }else{
	    XSRETURN_UNDEF;
	  }
#else	/* prior to ARS 7.5 */
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
	  "ars_GetImage() is only available in ARS >= 7.5");
	  XSRETURN_UNDEF;
#endif
	}
	OUTPUT:
	RETVAL



int
ars_SetEntry(ctrl,schema,entry_id,getTime,...)
	ARControlStruct *	ctrl
	char *			schema
	char *			entry_id
	unsigned long		getTime
	CODE:
	{
	  int              a = 0, i = 0, c = (items - 4) / 2;
	  int              offset = 4;
	  ARFieldValueList fieldList;
	  ARInternalIdList getFieldIds;
	  ARStatusList     status;
	  int              ret = 0;
	  unsigned int     dataType = 0, j = 0;
	  unsigned int     option = AR_JOIN_SETOPTION_NONE;
	  AREntryIdList    entryList;
	  HV              *cacheFields;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&fieldList, 1, ARFieldValueList);
	  Zero(&getFieldIds, 1, ARInternalIdList);
	  Zero(&entryList, 1,AREntryIdList);
	  RETVAL = 0; /* assume error */
	  if ((items - 4) % 2) {
	    option = SvIV(ST(offset));
	    offset ++;
	  }
	  if (c < 1) {
	    (void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	    goto set_entry_exit;
	  }

	  cacheFields = fieldcache_get_schema_fields( ctrl, schema, FALSE );
	  if( ! cacheFields ){
	    goto set_entry_exit;
	  }

	  fieldList.numItems = c;
	  AMALLOCNN(fieldList.fieldValueList,c,ARFieldValueStruct);

	  getFieldIds.numItems = 0;
	  getFieldIds.internalIdList = NULL;

	  for (i=0; i<c; i++) {
	    ARInternalId fieldId;
	    a = i*2+offset;
	    fieldId = fieldList.fieldValueList[i].fieldId = SvIV(ST(a));
	    
	    if (! SvOK(ST(a+1))) {
	      /* pass a NULL */
	      fieldList.fieldValueList[i].value.dataType = AR_DATA_TYPE_NULL;
	    }else{
	      /* determine data type and pass value */
	      dataType = fieldcache_get_data_type( cacheFields, fieldId );
	      if (dataType <= AR_DATA_TYPE_MAX_TYPE) {
	        if (sv_to_ARValue(ctrl, ST(a+1), dataType, &fieldList.fieldValueList[i].value) < 0) {
		      goto set_entry_end;
	        }
	      }else{
	    	   if( getFieldIds.numItems == 0 ){
	          AMALLOCNN(getFieldIds.internalIdList,c,ARInternalId);
	        }
	        /* printf( "%s [%d] collect for loading\n", schema, fieldId ); fflush(stdout); */ /* _DEBUG_ */
            getFieldIds.internalIdList[getFieldIds.numItems] = fieldId;
	        ++getFieldIds.numItems;
	    	 }
	    }
	  }

	  /* load missing fields into cache */
	  if( getFieldIds.numItems > 0 ){
	    /* printf( "--- load missing fields ---\n" ); fflush(stdout); */ /* _DEBUG_ */
	    /* if( fieldcache_load_schema(ctrl,schema,&getFieldIds,NULL) != AR_RETURN_OK ){ */
	    if( fieldcache_load_schema(ctrl,schema,&getFieldIds,NULL) > AR_RETURN_WARNING ){
	      goto set_entry_end;
	    }
	  }

	  /* now get data type from the freshly cached fields */
	  i = 0;
	  for (j=0; j<getFieldIds.numItems; ++j) {
	    ARInternalId fieldId = getFieldIds.internalIdList[j];
	    while(fieldId != fieldList.fieldValueList[i].fieldId) ++i;
	    a = i*2+offset;

	    dataType = fieldcache_get_data_type( cacheFields, fieldId );
	    if (dataType <= AR_DATA_TYPE_MAX_TYPE) {
	      /* printf( "%s [%d] freshly loaded\n", schema, fieldId ); fflush(stdout); */ /* _DEBUG_ */
	      if (sv_to_ARValue(ctrl, ST(a+1), dataType, &fieldList.fieldValueList[i].value) < 0) {
	        goto set_entry_end;
	      }
		}else{
		  char errTxt[256];
	      sprintf( errTxt, "Failed to fetch field %d from hash", fieldId );
	      ARError_add(AR_RETURN_ERROR, AP_ERR_FIELD_TYPE);
	      ARError_add(AR_RETURN_ERROR, AP_ERR_CONTINUE, errTxt );
	      goto set_entry_end;
		}
	  }
	  /* printf( "--------------------\n" ); fflush(stdout); */ /* _DEBUG_ */


	  /* build entryList */
	  if(perl_BuildEntryList(ctrl, &entryList, entry_id) != 0){
		goto set_entry_end;
	  }

	  ret = ARSetEntry(ctrl, schema, &entryList, &fieldList, getTime, option, &status);
	  if (entryList.entryIdList) AP_FREE(entryList.entryIdList);
#ifdef PROFILE
	  ((ars_ctrl *)ctrl)->queries++;
#endif
	  if (! ARError( ret, status)) {
	    RETVAL = 1;
	  }
	set_entry_end:;
	  if (fieldList.fieldValueList) AP_FREE(fieldList.fieldValueList);
	set_entry_exit:;
	}
	OUTPUT:
	RETVAL

SV *
ars_Export(ctrl,displayTag,vuiType,...)
	ARControlStruct *	ctrl
	char *			displayTag
	unsigned int		vuiType
	CODE:

ARS.xs  view on Meta::CPAN

		ARStructItemList structItems;
		char            *buf = CPNULL;
		ARStatusList     status;
#if AR_CURRENT_API_VERSION >= 17
		unsigned int     exportOption = AR_EXPORT_DEFAULT;   /* TODO: support this as ars_Export() argument */
#endif
#if AR_EXPORT_VERSION >= 8L
		ARWorkflowLockStruct workflowLockStruct;
#endif
	  
		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		Zero(&structItems, 1, ARStructItemList);
#if AR_EXPORT_VERSION >= 8L
		Zero(&workflowLockStruct, 1, ARWorkflowLockStruct);
#endif
		RETVAL = &PL_sv_undef;
		if ( (items % 2 == 0) || (c < 1) ) {
			(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
			ok = 0;
		} else {

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	char *			importBuf
	unsigned int            importOption
	CODE:
	{
		int               ret = 1, i = 0, a = 0, c = (items - 2) / 2, ok = 1;
		ARStructItemList *structItems = NULL;
		char             *objectModificationLogLabel = NULL;
		ARStatusList      status;

		(void) ARError_reset();	  
		Zero(&status, 1,ARStatusList);
		RETVAL = 0;
		if ((items-3) % 2) {
			(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
			ok = 0;
		} else {
			if (c > 0) {
				AMALLOCNN(structItems, c, ARStructItemList);
				structItems->numItems = c;
				AMALLOCNN(structItems->structItemList, c,

ARS.xs  view on Meta::CPAN

	PPCODE:
	{
	  ARNameList   nameList;
	  ARStatusList status;
#if AR_EXPORT_VERSION >= 8L
	  ARPropList   propList;
#endif
	  int          ret = 0;
	  unsigned int i = 0;

	  (void) ARError_reset();
#if AR_EXPORT_VERSION >= 8L
	  Zero(&propList, 1, ARPropList);
#endif
	  Zero(&nameList, 1, ARNameList);
	  Zero(&status, 1,ARStatusList);
	  ret = ARGetListFilter(control,schema,changedsince,
#if AR_EXPORT_VERSION >= 8L
                               &propList,
#endif
                               &nameList,&status);

ARS.xs  view on Meta::CPAN

	char *			schema
	unsigned long		changedsince
	PPCODE:
	{
	  ARNameList   nameList;
	  ARStatusList status;
	  ARPropList   propList;
	  int          ret = 0;
	  unsigned int i = 0;

	  (void) ARError_reset();
#if AR_EXPORT_VERSION >= 8L
	  Zero(&propList, 1,ARPropList);
#endif
	  Zero(&nameList, 1, ARNameList);
	  Zero(&status, 1,ARStatusList);
	  ret = ARGetListEscalation(control,schema,changedsince,
#if AR_EXPORT_VERSION >= 8L
                                    &propList,
#endif
                                    &nameList,&status);

ARS.xs  view on Meta::CPAN

	  ARNameList   nameList;
	  ARStatusList status;
#if AR_EXPORT_VERSION >= 8L
          ARPropList   propList;
#endif
          ARNameList   schemaNameList;
          ARNameList   actLinkNameList;
	  int          ret = 0;
          unsigned int i = 0;

	  (void) ARError_reset();
#if AR_EXPORT_VERSION >= 8L
	  Zero(&propList, 1, ARPropList);
#endif
	  Zero(&status, 1, ARStatusList);
	  Zero(&schemaNameList, 1, ARNameList);
	  Zero(&actLinkNameList, 1, ARNameList);
	  Zero(&nameList, 1, ARNameList);
	  ret = ARGetListCharMenu(control,changedsince,
#if AR_EXPORT_VERSION >= 8L
                                  &schemaNameList, &actLinkNameList, &propList,

ARS.xs  view on Meta::CPAN

	{
	  ARStatusList     status;
#if AR_CURRENT_API_VERSION >= 14
	  ARNameList       schemaList;
	  ARNameList      *schemaListPtr = NULL;
	  ARNameList       nameList;
	  ARPropList       propList;
	  int              ret = 0, rv = 0;
	  unsigned int     i = 0;

	  (void) ARError_reset();
	  Zero(&propList, 1, ARPropList);
	  Zero(&schemaList, 1, ARNameList);
	  Zero(&nameList, 1, ARNameList);
	  Zero(&status, 1,ARStatusList);

	  if( schema == NULL ){
	    /* do nothing */
	  }else if( SvROK(schema) && SvTYPE(SvRV(schema)) == SVt_PVAV ){
	    HV *h_dummy = newHV();
	    SvREFCNT_inc( schema );

ARS.xs  view on Meta::CPAN

	  }

	  if (rv == 0 && !ARError( ret,status)) {
	    for (i=0; i < nameList.numItems; i++){
	      XPUSHs(sv_2mortal(newSVpv(nameList.nameList[i], 0)));
	    }
	    FreeARNameList(&nameList,FALSE);
	  }
	  FreeARNameList(&schemaList,FALSE);
#else	/* prior to ARS 7.5 */
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
	  "ars_GetListImage() is only available in ARS >= 7.5");
#endif
	}





ARS.xs  view on Meta::CPAN

int
ars_DeleteActiveLink(ctrl, name)
	ARControlStruct *	ctrl
	char *			name
	CODE:
	{
	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;
	  if(ctrl && CVLD(name)) {
		ret = ARDeleteActiveLink(ctrl, name, 
#if AR_EXPORT_VERSION >= 8L
                                         0,
#endif
#if AR_CURRENT_API_VERSION >= 17
                                         objectModificationLogLabel,
#endif

ARS.xs  view on Meta::CPAN

int
ars_DeleteVUI(ctrl, schema, vuiId)
	ARControlStruct *	ctrl
	char *			schema
	ARInternalId		vuiId
	CODE:
	{
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;
#if AR_EXPORT_VERSION >= 3
	  if(ctrl && CVLD(schema)) {
		ret = ARDeleteVUI(ctrl, schema,
		        vuiId,
		        &status);
#ifdef PROFILE
	        ((ars_ctrl *)ctrl)->queries++;
#endif

ARS.xs  view on Meta::CPAN

int
ars_DeleteCharMenu(ctrl, name)
	ARControlStruct *	ctrl
	char *			name
	CODE:
	{
	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;
	  if(ctrl && name && *name) {
		ret = ARDeleteCharMenu(ctrl, name, 
#if AR_EXPORT_VERSION >= 8L
                                       0,
#endif
#if AR_CURRENT_API_VERSION >= 17
                                       objectModificationLogLabel,
#endif

ARS.xs  view on Meta::CPAN

int
ars_DeleteEscalation(ctrl, name)
	ARControlStruct *	ctrl
	char *			name
	CODE:
	{
	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;
	  if(ctrl && name && *name) {
		ret = ARDeleteEscalation(ctrl, name, 
#if AR_EXPORT_VERSION >= 8L
                                         0,
#endif
#if AR_CURRENT_API_VERSION >= 17
                                         objectModificationLogLabel,
#endif

ARS.xs  view on Meta::CPAN

ars_DeleteField(ctrl, schema, fieldId, deleteOption=0)
	ARControlStruct *	ctrl
	char * 			schema
	ARInternalId		fieldId
	unsigned int		deleteOption
	CODE:
	{
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;
	  if(ctrl && CVLD(schema) && IVLD(deleteOption, 0, 2)) {
		ret = ARDeleteField(ctrl, schema,
		        fieldId,
		        deleteOption,
		        &status);
#ifdef PROFILE
	        ((ars_ctrl *)ctrl)->queries++;
#endif

ARS.xs  view on Meta::CPAN

int
ars_DeleteFilter(ctrl, name)
	ARControlStruct *	ctrl
	char *			name
	CODE:
	{
	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;
	  if(ctrl && name && *name) {
		ret = ARDeleteFilter(ctrl, name, 
#if AR_EXPORT_VERSION >= 8L
                                     0,
#endif
#if AR_CURRENT_API_VERSION >= 17
                                     objectModificationLogLabel,
#endif

ARS.xs  view on Meta::CPAN

int
ars_DeleteContainer(ctrl, name)
	ARControlStruct *	ctrl
	char *			name
	CODE:
	{
	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;
	  if(ctrl && name && *name) {
		ret = ARDeleteContainer( ctrl, name, 
#if AR_EXPORT_VERSION >= 8L
                                     0,
#endif
#if AR_CURRENT_API_VERSION >= 17
                                     objectModificationLogLabel,
#endif

ARS.xs  view on Meta::CPAN

ars_DeleteSchema(ctrl, name, deleteOption)
	ARControlStruct *	ctrl
	char *			name
	unsigned int 		deleteOption
	CODE:
	{
	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  RETVAL = 0;
	  if(ctrl && CVLD(name)) {
		ret = ARDeleteSchema(ctrl, name,
		        deleteOption,
#if AR_CURRENT_API_VERSION >= 17
			    objectModificationLogLabel,
#endif
		        &status);
#ifdef PROFILE

ARS.xs  view on Meta::CPAN

	unsigned int		deleteOption
	CODE:
	{
	  int              i = 0, ret = 0, c = (items - 3);
	  ARStatusList     status;
	  ARInternalIdList fieldList;

	  RETVAL = 0; /* assume error */
	  Zero(&status, 1,ARStatusList);
	  Zero(&fieldList, 1, ARInternalIdList);
	  (void) ARError_reset();
#if AR_EXPORT_VERSION >= 3
	  if(items < 4)
	     (void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	  else {
	     /* slurp in each fieldId and put it in a list */
	     fieldList.numItems = c;
	     fieldList.internalIdList = MALLOCNN(sizeof(ARInternalId) * c);
	     for(i = 0; i < c; i++) {
		fieldList.internalIdList[i] = SvIV(ST(i + 3));
	     }

ARS.xs  view on Meta::CPAN

	ARControlStruct *       ctrl
    char *                  name
    ARBoolean               updateRef
	CODE:
	{
	  char        *objectModificationLogLabel = NULL;
	  ARStatusList status;
#if AR_CURRENT_API_VERSION >= 14
	  int          ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  RETVAL = 0;

	  if(ctrl && name && *name) {
		ret = ARDeleteImage(ctrl, name,
		        updateRef,
#if AR_CURRENT_API_VERSION >= 17
			    objectModificationLogLabel,
#endif
		        &status);
		if( !ARError( ret, status) ){
			RETVAL = 1;
		}
	  }else{
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	  }
#else	/* prior to ARS 7.5 */
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
	  "ars_DeleteImage() is only available in ARS >= 7.5");
	  XSRETURN_UNDEF;
#endif
	}
	OUTPUT:
	RETVAL


ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	char *			command
	int			runOption
	PPCODE:
	{
	 ARStatusList status;
	 int          returnStatus = 0;
	 char        *returnString;
	 int          ret = 0;

	 (void) ARError_reset();
	 Zero(&status, 1,ARStatusList);
#if AR_EXPORT_VERSION >= 3
	 if(ctrl && CVLD(command)) {
		if(runOption == 0)
			ret = ARExecuteProcess(ctrl, command, &returnStatus, &returnString, &status);
		else
			ret = ARExecuteProcess(ctrl, command, NULL, NULL, &status);
	 }
#ifdef PROFILE
	 ((ars_ctrl *)ctrl)->queries++;

ARS.xs  view on Meta::CPAN

	  ARAccessNameType     lastChanged;
      char                *changeDiary = CPNULL;
	  SV                  *ref;
	  int                  ret;
	  ARQualifierStruct   *query = MALLOCNN(sizeof(ARQualifierStruct));
	  ARDiaryList          diaryList;
	  ARWorkflowConnectStruct schemaList;
	  ARPropList              objPropList;


	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&escalationTm, 1, AREscalationTmStruct);
	  Zero(&actionList, 1,ARFilterActionList);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(lastChanged, 1, ARAccessNameType);
	  Zero(&diaryList, 1, ARDiaryList);
	  Zero(&elseList, 1,ARFilterActionList);
	  Zero(&schemaList, 1, ARWorkflowConnectStruct);
	  Zero(&objPropList, 1, ARPropList);

ARS.xs  view on Meta::CPAN

		if (!ARError(ret, status)) {
			hv_store(RETVAL,  "changeDiary", strlen("changeDiary") ,
				perl_ARList(ctrl, 
				(ARList *)&diaryList,
				(ARS_fn)perl_diary,
				sizeof(ARDiaryStruct)), 0);
			FreeARDiaryList(&diaryList, FALSE);
		}
	     }
	     ref = newSViv(0);
	     sv_setref_pv(ref, "ARQualifierStructPtr", (void *)query);
	     hv_store(RETVAL,  "query", strlen("query") , ref, 0);
	     hv_store(RETVAL,  "actionList", strlen("actionList") ,
			perl_ARList(ctrl,
				(ARList *)&actionList,
				(ARS_fn)perl_ARFilterActionStruct,
				sizeof(ARFilterActionStruct)), 0);
	     hv_store(RETVAL,  "elseList", strlen("elseList") , 
			perl_ARList( ctrl,
				(ARList *)&elseList,
				(ARS_fn)perl_ARFilterActionStruct,

ARS.xs  view on Meta::CPAN

	  ARFullTextInfoRequestList requestList;
	  ARFullTextInfoList        fullTextInfo;
	  ARStatusList              status;
	  int                       ret = 0;
	  unsigned int rlist[] = {AR_FULLTEXTINFO_COLLECTION_DIR,
			 	  AR_FULLTEXTINFO_STOPWORD,
				  AR_FULLTEXTINFO_CASE_SENSITIVE_SRCH,
			 	  AR_FULLTEXTINFO_STATE,
			 	  AR_FULLTEXTINFO_FTS_MATCH_OP };

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&requestList, 1, ARFullTextInfoRequestList);
	  Zero(&fullTextInfo, 1, ARFullTextInfoList);
	  RETVAL = newHV();
	  sv_2mortal( (SV*) RETVAL );
	  requestList.numItems = 5;
	  requestList.requestList = rlist;
	  ret = ARGetFullTextInfo(ctrl, &requestList, &fullTextInfo, &status);
#ifdef PROFILE
	  ((ars_ctrl *)ctrl)->queries++;

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	char *			userName
	char *			password
	CODE:
	{
	  ARStatusList    status;
	  ARGroupInfoList groupList;
	  int             ret = 0;
          unsigned int    i = 0, v = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&groupList, 1, ARGroupInfoList);
	  RETVAL = newHV();
	  sv_2mortal( (SV*) RETVAL );
	  ret = ARGetListGroup(ctrl, userName, 
#if AR_EXPORT_VERSION >= 6
			       password,
#endif
			       &groupList, &status);
#ifdef PROFILE

ARS.xs  view on Meta::CPAN

ars_GetListGroup(ctrl, userName=NULL,password=NULL)
	ARControlStruct  *	ctrl
	char *			       userName
	char *			       password
	PPCODE:
	{
	  ARStatusList    status;
	  ARGroupInfoList groupList;
	  int             ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&groupList, 1, ARGroupInfoList);

	  ret = ARGetListGroup(ctrl, userName, 
#if AR_EXPORT_VERSION >= 6
			       password,
#endif
			       &groupList, &status);
#ifdef PROFILE
	  ((ars_ctrl *)ctrl)->queries++;

ARS.xs  view on Meta::CPAN

    ARNameType        applicationName
    char *            userName
    char *            password
    PPCODE:
    {
#if AR_EXPORT_VERSION >= 8L
      ARStatusList    status;
      ARRoleInfoList  roleList;
      int             ret = 0;

      (void) ARError_reset();
      Zero(&status, 1,ARStatusList);
      Zero(&roleList, 1, ARRoleInfoList);

      ret = ARGetListRole(ctrl,
                   applicationName, 
                   userName, 
                   password,
                   &roleList, &status);

      if(!ARError( ret, status)) {

ARS.xs  view on Meta::CPAN

ars_GetListLicense(ctrl, licenseType=NULL)
    ARControlStruct *  ctrl
    char *             licenseType
    PPCODE:
    {
#if AR_EXPORT_VERSION >= 6L
      ARStatusList       status;
      ARLicenseInfoList  licList;
      int                ret = 0;

      (void) ARError_reset();
      Zero(&status, 1,ARStatusList);
      Zero(&licList, 1, ARLicenseInfoList);

      ret = ARGetListLicense(ctrl,
                   licenseType, 
                   &licList, &status);

      if(!ARError( ret, status)) {
        unsigned int i;
	    for(i = 0; i < licList.numItems; i++) {

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	char *			sqlCommand
	unsigned int		maxRetrieve
	PPCODE:
	{
	  ARStatusList    status;
	  ARValueListList valueListList;
	  unsigned int    numMatches = 0;
	  int             ret = 0;

	  (void) ARError_reset();
	  RETVAL = NULL;
	  Zero(&status, 1, ARStatusList);
	  Zero(&valueListList, 1, ARValueListList);
#ifndef ARS20
	  ret = ARGetListSQL(ctrl, sqlCommand, maxRetrieve, &valueListList, 
			     &numMatches, &status);
#ifdef PROFILE
	  ((ars_ctrl *)ctrl)->queries++;
#endif
	  if(!ARError( ret, status)) {

ARS.xs  view on Meta::CPAN

ars_GetListUser(ctrl, userListType=AR_USER_LIST_MYSELF,changedSince=0)
	ARControlStruct *	ctrl
	unsigned int		userListType
	ARTimestamp		changedSince
	PPCODE:
	{
	  ARStatusList   status;
	  ARUserInfoList userList;
	  int            ret = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&userList, 1, ARUserInfoList);
	  ret = ARGetListUser(ctrl, userListType, 
#if AR_EXPORT_VERSION >= 6
				changedSince,
#endif
				&userList, &status);
#ifdef PROFILE
	  ((ars_ctrl *)ctrl)->queries++;
#endif

ARS.xs  view on Meta::CPAN

	char *			schema
	unsigned int		changedSince
	PPCODE:
	{
#if AR_EXPORT_VERSION >= 3
	  ARStatusList     status;
	  ARInternalIdList idList;
	  int              ret = 0;
      unsigned int     i = 0;

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&idList, 1, ARInternalIdList);

	  ret = ARGetListVUI(ctrl, schema, 
				changedSince,
#if AR_CURRENT_API_VERSION >= 17
				NULL,     /* &objPropList (undocumented by BMC) */
#endif
				&idList,
				&status);
#ifdef PROFILE
	  ((ars_ctrl *)ctrl)->queries++;
#endif
	  if(!ARError( ret, status)) {
	    for(i = 0 ; i < idList.numItems ; i++) {
		XPUSHs(sv_2mortal(newSViv(idList.internalIdList[i])));
	    }
	  }
	  FreeARInternalIdList(&idList, FALSE);
#else /* ars 2.x */
	  (void) ARError_reset();
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, "Not available in 2.x");
#endif
	}

void
ars_SetServerInfo(ctrl, ...)
	ARControlStruct *	ctrl
	PPCODE:
	{
		ARStatusList     status;
		ARServerInfoList serverInfo;
		int		 ret = 0, i = 0, count = 0;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		Zero(&serverInfo, 1, ARServerInfoList);

		if((items == 1) || ((items % 2) == 0)) { 
			(void) ARError_add(AR_RETURN_ERROR, 
					   AP_ERR_BAD_ARGS);
		} else {
			unsigned int infoType, j = 0;
			char         buf[256];

ARS.xs  view on Meta::CPAN

	PPCODE:
	{
	  ARStatusList            status;
	  ARServerInfoRequestList requestList;
	  ARServerInfoList        serverInfo;
	  int                     ret = 0;
          int                     i  = 0;
          unsigned int            ui = 0, count = 0;
	  unsigned int            rlist[AR_MAX_SERVER_INFO_USED];

	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(&requestList, 1, ARServerInfoRequestList);
	  Zero(&serverInfo, 1, ARServerInfoList);
	  count = 0;
	  if(items == 1) { /* none specified.. fetch all */
	     for(i = 0; i < AR_MAX_SERVER_INFO_USED ; i++) {
	        /* we'll exclude ones that can't be retrieved to avoid errors */
	        switch(i+1) {
	           case AR_SERVER_INFO_DB_PASSWORD:
#if AR_CURRENT_API_VERSION < 17

ARS.xs  view on Meta::CPAN

	  int          ret = 0;
	  ARDiaryList  diaryList;
	  ARPropList   objPropList;
# if AR_EXPORT_VERSION >= 6
	  unsigned int vuiType = 0;
	  ARLocaleType locale;
	  Zero(locale, 1, ARLocaleType);
# endif
	  RETVAL = newHV();
	  sv_2mortal( (SV*) RETVAL );
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(vuiName, 1, ARNameType);
	  Zero(&dPropList, 1, ARPropList);
	  Zero(&objPropList, 1, ARPropList);
	  Zero(&timestamp, 1, ARTimestamp);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(lastChanged, 1, ARAccessNameType);
	  ret = ARGetVUI(ctrl, schema, vuiId, vuiName,
# if AR_EXPORT_VERSION >= 6
			 locale, &vuiType,

ARS.xs  view on Meta::CPAN

	  }
	  FreeARPropList(&dPropList, FALSE);
	  FreeARPropList(&objPropList, FALSE);
	  if(helpText) {
	    	AP_FREE(helpText);
	  }
	  if(changeDiary) {
	    	AP_FREE(changeDiary);
	  }
#else /* ars 2.x */
	  (void) ARError_reset();
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, "Not available in 2.x");
	  RETVAL = newHV();
#endif

	}
	OUTPUT:
	RETVAL



ARS.xs  view on Meta::CPAN

		char *helpText = NULL;
		ARAccessNameType owner;
		char *changeDiary = NULL;
		ARPropList objPropList;
	    char *objectModificationLogLabel = NULL;
		ARStatusList status;
		HV *menuDef = NULL;
		SV **pSvTemp;

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(&arMenuDef, 1,ARCharMenuStruct);
		Zero(owner, 1,ARAccessNameType);
		Zero(&objPropList, 1,ARPropList);
		Zero(&status, 1,ARStatusList);

		if( SvROK(menuDefRef) && SvTYPE(SvRV(menuDefRef)) == SVt_PVHV ){
			menuDef = (HV*) SvRV(menuDefRef);
		}else{
			croak("usage: ars_CreateCharMenu(...)");
		}

ARS.xs  view on Meta::CPAN

		char *helpText = NULL;
		ARAccessNameType owner;
		char *changeDiary = NULL;
		ARPropList *objPropList = NULL;
		char *objectModificationLogLabel = NULL;
		ARStatusList status;
		HV *menuDef = NULL;
		SV **pSvTemp;

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(owner, 1,ARAccessNameType);
		Zero(&status, 1,ARStatusList);

		if( SvROK(menuDefRef) && SvTYPE(SvRV(menuDefRef)) == SVt_PVHV ){
			menuDef = (HV*) SvRV(menuDefRef);
		}else{
			croak("usage: ars_SetCharMenu(...)");
		}

		if( hv_exists(menuDef,"name",4) ){

ARS.xs  view on Meta::CPAN

		char *helpText = NULL;
		ARAccessNameType owner;
		char *changeDiary = NULL;
		ARPropList *objPropList = NULL;
		ARStatusList status;
		HV *fieldDef = NULL;
		SV **pSvTemp;
		char strTemp[STR_TEMP_SIZE+1];

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(owner, 1,ARAccessNameType);
		Zero(fieldName, 1,ARNameType);
		Zero(&status, 1,ARStatusList);
		Zero(&fieldMap, 1,ARFieldMappingStruct);
		Zero(&permissions, 1,ARPermissionList);
		Zero(&dInstanceList, 1, ARDisplayInstanceList);

		if( SvROK(fieldDefRef) && SvTYPE(SvRV(fieldDefRef)) == SVt_PVHV ){
			fieldDef = (HV*) SvRV(fieldDefRef);
		}else{

ARS.xs  view on Meta::CPAN

		unsigned int *fieldOption = NULL;
#endif
		ARValueStruct *defaultVal = NULL;
		ARPermissionList *permissions = NULL;
		ARFieldLimitStruct *limit = NULL;
		ARDisplayInstanceList *dInstanceList = NULL;
		char *helpText = NULL;
		ARAccessNameType owner;
		char *ownerPtr = NULL;
#if AR_EXPORT_VERSION >= 9L
		unsigned int	setFieldOptions = 0;
#endif
		char *changeDiary = NULL;
		ARPropList *objPropList = NULL;
		ARStatusList status;
		HV *fieldDef = NULL;
		SV **pSvTemp;
		char strTemp[STR_TEMP_SIZE+1];

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(fieldName, 1,ARNameType);
		Zero(owner, 1,ARAccessNameType);
		Zero(&status, 1,ARStatusList);

		if( SvROK(fieldDefRef) && SvTYPE(SvRV(fieldDefRef)) == SVt_PVHV ){
			fieldDef = (HV*) SvRV(fieldDefRef);
		}else{
			croak("usage: ars_SetField(...)");
		}

ARS.xs  view on Meta::CPAN

		}

		if( hv_exists(fieldDef,"helpText",8) ){
			rv += strmakHVal( fieldDef, "helpText", &helpText ); 
		}
		if( hv_exists(fieldDef,"owner",5) ){
			rv += strcpyHVal( fieldDef, "owner", owner, AR_MAX_ACCESS_NAME_SIZE ); 
			ownerPtr = owner;
		}
#if AR_EXPORT_VERSION >= 9L
		pSvTemp = hv_fetch( fieldDef, "setFieldOptions", strlen("setFieldOptions") , 0 );
		if( pSvTemp && *pSvTemp && SvTYPE(*pSvTemp) != SVt_NULL ){
			rv += uintcpyHVal( fieldDef, "setFieldOptions", &setFieldOptions );
		}
#endif
		if( hv_exists(fieldDef,"changeDiary",11) ){
			rv += strmakHVal( fieldDef, "changeDiary", &changeDiary );
		}

		if( rv == 0 ){
			ret = ARSetField( ctrl,
				schema,
				fieldId,

ARS.xs  view on Meta::CPAN

				fieldOption,
#endif
				defaultVal,
				permissions,
				limit,
				dInstanceList,
				helpText,
				ownerPtr,
				changeDiary,
#if AR_EXPORT_VERSION >= 9L
				setFieldOptions,
#endif
#if AR_CURRENT_API_VERSION >= 17
				objPropList,
#endif
				&status );

			RETVAL = ARError(ret,status) ? 0 : fieldId;
		}else{ 
			ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL);
			RETVAL = 0;

ARS.xs  view on Meta::CPAN

		ARAccessNameType owner;
		char *changeDiary = NULL;
		ARPropList *objPropList = NULL;
		char *objectModificationLogLabel = NULL;
		ARStatusList status;
		HV *schemaDef = NULL;
		SV **pSvTemp;
		/* char strTemp[STR_TEMP_SIZE+1]; */

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(name, 1,ARNameType);
		Zero(&compoundSchema, 1,ARCompoundSchema);
		Zero(&groupList, 1,ARPermissionList);
		Zero(&admingrpList, 1,ARInternalIdList);
		Zero(&getListFields, 1,AREntryListFieldList);
		Zero(&sortList, 1,ARSortList);
		Zero(&indexList, 1,ARIndexList);
		Zero(defaultVui, 1,ARNameType);
		Zero(owner, 1,ARAccessNameType);
		Zero(&status, 1,ARStatusList);

ARS.xs  view on Meta::CPAN

		char *ownerPtr = NULL; 
		char *changeDiary = NULL;
		ARPropList *objPropList = NULL;
		char *objectModificationLogLabel = NULL;
		ARStatusList status;
		HV *schemaDef = NULL;
		SV **pSvTemp;
		/* char strTemp[STR_TEMP_SIZE+1]; */

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(newName, 1,ARNameType);
		Zero(defaultVui, 1,ARNameType);
		Zero(owner, 1,ARAccessNameType);
		Zero(&status, 1,ARStatusList);

		if( SvROK(schemaDefRef) && SvTYPE(SvRV(schemaDefRef)) == SVt_PVHV ){
			schemaDef = (HV*) SvRV(schemaDefRef);
		}else{
			croak("usage: ars_SetSchema(...)");
		}

ARS.xs  view on Meta::CPAN

#endif
#if AR_EXPORT_VERSION >= 9L
				auditInfo,
#endif
				defaultVuiPtr,
				helpText,
				ownerPtr,
				changeDiary,
				objPropList,
#if AR_EXPORT_VERSION >= 8L
				0,              /* setOption, reserved for future use */
#endif
#if AR_CURRENT_API_VERSION >= 17
			    objectModificationLogLabel,
#endif
				&status );

			RETVAL = ARError(ret,status) ? 0 : 1;
		}else{ 
			ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL);
			RETVAL = 0;

ARS.xs  view on Meta::CPAN

		ARPropList dPropList;
		char *helpText = NULL;
		ARAccessNameType owner;
		char *changeDiary = NULL;
		ARPropList objPropList;
		ARStatusList status;
		HV *vuiDef = NULL;
		SV **pSvTemp;

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(vuiName, 1,ARNameType);
		Zero(locale, 1,ARLocaleType);
		Zero(&dPropList, 1,ARPropList);
		Zero(&objPropList, 1,ARPropList);
		Zero(owner, 1,ARAccessNameType);
		Zero(&status, 1,ARStatusList);

		if( SvROK(vuiDefRef) && SvTYPE(SvRV(vuiDefRef)) == SVt_PVHV ){
			vuiDef = (HV*) SvRV(vuiDefRef);
		}else{

ARS.xs  view on Meta::CPAN

		char *helpText = NULL;
		ARAccessNameType owner;
		char *ownerPtr = NULL;
		char *changeDiary = NULL;
		ARPropList *objPropList = NULL;
		ARStatusList status;
		HV *vuiDef = NULL;
		SV **pSvTemp;

		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(vuiName, 1,ARNameType);
		Zero(locale, 1,ARLocaleType);
		Zero(owner, 1,ARAccessNameType);
		Zero(&status, 1,ARStatusList);


		if( SvROK(vuiDefRef) && SvTYPE(SvRV(vuiDefRef)) == SVt_PVHV ){
			vuiDef = (HV*) SvRV(vuiDefRef);
		}else{
			croak("usage: ars_SetVUI(...)");

ARS.xs  view on Meta::CPAN

		ARAccessNameType owner;
		char *changeDiary = NULL;
		ARPropList objPropList;
		char *objectModificationLogLabel = NULL;
		ARStatusList status;
		HV *containerDef = NULL;
		SV **pSvTemp;


		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(name, 1,ARNameType);
		Zero(&groupList, 1,ARPermissionList);
		Zero(&admingrpList, 1,ARInternalIdList);
		Zero(&ownerObjList, 1,ARContainerOwnerObjList);
		Zero(&references, 1,ARReferenceList);
		Zero(owner, 1,ARAccessNameType);
		Zero(&objPropList, 1,ARPropList);
		Zero(&status, 1,ARStatusList);

		if( SvROK(containerDefRef) && SvTYPE(SvRV(containerDefRef)) == SVt_PVHV ){

ARS.xs  view on Meta::CPAN

		ARAccessNameType owner;
		char *changeDiary = NULL;
		ARPropList *objPropList = NULL;
		char *objectModificationLogLabel = NULL;
		ARStatusList status;
		HV *containerDef = NULL;
		SV **pSvTemp;


		RETVAL = 0; /* assume error */
		(void) ARError_reset();
		Zero(newName, 1,ARNameType);
		Zero(owner, 1,ARAccessNameType);
		Zero(&status, 1,ARStatusList);

		if( SvROK(containerDefRef) && SvTYPE(SvRV(containerDefRef)) == SVt_PVHV ){
			containerDef = (HV*) SvRV(containerDefRef);
		}else{
			croak("usage: ars_SetContainer(...)");
		}

ARS.xs  view on Meta::CPAN

	  char                  *changeDiary = CPNULL;
	  char                  *objectModificationLogLabel = NULL;
	  ARStatusList           status;
#if AR_EXPORT_VERSION >= 5
	  ARNameList              schemaNameList;
	  ARWorkflowConnectStruct schemaList;
	  ARPropList              objPropList;
#endif
	  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(schema, 1, ARNameType);
	  Zero(name, 1, ARNameType);
	  Zero(&groupList, 1,ARInternalIdList);
	  Zero(&actionList, 1,ARActiveLinkActionList);
	  Zero(owner, 1, ARAccessNameType);
#if AR_EXPORT_VERSION >= 3
	  Zero(&elseList, 1,ARActiveLinkActionList);
#else
	  Zero(&displayList, 1,ARDisplayList);

ARS.xs  view on Meta::CPAN

	  char                    *helpText = CPNULL;
	  ARAccessNameType         owner;
	  char                    *ownerPtr = NULL;
	  char                    *changeDiary = CPNULL;
	  char                    *objectModificationLogLabel = NULL;
	  ARStatusList             status;
	  ARWorkflowConnectStruct  *schemaList = NULL;
	  ARPropList               *objPropList = NULL;
	  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(newName, 1, ARNameType);
	  Zero(owner, 1, ARAccessNameType);

	  if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
		ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
	  } else {
		HV *objDef = (HV *)SvRV(objDefRef);
		SV **qhv = hv_fetch(objDef,  "query", strlen("query") , 0);

ARS.xs  view on Meta::CPAN

	  ARStatusList           status;
	  ARNameList              schemaNameList;
	  ARWorkflowConnectStruct schemaList;
	  ARPropList              objPropList;
#if AR_CURRENT_API_VERSION >= 13
	  unsigned int           errorFilterOptions = 0;
	  ARNameType             errorFilterName;
#endif
	  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(schema, 1, ARNameType);
	  Zero(name, 1, ARNameType);
	  Zero(&actionList, 1,ARFilterActionList);
	  Zero(&elseList, 1,ARFilterActionList);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(&objPropList, 1, ARPropList);
	  Zero(&schemaList, 1, ARWorkflowConnectStruct);
	  Zero(&schemaNameList, 1, ARNameList);
#if AR_CURRENT_API_VERSION >= 13

ARS.xs  view on Meta::CPAN

	  ARStatusList             status;
	  ARWorkflowConnectStruct  *schemaList = NULL;
	  ARPropList               *objPropList = NULL;
#if AR_CURRENT_API_VERSION >= 13
	  unsigned int           *errorFilterOptions = NULL;
	  ARNameType              errorFilterName;
	  char                   *errorFilterNamePtr = NULL;
#endif
	  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(newName, 1, ARNameType);
	  Zero(owner, 1, ARAccessNameType);
#if AR_CURRENT_API_VERSION >= 13
	  Zero(errorFilterName, 1, ARNameType);
#endif

	  if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
		ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
	  } else {

ARS.xs  view on Meta::CPAN

	  char                  *helpText = CPNULL;
	  ARAccessNameType       owner;
	  char                  *changeDiary = CPNULL;
	  char                  *objectModificationLogLabel = NULL;
	  ARStatusList           status;
	  ARNameList              schemaNameList;
	  ARWorkflowConnectStruct schemaList;
	  ARPropList              objPropList;
	  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(name, 1, ARNameType);
	  Zero(&actionList, 1,ARFilterActionList);
	  Zero(&elseList, 1,ARFilterActionList);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(&objPropList, 1, ARPropList);
	  Zero(&schemaList, 1, ARWorkflowConnectStruct);
	  Zero(&schemaNameList, 1, ARNameList);
	  Zero(&escalationTm, 1, AREscalationTmStruct);
	  schemaList.type = AR_WORKFLOW_CONN_SCHEMA_LIST;

ARS.xs  view on Meta::CPAN

	  char                    *helpText = CPNULL;
	  ARAccessNameType         owner;
	  char                    *ownerPtr = NULL;
	  char                    *changeDiary = CPNULL;
	  char                    *objectModificationLogLabel = NULL;
	  ARStatusList             status;
	  ARWorkflowConnectStruct  *schemaList = NULL;
	  ARPropList               *objPropList = NULL;
	  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(newName, 1, ARNameType);
	  Zero(owner, 1, ARAccessNameType);

	  if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
		ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
	  } else {
		HV *objDef = (HV *)SvRV(objDefRef);
		SV **qhv = hv_fetch(objDef,  "query", strlen("query") , 0);

ARS.xs  view on Meta::CPAN

	  ARImageDataStruct      imageBuf;
	  char                  *imageType   = CPNULL;
	  char                  *description = CPNULL;
	  char                  *helpText    = CPNULL;
	  ARAccessNameType       owner;
	  char                  *changeDiary = CPNULL;
	  ARPropList             objPropList;
	  char                  *objectModificationLogLabel = NULL;
  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(name, 1, ARNameType);
	  Zero(&imageBuf, 1,ARImageDataStruct);
	  Zero(owner, 1, ARAccessNameType);
	  Zero(&objPropList, 1, ARPropList);

	  if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
		ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
	  } else {
		HV *objDef = (HV *)SvRV(objDefRef);

ARS.xs  view on Meta::CPAN

	  }
	  if (description) {
	    	AP_FREE(description);
	  }
	  if (imageType) {
	    	AP_FREE(description);
	  }
	  FreeARImageDataStruct(&imageBuf, FALSE);
	  FreeARPropList(&objPropList, FALSE);
#else	/* prior to ARS 7.5 */
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
	  "ars_CreateImage() is only available in ARS >= 7.5");
	  XSRETURN_UNDEF;
#endif
	}
	OUTPUT:
	RETVAL

int

ARS.xs  view on Meta::CPAN

	  char                  *imageType   = CPNULL;
	  char                  *description = CPNULL;
	  char                  *helpText    = CPNULL;
	  ARAccessNameType       owner;
	  char                  *ownerPtr    = NULL;
	  char                  *changeDiary = CPNULL;
	  ARPropList            *objPropList = NULL;
	  char                  *objectModificationLogLabel = NULL;
	  
	  RETVAL = 0; /* assume error */
	  (void) ARError_reset();
	  Zero(&status, 1,ARStatusList);
	  Zero(newName, 1, ARNameType);
	  Zero(owner, 1, ARAccessNameType);

	  if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
		ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
	  } else {
		HV *objDef = (HV *)SvRV(objDefRef);

		/* copy the various hash entries into the appropriate

ARS.xs  view on Meta::CPAN

	  }
	  if (description) {
	    	AP_FREE(description);
	  }
	  if (imageType) {
	    	AP_FREE(description);
	  }
	  if( imageBuf != NULL )     { FreeARImageDataStruct(imageBuf, TRUE); }
	  if( objPropList != NULL )  { FreeARPropList(objPropList, TRUE);     }
#else	/* prior to ARS 7.5 */
	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
	  "ars_SetImage() is only available in ARS >= 7.5");
	  XSRETURN_UNDEF;
#endif
	}
	OUTPUT:
	RETVAL


ARS.xs  view on Meta::CPAN

	unsigned int		mergeType
	CODE:
	{
	  int              a, i, c = (items - 3) / 2;
	  ARFieldValueList fieldList;
	  ARStatusList     status;
	  int              ret = 0;
	  unsigned int     dataType = 0;
	  AREntryIdType    entryId;

	  (void) ARError_reset();
	  Zero(&status,    1, ARStatusList);
	  Zero(&fieldList, 1, ARFieldValueList);
	  Zero(&entryId, 1, AREntryIdType);
	  RETVAL = "";

	  if ((items - 3) % 2 || c < 1) {
	  	(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
	  	goto merge_entry_exit;
	  }

ARS.xs  view on Meta::CPAN

	ARInternalIdList  idList;
	ARFieldValueListList  fieldList;
	ARBooleanList     existList;
	ARStatusList      status;
	AV               *entryList_array;

	entryList.entryIdList = NULL;
	idList.internalIdList = NULL;
	fieldList.valueListList = NULL;
	existList.booleanList = NULL;
	(void) ARError_reset();
	Zero(&status, 1, ARStatusList);
	Zero(&entryList, 1, AREntryIdListList);
	Zero(&idList, 1, ARInternalIdList);
	Zero(&fieldList, 1, ARFieldValueListList);
	Zero(&existList, 1, ARBooleanList);
	/*
	 * build list of field Id's
	 */
	if (c < 1) {
		idList.numItems = 0; /* get all fields */

ARS.xs  view on Meta::CPAN

	{
	  ARStatusList     status;
	  unsigned int              c = (items - 5) / 2, i;
	  int              field_off = 5;
	  ARSortList       sortList;
	  AREntryListFieldValueList  entryFieldValueList;
	  int              ret = 0;
	  AREntryListFieldList getListFields, *getList = NULL;
	  AV              *getListFields_array;

	  (void) ARError_reset();
	  Zero(&status, 1, ARStatusList);
	  Zero(&sortList, 1, ARSortList);
	  Zero(&entryFieldValueList, 1, AREntryListFieldValueList);
	  Zero(&getListFields, 1, AREntryListFieldList);

	  sortList.sortList = NULL;
	  getListFields.fieldsList = NULL;
	  entryFieldValueList.entryList = NULL;
	  if ((items - 5) % 2) {
	    /* odd number of arguments, so argument after maxRetrieve is
	       optional getListFields (an array of hash refs) */
	    if ( SvROK(ST(field_off)) &&
	         (getListFields_array = (AV *)SvRV(ST(field_off))) &&
	         (SvTYPE(getListFields_array) == SVt_PVAV) ) {
	      getList = &getListFields;
	      getListFields.numItems = av_len(getListFields_array) + 1;
	      DBG( ("getListFields.numItems=%d\n", getListFields.numItems) );
	      /* Newz(777,getListFields.fieldsList, getListFields.numItems,AREntryListFieldStruct); */
	      getListFields.fieldsList = MALLOCNN( sizeof(AREntryListFieldStruct) * getListFields.numItems );
	      /* set query field list */
	      for (i=0; i<getListFields.numItems; i++) {
	        SV **array_entry;
	        /* get fieldID from array */
	        if (! (array_entry = av_fetch(getListFields_array, i, 0))) {
	          (void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_LFLDS);
	          goto getlistentry_end;
	        }
	        getListFields.fieldsList[i].fieldId = SvIV(*array_entry);
	        getListFields.fieldsList[i].columnWidth = 1;
	        strncpy(getListFields.fieldsList[i].separator, " ", 2 );
	        DBG( ("i=%d, fieldId=%d, columnWidth=%d, separator=\"%s\"\n", i,
	             getListFields.fieldsList[i].fieldId,
	             getListFields.fieldsList[i].columnWidth,
	             getListFields.fieldsList[i].separator) );
	      }
	    } else {
	      (void) ARError_add( AR_RETURN_ERROR, AP_ERR_LFLDS_TYPE);
	      goto getlistentry_end;
	    }
	    /* increase the offset of the first sortList field by one */
	    field_off ++;
	  }
	  /* build sortList */
	  sortList.numItems = c;
	  /* Newz(777,sortList.sortList, c,  ARSortStruct); */
	  sortList.sortList = MALLOCNN( sizeof(ARSortStruct) * c );
	  for (i=0; i<c; i++) {
	    sortList.sortList[i].fieldId = SvIV(ST(i*2+field_off));
	    sortList.sortList[i].sortOrder = SvIV(ST(i*2+field_off+1));
	  }

ARS.xs  view on Meta::CPAN

#endif
	ARMultiSchemaQualifierStruct     qualifierStruct;
	ARMultiSchemaSortList            sortList;
	unsigned int                     i;
	int                              i2, field_off = 6;
	int                              ret = 0, rv = 0;
	HV                               *hDummy;

	/* printf( "\n\n!!!! ars_GetListEntryWithMultiSchemaFields(): experimental implementation, not really working yet !!!!\n\n" ); */

	(void) ARError_reset();
#if AR_CURRENT_API_VERSION >= 17
	Zero( &queryFromList, 1, ARMultiSchemaFuncQueryFromList );
	Zero( &getListFields, 1, ARMultiSchemaFieldFuncList );
	Zero( &entryFieldValueList, 1, ARMultiSchemaFieldFuncValueListList );
#else
	Zero( &queryFromList, 1, ARMultiSchemaQueryFromList );
	Zero( &getListFields, 1, ARMultiSchemaFieldIdList );
	Zero( &entryFieldValueList, 1, ARMultiSchemaFieldValueListList );
#endif
	Zero( &qualifierStruct, 1, ARMultiSchemaQualifierStruct );

ARS.xs  view on Meta::CPAN

	hv_undef( hDummy );
#if AR_CURRENT_API_VERSION >= 17
	FreeARMultiSchemaFieldFuncList( &getListFields, FALSE );
	FreeARMultiSchemaFieldFuncValueListList( &entryFieldValueList, FALSE );
#else
	FreeARMultiSchemaFieldIdList( &getListFields, FALSE );
	FreeARMultiSchemaFieldValueListList( &entryFieldValueList, FALSE );
#endif
	FreeARMultiSchemaSortList( &sortList, FALSE );
#else	/* prior to ARS 7.5 */
	(void) ARError_reset();
	Zero(&status, 1, ARStatusList);
	(void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
	"ars_GetListEntryWithMultiSchemaFields() is only available in ARS >= 7.5");
#endif
	}



void
ars_SetLogging( ctrl, logTypeMask_arg, ...)

ARS.xs  view on Meta::CPAN

#if AR_CURRENT_API_VERSION >= 14
		ARULong32        whereToWriteMask = AR_WRITE_TO_STATUS_LIST;
		ARULong32        logTypeMask      = logTypeMask_arg;
#else
		unsigned long    whereToWriteMask = AR_WRITE_TO_STATUS_LIST;
		unsigned long    logTypeMask      = logTypeMask_arg;
#endif
		int	             ret;
		FILE             *logFilePtr = NULL;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);

		logFilePtr = get_logging_file_ptr();
		/* printf( "GET logging_file_ptr = %p\n", logFilePtr ); */

		if( items > 2 && logTypeMask != 0 ){
			char *fileName;
			STRLEN len;
			fileName = SvPV(ST(2),len);

ARS.xs  view on Meta::CPAN

			whereToWriteMask = AR_WRITE_TO_FILE;
			logFilePtr = fopen( fileName, "a" );

			if( logFilePtr == NULL ){
				char buf[2048];
				sprintf( buf, "Cannot open file: %s", fileName );
				(void) ARError_add( AR_RETURN_ERROR, AP_ERR_INV_ARGS, buf);
				XPUSHs(sv_2mortal(newSViv(0))); /* ERR */
				goto SetLogging_fail;
			}
			set_logging_file_ptr( logFilePtr );
			/* printf( "SET logging_file_ptr = %p\n", logFilePtr ); */
		}

		ret = ARSetLogging( ctrl, logTypeMask, whereToWriteMask, logFilePtr, &status );

		if( logTypeMask == 0 && logFilePtr != NULL ){
			fclose( logFilePtr );
			set_logging_file_ptr( NULL );
		}

		if(ARError(ret, status)) {
			XPUSHs(sv_2mortal(newSViv(0))); /* ERR */
		} else {
			XPUSHs(sv_2mortal(newSViv(1))); /* OK */
		}
	SetLogging_fail:;
#else /* < 4.5 */
	  XPUSHs(sv_2mortal(newSViv(0))); /* ERR */

ARS.xs  view on Meta::CPAN

	unsigned int      variableId
	long              value
	PPCODE:
	{
#if AR_EXPORT_VERSION >= 6
		ARStatusList     status;
		ARValueStruct    variableValue;
		int	             ret;
		char             numToCharBuf[32];

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);

		variableValue.dataType = AR_DATA_TYPE_INTEGER;
		variableValue.u.intVal = value;
		
		if (variableId == 12 || variableId == 13)
		{
			// just a quick and dirty solution because those variables need to be characters
			sprintf(numToCharBuf, "%ld", value);
			variableValue.dataType = AR_DATA_TYPE_CHAR;

ARS.xs  view on Meta::CPAN

void
ars_SetImpersonatedUser( ctrl, impersonatedUser )
	ARControlStruct *	ctrl
	ARAccessNameType  impersonatedUser
	PPCODE:
	{
#if AR_EXPORT_VERSION >= 9
		ARStatusList     status;
		int	             ret;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);

		if( strcmp("",impersonatedUser) == 0 ){
			ret = ARSetImpersonatedUser( ctrl, NULL, &status );
		}else{
			ret = ARSetImpersonatedUser( ctrl, impersonatedUser, &status );
		}

		if(ARError(ret, status)) {
			XPUSHs(sv_2mortal(newSViv(0))); /* ERR */

ARS.xs  view on Meta::CPAN


void
ars_BeginBulkEntryTransaction( ctrl )
	ARControlStruct *	ctrl
	PPCODE:
	{
#if AR_CURRENT_API_VERSION >= 11
		ARStatusList     status;
		int	             ret;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);

		ret = ARBeginBulkEntryTransaction( ctrl, &status );

		if( ARError(ret, status) ){
			XPUSHs(sv_2mortal(newSViv(0))); /* ERR */
		}else{
			XPUSHs(sv_2mortal(newSViv(1))); /* OK */
		}
#else /* < 6.3 */

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	unsigned int      actionType
	PPCODE:
	{
#if AR_CURRENT_API_VERSION >= 11
		int	             ret;
		ARStatusList     status;
		ARBulkEntryReturnList returnList;
		unsigned int i;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		Zero(&returnList, 1, ARBulkEntryReturnList);

		ret = AREndBulkEntryTransaction( ctrl, actionType, &returnList, &status );

		ARError( ret, status );

		for( i = 0; i < returnList.numItems; i++ ){
			XPUSHs( sv_2mortal( perl_ARBulkEntryReturn(ctrl,&(returnList.entryReturnList[i])) ) );
		}

ARS.xs  view on Meta::CPAN

ars_Signal( ctrl, ...)
	ARControlStruct *	ctrl
	PPCODE:
	{
#if AR_CURRENT_API_VERSION >= 9
		int	             ret;
		ARSignalList     signalList;
		ARStatusList     status;
		unsigned int     c = (items - 1) / 2, i = 0, a = 0, ok = 1;

		(void) ARError_reset();
		Zero(&signalList, 1, ARSignalList);
		Zero(&status, 1, ARStatusList);

		if( ((items - 1) % 2) || c < 1 ){
			(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
		}else{
			signalList.numItems = c;
			AMALLOCNN(signalList.signalList,c,ARSignalStruct);
			for( i = 0; i < c; ++i ){
				int st;

ARS.xs  view on Meta::CPAN

#endif
	}


SV *
ars_GetTextForErrorMessage(msgId)
	int  msgId
	CODE:
	{
		char *msgTxt = NULL;
		(void) ARError_reset();

		msgTxt = ARGetTextForErrorMessage( msgId );
		if( msgTxt != NULL ){
			RETVAL = newSVpv( msgTxt, 0 );
			free( msgTxt );
		}else{
			XSRETURN_UNDEF;
		}
	}
	OUTPUT:

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	PPCODE:
	{
		ARStatusList            status;
		ARLicenseNameList       licNameList;
		ARLicenseValidList      licValidList;
		int                     ret = 0;
		unsigned int            ui = 0, count = 0;
		unsigned int            c = items - 1, i = 0, a = 0, ok = 1;

		(void) ARError_reset();
		Zero(&status, 1,ARStatusList);
		Zero(&licNameList, 1, ARLicenseNameList);
		Zero(&licValidList, 1, ARLicenseValidList);
		if( items > 1){
			licNameList.numItems = c;
			AMALLOCNN(licNameList.nameList,c,ARLicenseNameType);
			for( i = 0; i < c; ++i ){
				a = i + 1;
				strncpy( licNameList.nameList[i], SvPV(ST(a),PL_na), AR_MAX_LICENSE_NAME_SIZE );
			}

ARS.xs  view on Meta::CPAN

	int         month;
	int         day;
	CODE:
	{
#if AR_CURRENT_API_VERSION >= 9
		int     ret = 0;
		int     jd  = 0;
		ARDateStruct  date;
		ARStatusList  status;

		(void) ARError_reset();
		Zero(&date, 1, ARDateStruct);
		Zero(&status, 1, ARStatusList);

		date.year  = year;
		date.month = month;
		date.day   = day;

		ret = ARDateToJulianDate(ctrl, &date, &jd, &status);
		if (! ARError( ret, status)) {
			RETVAL = jd;

ARS.xs  view on Meta::CPAN

SV *
ars_GetServerCharSet( ctrl )
	ARControlStruct *	ctrl
	CODE:
	{
#if AR_CURRENT_API_VERSION >= 12
		char          charSet[AR_MAX_LANG_SIZE+1];
		ARStatusList  status;
		int           ret = 0;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		RETVAL = NULL;

		ret = ARGetServerCharSet( ctrl, charSet, &status );
		if( ! ARError(ret,status) ){
			RETVAL = newSVpv( charSet, 0 );
		}
#else /* < 7.0 */
		RETVAL = NULL; /* ERR */
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, 

ARS.xs  view on Meta::CPAN

SV *
ars_GetClientCharSet( ctrl )
	ARControlStruct *	ctrl
	CODE:
	{
#if AR_CURRENT_API_VERSION >= 12
		char          charSet[AR_MAX_LANG_SIZE+1];
		ARStatusList  status;
		int           ret = 0;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		RETVAL = NULL;

		ret = ARGetClientCharSet( ctrl, charSet, &status );
		if( ! ARError(ret,status) ){
			RETVAL = newSVpv( charSet, 0 );
		}
#else /* < 7.0 */
		RETVAL = NULL; /* ERR */
		(void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, 

ARS.xs  view on Meta::CPAN

int
ars_RegisterForAlerts(ctrl, clientPort, registrationFlags=0)
	ARControlStruct *	ctrl
	int			clientPort
	unsigned int		registrationFlags
	CODE:
	{
		ARStatusList status;
		int          ret = 0;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		RETVAL = 0;
#if AR_EXPORT_VERSION >= 6
		ret = ARRegisterForAlerts(ctrl, clientPort, 
				registrationFlags, &status);
		if( !ARError(ret, status) ) {
			RETVAL = 1;
		}
#else
	  (void) ARError_add(AR_RETURN_ERROR, AP_ERR_DEPRECATED, 

ARS.xs  view on Meta::CPAN


int
ars_DeregisterForAlerts(ctrl,clientPort)
	ARControlStruct *	ctrl
	int			clientPort
	CODE:
	{
		ARStatusList status;
		int          ret = 0;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		RETVAL = 0;
#if AR_EXPORT_VERSION >= 6
		ret = ARDeregisterForAlerts(ctrl, clientPort, 
					    &status);
		if( !ARError(ret, status) ) {
			RETVAL = 1;
		}
#else
	  (void) ARError_add(AR_RETURN_ERROR, AP_ERR_DEPRECATED, 

ARS.xs  view on Meta::CPAN

void
ars_GetListAlertUser(ctrl)
	ARControlStruct *	ctrl
	PPCODE:
	{
#if AR_EXPORT_VERSION >= 6
		ARStatusList     status;
		ARAccessNameList userList;
		int              ret = 0;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
	 	Zero(&userList, 1, ARAccessNameList);
		ret = ARGetListAlertUser(ctrl, &userList,
					 &status);
		if( !ARError(ret, status) ) {
			if (userList.numItems > 0) {
				unsigned int i = 0;
				while(i < userList.numItems) {
					XPUSHs(sv_2mortal(newSVpvn(userList.nameList[i++], 
							AR_MAX_NAME_SIZE)));

ARS.xs  view on Meta::CPAN

	ARControlStruct *	ctrl
	ARQualifierStruct *	qualifier
	CODE:
	{
		ARStatusList     status;
		int              ret = 0;
		unsigned int	 count = 0;

		RETVAL=newSVsv(&PL_sv_undef);
#if AR_EXPORT_VERSION >= 6
		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		ret = ARGetAlertCount(ctrl, qualifier, &count,
				      &status);
		if( !ARError(ret, status) ) {
			/* RETVAL=sv_2mortal(newSViv(count)); */
			RETVAL = newSViv(count);
		}
#else
	  (void) ARError_add(AR_RETURN_ERROR, AP_ERR_DEPRECATED, 
			"GetAlertCount() is only available in ARSystem >= 5.0");

ARS.xs  view on Meta::CPAN

		unsigned int	 sourceType = 0;
		unsigned int	 priority = 0;
		char 		*alertText  = CPNULL;
		char		*sourceTag  = CPNULL;
		char		*serverName = CPNULL;
		char		*serverAddr = CPNULL;
		char		*formName   = CPNULL;
		char 		*objId      = CPNULL;

		RETVAL=newHV();
		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		Zero(&timestamp, 1, ARTimestamp);
#if AR_EXPORT_VERSION >= 6
		ret = ARDecodeAlertMessage(ctrl, message, messageLen,
					&timestamp,
					&sourceType,
					&priority,
					&alertText,
					&sourceTag,
					&serverName,

ARS.xs  view on Meta::CPAN

	ARServerNameType	serverName
	ARNameType		formName
	char *			objectId
	CODE:
	{
		ARStatusList     status;
		int              ret = 0;
		AREntryIdType	 entryId;

		RETVAL=newSVsv(&PL_sv_undef);
		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		Zero(&entryId, 1, AREntryIdType);
#if AR_EXPORT_VERSION >= 6
		ret = ARCreateAlertEvent(ctrl, 
					user,
					alertText,
					priority,
					sourceTag,
					serverName,
					formName,

ARS.xs  view on Meta::CPAN

MODULE = ARS		PACKAGE = ARControlStructPtr

void
DESTROY(ctrl)
	ARControlStruct *	ctrl
	CODE:
	{
		ARStatusList status;
		int rv = 0;

		(void) ARError_reset();
		Zero(&status, 1, ARStatusList);
		DBG( ("control struct destructor\n") );
# if AR_EXPORT_VERSION >= 4
		rv = ARTermination(ctrl, &status);
# else
		rv = ARTermination(&status);
# endif /* AR_EXPORT_VERSION */
		(void) ARError(rv, status);
#ifdef PROFILE
		AP_FREE(ctrl);

ARS/OOform.pm  view on Meta::CPAN

	if(($rv eq "") && defined($realmap{1})) {
		if(!$this->{'connection'}->hasFatals() &&
		   !$this->{'connection'}->hasErrors()) {
			$rv = $realmap{1};
		}
	}
		   
	return $rv;
}

# set(-entry => id, -gettime => tstamp, -values => { field1 => value1, ... })

sub set {
    my ($this) = shift;
    my ($entry,$gettime,$vals) = 
      ARS::rearrange([ENTRY,GETTIME,[VALUE,VALUES]],@_);
    
    $gettime = 0 unless defined($gettime);
    
    $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR,
				       81000,
				       "usage: form->set(-entry => id, -gettime => tstamp, -values => { field1 => value1, ... })\nentry and values parameters are required."
				       )
	unless (defined($vals) && defined($entry));
    
    $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR,
				       81000,
				       "usage: form->set(-entry => id, -values => { field1 => value1, ... })\nvalues parameter must be HASH ref.") 
	unless ref($vals) eq "HASH";
    
    my (%realmap);
    
    # as we work thru each value, we need to perform translations for
    # enum fields.
    
    foreach (keys %{$vals}) {
	my ($rv) = $this->value2internal(-field => $_,
					 -value => $vals->{$_});

ARS/OOform.pm  view on Meta::CPAN

	return $rv;
    } 
    
    return  ARS::ars_GetEntryBLOB($this->{'connection'}->{'ctrl'},
				  $this->{'form'},
				  $eid,
				  $this->getFieldID($field),
				ARS::AR_LOC_BUFFER);
}

#setSort(... )

sub setSort {
    my $this = shift;
    
    if(($#_+1) % 2 == 1){
	$this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR,
					   81000,
					   "usage: setSort(...)\nMust have an even number of parameters. (nparm = $#_)");
    }
    
    my (@t) = @_;
    
    for(my $i = 0 ; $i <= $#t ; $i+=2) {
	$t[$i] = $this->getFieldID($t[$i]);
    }
    
    $this->{'sortOrder'} = \@t;
}

ARS/OOmsgs.pm  view on Meta::CPAN

# 81002 = Invalid Field ID
# 81003 = Unknown Field Data Type
# 81004 = Unable to Xlate Enum Value
# 81005 = misspelled/invalid parameter

# .catch is a hash ref

sub initCatch {
  my $this = shift;

  $this->setCatch(&ARS::AR_RETURN_WARNING => "internalWarn");
  $this->setCatch(&ARS::AR_RETURN_ERROR   => "internalDie");
  $this->setCatch(&ARS::AR_RETURN_FATAL   => "internalDie");
}

sub setCatch {
  my $this = shift;
  my $type = shift;
  my $func = shift;

  $this->{'.catch'}->{$type} = $func;
}

# this routine is periodically called to see if any exceptions
# have occurred. if they have, and an exception handler is specified,
# we will call the handler and pass it the exception.

ARS/nparm.pm  view on Meta::CPAN

    Carp::confess( "invalid named parameter \"$key\"" ) if $#t == -1;
  }  

  my(@return_array);

  foreach $key (@$order) {
    #print "key=$key\n";

    my($value);
    # this is an awful hack to fix spurious warnings when the
    # -w switch is set.
    if (ref($key) && ref($key) eq 'ARRAY') {
      foreach (@$key) {
	last if defined($value);
	$value = $param->{$_};
	delete $param->{$_};
      }
    } else {
      $value = $param->{$key};
      delete $param->{$key};
    }

CHANGES  view on Meta::CPAN

 (TS)   added "name" value to schemaHash returned by ars_GetSchema

 (TS)   fixed rev_ARArchiveInfo Struct, moved function from supportrev_generated.c to supportrev.c

 (TS)   changed $ARS_LIBS variable for 7.0 Unix API in Makefile.pl (-licuuc -> -licuucbmc)


Released: 03/12/2007 Version: 1.90


 (TS)   added missing ARError_reset() to ars_GetListVUI

 (TS)   added ars_CreateCharMenu, ars_SetCharMenu

 (TS)   added handling of case AR_CHAR_MENU_LIST in ars_GetCharMenu

 (TS)   changed handling of qualifier struct in ars_GetCharMenu, case AR_CHAR_MENU_QUERY

 (TS)   corrected function signature for ars_SetField, ars_CreateContainer

 (TS)   bugfix in ars_GetCharMenu (incorrect array length for "labelFields", "labelIndex")

CHANGES  view on Meta::CPAN

        compilation problems on Solaris

 (TS)   added ars_BeginBulkEntryTransaction, ars_EndBulkEntryTransaction

 (TS)   added AR_FIELD_OFFSET handling in perl_ARFieldValueOrArithStruct (support.c)

 (TS)   added ars_SetSessionConfiguration

 (TS)   completed sv_to_ARCurrencyStruct (support.c)

 (TS)   ARS.pm: set $ARS::logging_file_ptr = 0 to avoid "uninitialized" warning 

 (TS)   changed t/01import.t to import form "ARSperl Test3"

 (TS)   added ars_CreateContainer, ars_SetContainer

 (TS)   added ars_CreateFilter, ars_SetFilter, ars_CreateEscalation, ars_SetEscalation,
        ars_SetActiveLink

 (TS)   added declaration of boolcpyHVal(...) to supportrev.h

CHANGES  view on Meta::CPAN



Released: 09/20/2005 Version: 1.85


 (TS)   added binmode-statements in t/10entry.t (test failed on win32)

 (TS)   warning cleanup in test files (t/02export.t, t/13join.t)

 (TS)   added ars_SetLogging (changes to ARS.xs, ARS.pm, support.c, support-h.template,
        html/manual/toc.html;  new files: html/manual/ars_SetLogging.html, t/21setlogging.t)

 (TS)   fixed pointer dereferencing error in supportrev.c:strmakHval

 (TS)   fixed supportrev.c:strcasecmp, strncasecmp; failure to differentiate between 
        string and substring (e.g. "page_holder" and "page")

 (TS)   fixed support.c:perl_ARByteList (Bug ID 1213180)
        (David Lindes {lindes at users.sourceforge.net})

 (TS)   added support for DATA_TYPE_CURRENCY to perl_ARFieldLimitStruct

CHANGES  view on Meta::CPAN


(JCM)   tested/fixed compiling against pre-4.0 apis. 

(JCM)   OO: now checks named params to ensure you don't
        mis-spell them.

(JCM)   attachment allows specify a 'name' hash key so you can
        customize the name that appears in the attachment field
        in the usertool.  (Nick Stoughton {NickS at ISRWORLD.com})

(JCM)   OO: form->setSort method added

(JCM)   OO: better error handling/catching

(JCM)   OO: fixed bug in value2internal

(JCM)   fixed NTRegisterServer(), fixed example/3.x/Notifier.pl

(JCM)   OO: fixed ARS::AR_RETURN_* bugs { erik.dorfman at intelsat.int }

(JCM)   fixed bug in ars_GetListServer() for api >= 4.0

CHANGES  view on Meta::CPAN



(JCM)   added ars_GetListEntry.pl example to show how to use
        custom query-list fields.

(JCM)   numerous documentation updates by {D.J.Adams at soton.ac.uk}

(JCM)   fixed bug in macroParm decoding. {D.J.Adams at soton.ac.uk}

(JCM)   fixed bug when decoding results of GetFilter/GetActiveLink
        in regards to set fields actions: values assigned to
        diary fields were not being interpretted correctly.
        {D.J.Adams at soton.ac.uk}

(JCM)   patched perl_BuildEntryIdList to make it more robust
        (Ulrich Pfeifer {pfeifer at wait.de})

(JCM)   patched ars_GetCharMenu for bug "GetCharMenu doesn't
        return a qualifier for query menus" {D.J.Adams at soton.ac.uk}

(JCM)   fixed dup_FieldValueOrArith to support decoding of

CHANGES  view on Meta::CPAN

Released: 11/11/96 Version: 1.31


(JCM)   minor stuff: added an ifndef in the GetCharMenu routine
        for ars 2.0 users. 2.0 doesnt support SQL menu constructions.


Released: 11/11/96 Version: 1.3


(JWM)   undef works in setEntry now.

(JWM)   added ars_Import to complement ars_Export

(JCM)   Profiling code added to keep track of number of
        queries made.

(JWM)   Field caching code added to make some of the functions
        more efficient.

(JCM)   New functions: ars_GetFilter(), ars_GetCharMenu(), 

INSTALLATION  view on Meta::CPAN


Please see:  https://rrr.se/cgi/index?pg=arapi   
for a pre-packaged archive of API libraries
(it is also possible to pull all of this together on your own if you have access
to /opt/bmc/ARSystem on your ARS server)

Note for Linux 64-bit:
The expansion of the rrr.se targzip's will result in a directory similar to 
"api764sp5linux" depending on the version of the API. The actual AR System 
libraries as provided by Remedy need to be found by the linker in the lib 
subdirectory of the $ARSAPI variable value set in Makefile.PL and with shortened 
names as follows.

Example:

cp api764sp5linux/bin/* api764sp5linux/lib
cd api764sp5linux/lib
ln -s libicudatabmc.so.32 libicudatabmc.so
ln -s libicui18nbmc.so.32 libicui18nbmc.so
ln -s libicuiobmc.so.32 libicuiobmc.so
ln -s libicuucbmc.so.32 libicuucbmc.so

MANIFEST  view on Meta::CPAN

html/manual/ars_GetListUser.html
html/manual/ds_prop_hash.html
html/manual/ars_decodeStatusHistory.html
html/manual/ars_DeleteCharMenu.html
html/manual/ars_Import.html
html/manual/ars_RegisterForAlerts.html
html/changes.html
html/debug.html
html/DumpSetup.html
Makefile
t/33setcontainer.t
t/40createcharmenu.t
t/01import.t
t/20merge.t
t/31createschema.t
t/35setactlink.t
t/aptest.def
t/10getescalation.t
t/21setlogging.t
t/34createactlink.t
t/00connect.t
t/aptest45.def
t/02export.t
t/38createescalation.t
t/32createcontainer.t
t/aptest51.def
t/41setcharmenu.t
t/09qualifier.t
t/37setfilter.t
t/10getftinfo.t
t/36createfilter.t
t/39setescalation.t
t/10alink.t
t/11entry.t
t/aptest40.def
t/10getlist.t
t/aptest50.def
t/12lotsoffields.t
t/10entry.t
t/config.cache
t/13join.t
TODO

Makefile.PL  view on Meta::CPAN


# STEP 4 -> Some additional compilation options
#  
#   Change this only if you have good reason to do so.
#
%ADVANCED_CONFIG = (
	
	# you might try this if you experience memory violations
	UNDEF_PERL_MALLOC       => 0,

	# set to 1 if you need a backwards compatible version of ars_GetListGroup
	# (see the manual page of ars_GetListGroup for a more specific description)
	GETLISTGROUP_OLD_STYLE  => 0,
);


##############################
# unless you run into problems, you shouldn't need to read any further.
# if you do run into problems, and don't really know what this file
# does, try subscribing to the mailing list and ask for help there.
# subscription information is available at http://www.arsperl.org/

Makefile.PL  view on Meta::CPAN

#    -DARS32
#       If you are compiling against ARS 3.2 API libraries defined this
#       because AdminExtension API routines were removed in as of
#       the 3.2 release.
#
#    -D_WIN32
#
#       If you are compiling ARSperl under windows, define this
#       and /don't/ define PROFILE.
#
#    -DSKIP_SV_ISA  (not automatically set)
#
#       If you get errors during compilation/runtime similar to 
#       "undefined symbol: sv_isa" then add this define.

	      'DEFINE'	=> ${AUTODEFINES},
#             'DEFINE'  => '-D_WIN32 ', # note: win32 -> no -DPROFILE


# if you have trouble under solaris when linking (bfd assertion 
# failures) try uncommenting the following:

Makefile.PL  view on Meta::CPAN

sub ARS_VERSION_63  { 11; }
sub ARS_VERSION_70  { 12; }
sub ARS_VERSION_71  { 13; }
sub ARS_VERSION_75  { 14; }
sub ARS_VERSION_760 { 15; }
sub ARS_VERSION_762 { 16; }
sub ARS_VERSION_763 { 17; }
sub ARS_VERSION_764 { 18; }
sub ARS_VERSION_80  { 19; }
sub ARS_VERSION_81  { 20; }
## @Devs: set the following constant always to the latest version supported by ARSPerl
sub ARS_MAX_API { ARS_VERSION_81; }

sub ARSVersionString {
	my $APIVersionID = shift;
	my $api2Version = {
		&ARS_VERSION_45 => '4.5',
		&ARS_VERSION_50 => '5.0',
		&ARS_VERSION_51 => '5.1',
		&ARS_VERSION_60 => '6.0',
		&ARS_VERSION_63 => '6.3',

RELNOTES  view on Meta::CPAN

and there are things that have changed only if you are compiling against
v4.0 (or greater).

First, regardless of what version of ARS you are compiling this against,
ars_perl_qualifier now takes a control struct (in addition to the  
encoded qualifier). When compiled against pre-4.0 APIs, the control struct
parameter is still required, but is ignored. IF YOU USE THIS ROUTINE IN 
EXISTING SCRIPTS, THEY WILL NEED TO BE CHANGED.

Previously, when perl executed "use ARS;" it would automatically trigger a
call to  ARS::__ars_init(). This routine was im`ortant for setting up
system specific stuff as well as preparing to connect to a private
server. Now this routine is part of ars_Login() because, as of 4.0, we need
the control structure that ars_Login() generates in order to call
ARInitialization (a.k.a. __ars_init). The __ars_init() routine is still
there and is callable, but doesn't do anything if you compile against ARS>=4.0

Similiarly, when your perl script exitted, ARS::__ars_Termination() was 
automatically called for you. This can no longer be done because we, once
again, need the control structure when we are cleaning up (to release licenses,
etc). So, the functionality of this routine is now rolled into ars_Logoff().

RELNOTES  view on Meta::CPAN


The GetServerStatistics function was added to provide a simpler method
for checking server health. I might provide a server analysis tool 
built around this function in a future release. 

Joel added a cache to the internal GetField routine. This should cut
down on the number of queries made by some of the functions like
GetFieldTable and such.

In addition, doing ars_SetEntry($ctrl, ..., $fieldId, undef) will now
correctly set a field to $NULL$

1.0 Beta User Notes
-------------------

   o The library and extension seem fairly stable. However, bugs and
     memory leaks might still occur. We've only been able to build it
     under Solaris 2.x (4 and 5 to be specific) because that is what we
     run ARS under. Users who attempt builds on other systems and are
     successful should submit diffs back to us so that they can be 
     incorporated into the distribution.

StructDef.pl  view on Meta::CPAN

	valueField => {
		_type => 'ARInternalId',
		_data => 'p->valueField',
	},
	multi => {
		_type => 'unsigned int',
		_data => 'p->multiMatchCode',
		_map  => {
			AR_QUERY_VALUE_MULTI_ERROR => 'error',
			AR_QUERY_VALUE_MULTI_FIRST => 'first',
			AR_QUERY_VALUE_MULTI_SET   => 'set',
		},
	},
},
ARValueList => {
	_num  => 'p->numItems',
	_list => 'p->valueList',
	_type => 'ARValueStruct',
},
ARValueStruct => {
	_typeparam   => 1,

StructDef.pl  view on Meta::CPAN

		AR_FILTER_ACTION_LOG => {
			log => {
				_type => 'char*',
				_data => 'p->u.logFile',
			},
		},
		AR_FILTER_ACTION_FIELDS => {
			_min_version => '6.0.0',
			assign_fields => {
				_type => 'ARSetFieldsActionStruct',
				_data => 'p->u.setFields',
			},
		},
		'AR_FILTER_ACTION_FIELDS+' => {
			_max_version => '5.1.2',
			assign_fields => {
				_type => 'ARFieldAssignList',
				_data => 'p->u.fieldList',
			},
		},
		AR_FILTER_ACTION_PROCESS => {

StructDef.pl  view on Meta::CPAN

	_min_version => '6.3.0',
	_switch => 'p->entryCallType',
	_case => {
		AR_BULK_ENTRY_CREATE => {
			createEntryReturn => {
				_type => 'AREntryReturn',
				_data => 'p->u.createEntryReturn',
			},
		},
		AR_BULK_ENTRY_SET => {
			setEntryReturn => {
				_type => 'ARStatusList',
				_data => 'p->u.setEntryReturn',
			},
		},
		AR_BULK_ENTRY_DELETE => {
			deleteEntryReturn => {
				_type => 'ARStatusList',
				_data => 'p->u.deleteEntryReturn',
			},
		},
		AR_BULK_ENTRY_MERGE => {
			mergeEntryReturn => {

TODO  view on Meta::CPAN

   o clean up documentation (replace numbers with symbolic
     constants).
-----------------------------------------------
   o add additional OO support.

   o add sort order option to OO
   o obey vui name
   o pad out entry id where applicable.
   o allow for field id's to be specified if user chooses.
   o status history conversion?
   o allow for either/or enumer text or enum value in set/create
   o if unknown param, error
-----------------------------------------------



Howdy everyone:
  Please forgive me if this question is a bit naive, I'm still new to the
universe of Remedy and such ... 

I'm looking for a perl library which could take standard ARS/Remedy style

changes.dat  view on Meta::CPAN

TS  changed type of "owner" attribute: ARNameType -> ARAccessNameType
TS  corrected function signature for ars_SetVUI, ars_CreateSchema
TS  fixed memory leak in sv_to_ARValue (support.c)
TS  fixed memory leak in ars_GetMultipleEntries, ars_GetListEntryWithFields
      XPUSHs(newRV_noinc(...)) -> XPUSHs(sv_2mortal(newRV_noinc(...)))
TS  added "name" value to schemaHash returned by ars_GetSchema
TS  fixed rev_ARArchiveInfo Struct, moved function from supportrev_generated.c to supportrev.c
TS  changed $ARS_LIBS variable for 7.0 Unix API in Makefile.pl (-licuuc -> -licuucbmc)

released=03/12/2007 version=1.90
TS  added missing ARError_reset() to ars_GetListVUI
TS  added ars_CreateCharMenu, ars_SetCharMenu
TS  added handling of case AR_CHAR_MENU_LIST in ars_GetCharMenu
TS  changed handling of qualifier struct in ars_GetCharMenu, case AR_CHAR_MENU_QUERY
TS  corrected function signature for ars_SetField, ars_CreateContainer
TS  bugfix in ars_GetCharMenu (incorrect array length for "labelFields", "labelIndex")
TS  added ars_SetImpersonatedUser
TS  bugfix in ARError (support.c, memory violation if appendedText == NULL)
TS  ars_SetLogging: changed declaration "int len" to "STRLEN len" because of 
    compilation problems on Solaris
TS  added ars_BeginBulkEntryTransaction, ars_EndBulkEntryTransaction
TS  added AR_FIELD_OFFSET handling in perl_ARFieldValueOrArithStruct (support.c)
TS  added ars_SetSessionConfiguration
TS  completed sv_to_ARCurrencyStruct (support.c)
TS  ARS.pm: set $ARS::logging_file_ptr = 0 to avoid "uninitialized" warning 
TS  changed t/01import.t to import form "ARSperl Test3"
TS  added ars_CreateContainer, ars_SetContainer
TS  added ars_CreateFilter, ars_SetFilter, ars_CreateEscalation, ars_SetEscalation,
    ars_SetActiveLink
TS  added declaration of boolcpyHVal(...) to supportrev.h
TS  added declaration of revTypeName(...) to supportrev.h
TS  added "rev_ARReferenceStruct" to supportrev.c
TS  changed perl_ARReferenceStruct (added "value_dataType" key, necessary for
    ars_CreateContainer)
TS  changed ars_CreateActiveLink to read "schemaList" from alDef struct

changes.dat  view on Meta::CPAN

TS  minor fix in in rev_ARValueStructKW2KN (*keyword == '\0')
TS  minor fix in rev_ARCoordList_helper ( if (hv_exists("x"... )
TS  changed handling of keyword values in rev_ARValueStruct
    (assume "keyword" if first character == '\0' and length > 0)  
JCM minor update to example scripts Dump_User*.pl

released=09/20/2005 version=1.85
TS  added binmode-statements in t/10entry.t (test failed on win32)
TS  warning cleanup in test files (t/02export.t, t/13join.t)
TS  added ars_SetLogging (changes to ARS.xs, ARS.pm, support.c, support-h.template,
    html/manual/toc.html;  new files: html/manual/ars_SetLogging.html, t/21setlogging.t)
TS  fixed pointer dereferencing error in supportrev.c:strmakHval
TS  fixed supportrev.c:strcasecmp, strncasecmp; failure to differentiate between 
    string and substring (e.g. "page_holder" and "page")
TS  fixed support.c:perl_ARByteList (Bug ID 1213180)
    (David Lindes {lindes at users.sourceforge.net})
TS  added support for DATA_TYPE_CURRENCY to perl_ARFieldLimitStruct
TS  added function perl_ARCurrencyDetailList
TS  fixed support.c:my_strtok, perl_BuildEntryList
    (ars_GetEntry crashed when retrieving join form entries)
TS  added preprocessor directives (ARS.xs, support.c, support-h.template)

changes.dat  view on Meta::CPAN

JCM  added support for data type "decimal" when performing
     (Set|Create)Entry

released=04/7/99 version=1.6403 BETA
JCM  tested/fixed compiling against pre-4.0 apis. 
JCM  OO: now checks named params to ensure you don't
           mis-spell them.
JCM  attachment allows specify a 'name' hash key so you can
           customize the name that appears in the attachment field
           in the usertool.  (Nick Stoughton {NickS at ISRWORLD.com})
JCM  OO: form->setSort method added
JCM  OO: better error handling/catching
JCM  OO: fixed bug in value2internal
JCM  fixed NTRegisterServer(), fixed example/3.x/Notifier.pl
JCM  OO: fixed ARS::AR_RETURN_* bugs { erik.dorfman at intelsat.int }
JCM  fixed bug in ars_GetListServer() for api &gt;= 4.0

released=03/12/99 version=1.6400 BETA
JCM  added new LIBS line to Makefile.PL to cover NCR Unix
           ("Hill, David K" {david.k.hill at intel.com})
JCM  added ars_GetEntryBLOB (attachment field handling) 

changes.dat  view on Meta::CPAN

released=03/31/98 version=1.56
JCM  fixed a problem caused by some debugging code that
           was left in 1.55 accidentally.

released=03/30/98 version=1.55
JCM  added ars_GetListEntry.pl example to show how to use
           custom query-list fields.
JCM  numerous documentation updates by {D.J.Adams at soton.ac.uk}
JCM  fixed bug in macroParm decoding. {D.J.Adams at soton.ac.uk}
JCM  fixed bug when decoding results of GetFilter/GetActiveLink
           in regards to set fields actions: values assigned to
           diary fields were not being interpretted correctly.
           {D.J.Adams at soton.ac.uk}
JCM  patched perl_BuildEntryIdList to make it more robust
           (Ulrich Pfeifer {pfeifer at wait.de})
JCM  patched ars_GetCharMenu for bug "GetCharMenu doesn't
          return a qualifier for query menus" {D.J.Adams at soton.ac.uk}
JCM  fixed dup_FieldValueOrArith to support decoding of
           query style menus. 

released=02/09/98 version=1.54

changes.dat  view on Meta::CPAN

JWM bug fixes for 1.32beta

released=02/10/97        version=1.32beta
JWM 3.0 integration

released=11/11/96        version=1.31
JCM minor stuff: added an ifndef in the GetCharMenu routine
            for ars 2.0 users. 2.0 doesnt support SQL menu constructions.

released=11/11/96	version=1.3
JWM undef works in setEntry now.
JWM added ars_Import to complement ars_Export
JCM Profiling code added to keep track of number of
	    queries made.
JWM Field caching code added to make some of the functions
	    more efficient.
JCM New functions: ars_GetFilter(), ars_GetCharMenu(), 
		ars_GetServerStatistics
JWM Internal GetField call now caches results to minimize
		number of queries made.
JCM Examples of new functions. 

example/AddUsersToGroup.pl  view on Meta::CPAN

    # If there is no record for this user, say so and conitue with the next one
    if ( !@userentry ) { print "No user $_\n"; next; }

# Get the value of the Group List field. Syntax = ars_GetEntry(ctrl, schema, eid [field ID...n])
# so in this case we only get the value returned for one field ID, the Group List
# If you do not specify field ID's, you will get all values for the whole entry.
    my %uservalues =
      ars_GetEntry( $ctrl, "User", $userentry[0], $userfields{'Group List'} );

    # Get the field values for this entry
    # set $currentgrouplist to the contents of the Group List field
    my $currentgrouplist = $uservalues{ $userfields{'Group List'} };

#if the Group List already contains the group, say so and continue with  next user
    if (
        (
               ( $currentgrouplist =~ /^$group_id;/ )
            || ( $currentgrouplist =~ /;$group_id;/ )
        )
      )
    {

example/ChangePassword.pl  view on Meta::CPAN

#!/usr/bin/perl

#
# NAME
#  ChangePassword.pl server username password newpassword
#
# DESCRIPTION
#  This script allows a user to change his password. Since user accounts are just
#  plain records in a form we use the common getlistentry and setentry calls to
#  fetch the user's record and update the password field.
#  Note that on some systems permissions are set strangely and depending on
#  the type of license you have you might not be able to update your password
#  (Think Read Restricted licenses...)
#  Also on some systems the User form is renamed to something other than "User".
#
# AUTHOR
#  Michiel Beijen, Mansolutions, 2007.
#

use ARS;
use strict;

example/ChangePassword.pl  view on Meta::CPAN


# Creating qualifier to look up the entry ID of the username; Login Name field is 101.
( my $userqualifier = ars_LoadQualifier( $ctrl, "User", "'101' = \"$user\"" ) )
  || die "ars_LoadQualifier(User): $ars_errstr";

# fetch the Entry ID for this user by using GetListEntry with the qualifier we
# just specified, otherwise die.
my @userentry = ars_GetListEntry( $ctrl, "User", $userqualifier, 0, 0 );
die "No such user $user? ($ars_errstr)\n" if ( $#userentry == -1 );

# Change the password for this user by setting field 102 (the password field) with the new value
ars_SetEntry( $ctrl, "User", $userentry[0], 0, 102, $newpassword )
  || die "Error updating password: $ars_errstr";
print "Password changed for user $user on server $server\n";

example/Dump_Users_OO.pl  view on Meta::CPAN

			  -username => shift, 
			  -password => shift,
			  -catch => { ARS::AR_RETURN_ERROR => "main::mycatch" },
			  -ctrl => undef,
			  -debug => undef);

print "Opening \"User\" form ..\n";

my ($u) = $connection->openForm(-form => "User");

$u->setSort($LoginNameField, &ARS::AR_SORT_ASCENDING);

my @entries = $u->query(); # empty query means "get everything"

printf("%-30s %-45s\n", $LoginNameField, "Full name");
foreach my $id (@entries) {
  my($fullname, $loginname) = $u->get($id, ['Full Name', $LoginNameField] );
  printf("%-30s %-45s\n", $loginname, $fullname);
}


example/GetFilter.pl  view on Meta::CPAN

#   jcmurphy@acsu.buffalo.edu
#
# $Log: GetFilter.pl,v $
# Revision 1.9  2003/04/02 01:43:35  jcmurphy
# mem mgmt cleanup
#
# Revision 1.8  2000/06/01 16:54:03  jcmurphy
# *** empty log message ***
#
# Revision 1.7  1998/10/14 15:06:10  jcmurphy
# added some extra decoding for set fields actions.
#
# Revision 1.6  1998/10/14 13:54:53  jcmurphy
# fixed syntax error
#
# Revision 1.5  1998/09/16 14:38:31  jcmurphy
# updated changeDiary code
#
# Revision 1.4  1998/04/22 17:25:46  jcmurphy
# added example code to show decoding of SQL/SetFields actions.
#

example/GetFilter.pl  view on Meta::CPAN

    if(defined($field->{sql})) {
	printl 3, "SQL:\n";
	printl 4, "server: $field->{sql}->{server}\n";
	printl 4, "sqlCommand: $field->{sql}->{sqlCommand}\n";
	printl 4, "valueIndex: $field->{sql}->{valueIndex}\n";
    }
    if(defined($field->{valueType})) {
	printl 3, "valueType: $field->{valueType}\n";
    }
    if(defined($field->{none})) {
        printl 3, "No set fields instructions found.\n";
    }
    if(defined($field->{value})) {
        printl 3, "Value: \$$field->{value}\$\n";
    }
    if(defined($field->{field})) {
        printl 3, "Field Assign: $field->{field}\n";

	foreach (keys %{$field->{field}}) {
	    if(($_ ne "qualifier") && ($_ ne "schema")) {
		printl 4, "$_: $field->{field}->{$_}\n";

example/GetFilter.pl  view on Meta::CPAN

#   jeff murphy

sub ProcessActions {
    my @actions = @_;
    if(defined(@actions)) {
        $act_num = 1;
        foreach $action (@actions) {
            printl 1, "Action $act_num:\n";
            if(defined($action->{assign_fields})) {
                printl 2, "Set Fields:\n";
                foreach $setFields (@{$action->{assign_fields}}) {
                    printl 3, "fieldId: $setFields->{fieldId}\n";
                    ProcessSetFields($setFields->{assignment});
                }
            }
            if(defined($action->{message})) {
                
                # message text is formatted as:
                #
                # Type X Num XXXXX Text [XXXXXX...]

	      # messageNum messageType messageText

example/Show_ALink.pl  view on Meta::CPAN

#   ProcessSetFields
#
# DESCRIPTION
#   This routine dumps the various forms of the Set Fields
#   action in active links.

sub ProcessSetFields {
    my $field = shift;

    if(defined($field->{none})) {
	printl 3, "No set fields instructions found.\n";
    }
    if(defined($field->{value})) {
	printl 3, "Value: \$$field->{value}\$\n";
    }
    if(defined($field->{field})) {
	printl 3, "Field: $field->{field}\n";
    }
    if(defined($field->{process})) {
	printl 3, "Process: $field->{process}\n";
    }

example/Show_ALink.pl  view on Meta::CPAN

    if(defined(@actions)) {
	$act_num = 1;
	foreach $action (@actions) {
	    printl 1, "Action $act_num:\n";
	    if(defined($action->{macro})) {
		printl 2, "Macro:\n";
		ProcessMacroStruct(3, $action->{macro});
	    }
	    if(defined($action->{assign_fields})) {
		printl 2, "Set Fields:\n";
		foreach $setFields (@{$action->{assign_fields}}) {
		    printl 3, "fieldId: $setFields->{fieldId}\n";
		    ProcessSetFields($setFields->{assignment});
		}
	    }
	    if(defined($action->{message})) {
		printl 2, "Message: \n";
		foreach my $k (keys %{$action->{message}}) {
			printl 3, "$k: $action->{'message'}->{$k}\n";
		}
	    }
	    if(defined($action->{process})) {
		printl 2, "Process: ".$action->{process}."\n";

example/ars_QualDecode.pl  view on Meta::CPAN

    # arith in the qualification (i think aradmin will
    # give an error) so this is irrelevant to this
    # demo.

    elsif(defined($h->{arith})) {
	# addition by "David Adams" <D.J.Adams@soton.ac.uk>
	local($ar) = $h->{arith};
	$e .= "(".Decode_FVoAS($ar->{left}, $fids)." ".$ar->{oper}." ".Decode_FVoAS($ar->{right}, $fids).")";
    }

    # a set of values (used for the "IN" operator)
    # i've never really seen the "IN" keyword used 
    # either.. so i'll just flag it and dump something
    # semi-appropriate.

    elsif(defined($h->{valueSet})) {
	$e = "valueSet(".join(',', @{$h->{valueSet}}).")";
    }

    # a local variable. this is in the API, but i dont think
    # it's a real feature that is available.. perhaps

example/ars_SetServerInfo.pl  view on Meta::CPAN

#
# $Header: /cvsroot/arsperl/ARSperl/example/ars_SetServerInfo.pl,v 1.1 2000/08/31 05:18:41 jcmurphy Exp $
#
# NAME
#   ars_SetServerInfo.pl
#
# USAGE
#   ars_SetServerInfo.pl [server] [username] [password] [emailAdd]
#
# DESCRIPTION
#   sets the "email from" address for the server. 
#

use ARS;

my $c = ars_Login(shift, shift, shift);
die "ars_Login: $ars_errstr\n" unless defined($c);

print "Fetching current EMAIL_FROM setting..\n";
my %il = ars_GetServerInfo($c,
			   &ARS::AR_SERVER_INFO_EMAIL_FROM);
print "\tEMAIL_FROM = $il{'EMAIL_FROM'}\n\n";
my $orig = $il{'EMAIL_FROM'};


print "Setting EMAIL_FROM to foo\@bar.com .. \n";
ars_SetServerInfo($c, 
		  &ARS::AR_SERVER_INFO_EMAIL_FROM,
		  "foo\@bar.com") ||
  die "ars_SetServerInfo: $ars_errstr\n";

print "\nFetching newly set EMAIL_FROM setting..\n";
my %il = ars_GetServerInfo($c,
			   &ARS::AR_SERVER_INFO_EMAIL_FROM);
print "\tEMAIL_FROM = $il{'EMAIL_FROM'}\n\n";


print "Setting EMAIL_FROM to original setting..\n";
ars_SetServerInfo($c, 
		  &ARS::AR_SERVER_INFO_EMAIL_FROM,
		  $orig) ||
  die "ars_SetServerInfo: $ars_errstr\n";

print "\nDone.\n";

exit 0;

example/getCharSets.pl  view on Meta::CPAN

#
# $Header: /cvsroot/arsperl/ARSperl/example/getCharSets.pl,v 1.1 2009/03/31 13:29:50 mbeijen Exp $
#
# NAME
#   GetCharSets.pl
#
# USAGE
#   GetCharSets.pl [server] [username] [password]
#
# DESCRIPTION
#   Fetches and prints the charsets used by client and server
#
# AUTHOR
#  Michiel Beijen
#
# $Log: getCharSets.pl,v $
# Revision 1.1  2009/03/31 13:29:50  mbeijen
# added new examples: ChangePassword.pl, ars_DateToJulianDate.pl, getCharSets.pl
#
#

example/getCharSets.pl  view on Meta::CPAN


my ( $server, $user, $password, ) = ( shift, shift, shift );

# if you'd like to use UTF8:
# $ENV{'LANG'} = "en_US.utf8";

#Logging in to the server
( my $ctrl = ars_Login( $server, $user, $password ) )
  || die "ars_Login: $ars_errstr";

print "Fetching the charsets - easy...\n";

( my $servercharset = ars_GetServerCharSet($ctrl) ) || die "ERR: $ars_errstr\n";
( my $clientcharset = ars_GetClientCharSet($ctrl) ) || die "ERR: $ars_errstr\n";

ars_Logoff($ctrl);

print
"The server uses the $servercharset character set and the client uses $clientcharset.\n";

html/changes.html  view on Meta::CPAN

      BGCOLOR='black'>
      <TR>
	<TD width='100%'>
	  <TABLE CELLSPACING='0' CELLPADDING='3' WIDTH='100%' BORDER='0'
	    BGCOLOR='lightblue'>
	    <tr><td colspan='2'>
  <table width='100%' border='0'><tr>
	      <td width='50%'>Released: <B>03/12/2007</B></td>
              <td width='50%'>Version: <B>1.90
</B></td>
  </tr></table></td>
            </tr><tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added missing ARError_reset() to ars_GetListVUI 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_CreateCharMenu, ars_SetCharMenu 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added handling of case AR_CHAR_MENU_LIST in ars_GetCharMenu 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>changed handling of qualifier struct in ars_GetCharMenu, case AR_CHAR_MENU_QUERY 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>corrected function signature for ars_SetField, ars_CreateContainer 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>bugfix in ars_GetCharMenu (incorrect array length for "labelFields", "labelIndex") 

html/changes.html  view on Meta::CPAN

<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>ars_SetLogging: changed declaration "int len" to "STRLEN len" because of  
compilation problems on Solaris </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_BeginBulkEntryTransaction, ars_EndBulkEntryTransaction 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added AR_FIELD_OFFSET handling in perl_ARFieldValueOrArithStruct (support.c) 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_SetSessionConfiguration 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>completed sv_to_ARCurrencyStruct (support.c) 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>ARS.pm: set $ARS::logging_file_ptr = 0 to avoid "uninitialized" warning  
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>changed t/01import.t to import form "ARSperl Test3" 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_CreateContainer, ars_SetContainer 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_CreateFilter, ars_SetFilter, ars_CreateEscalation, ars_SetEscalation, 
ars_SetActiveLink </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added declaration of boolcpyHVal(...) to supportrev.h 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added declaration of revTypeName(...) to supportrev.h 

html/changes.html  view on Meta::CPAN

	    <tr><td colspan='2'>
  <table width='100%' border='0'><tr>
	      <td width='50%'>Released: <B>09/20/2005</B></td>
              <td width='50%'>Version: <B>1.85
</B></td>
  </tr></table></td>
            </tr><tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added binmode-statements in t/10entry.t (test failed on win32) 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>warning cleanup in test files (t/02export.t, t/13join.t) 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_SetLogging (changes to ARS.xs, ARS.pm, support.c, support-h.template, 
html/manual/toc.html;  new files: html/manual/ars_SetLogging.html, t/21setlogging.t) </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>fixed pointer dereferencing error in supportrev.c:strmakHval 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>fixed supportrev.c:strcasecmp, strncasecmp; failure to differentiate between  
string and substring (e.g. "page_holder" and "page") </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>fixed support.c:perl_ARByteList (Bug ID 1213180) 
(David Lindes {lindes at users.sourceforge.net}) </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added support for DATA_TYPE_CURRENCY to perl_ARFieldLimitStruct 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added function perl_ARCurrencyDetailList 
</font></td></tr>

html/changes.html  view on Meta::CPAN

  <table width='100%' border='0'><tr>
	      <td width='50%'>Released: <B>04/7/99</B></td>
              <td width='50%'>Version: <B>1.6403 BETA
</B></td>
  </tr></table></td>
            </tr><tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>tested/fixed compiling against pre-4.0 apis.  
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>OO: now checks named params to ensure you don't 
mis-spell them. </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>attachment allows specify a 'name' hash key so you can 
customize the name that appears in the attachment field in the usertool.  (Nick Stoughton {NickS at ISRWORLD.com}) </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>OO: form->setSort method added 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>OO: better error handling/catching 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>OO: fixed bug in value2internal 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>fixed NTRegisterServer(), fixed example/3.x/Notifier.pl 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>OO: fixed ARS::AR_RETURN_* bugs { erik.dorfman at intelsat.int } 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>fixed bug in ars_GetListServer() for api &gt;= 4.0 

html/changes.html  view on Meta::CPAN

	      <td width='50%'>Released: <B>03/30/98</B></td>
              <td width='50%'>Version: <B>1.55
</B></td>
  </tr></table></td>
            </tr><tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>added ars_GetListEntry.pl example to show how to use 
custom query-list fields. </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>numerous documentation updates by {D.J.Adams at soton.ac.uk} 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>fixed bug in macroParm decoding. {D.J.Adams at soton.ac.uk} 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>fixed bug when decoding results of GetFilter/GetActiveLink 
in regards to set fields actions: values assigned to diary fields were not being interpretted correctly. {D.J.Adams at soton.ac.uk} </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>patched perl_BuildEntryIdList to make it more robust 
(Ulrich Pfeifer {pfeifer at wait.de}) </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>patched ars_GetCharMenu for bug "GetCharMenu doesn't 
return a qualifier for query menus" {D.J.Adams at soton.ac.uk} </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>fixed dup_FieldValueOrArith to support decoding of 
query style menus.  </table></td></tr></table>

<P>


html/changes.html  view on Meta::CPAN

      BGCOLOR='black'>
      <TR>
	<TD width='100%'>
	  <TABLE CELLSPACING='0' CELLPADDING='3' WIDTH='100%' BORDER='0'
	    BGCOLOR='lightblue'>
	    <tr><td colspan='2'>
  <table width='100%' border='0'><tr>
	      <td width='50%'>Released: <B>11/11/96</B></td>
              <td width='50%'>Version: <B>1.3
</B></td>
  </tr></table></td>
            </tr><tr bgcolor='#eeeeee'><td width='10%'>(JWM)</td><td width='90%'><font color='black'>undef works in setEntry now. 
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JWM)</td><td width='90%'><font color='black'>added ars_Import to complement ars_Export 
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>Profiling code added to keep track of number of 
queries made. </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JWM)</td><td width='90%'><font color='black'>Field caching code added to make some of the functions 
more efficient. </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>New functions: ars_GetFilter(), ars_GetCharMenu(),  
ars_GetServerStatistics </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JWM)</td><td width='90%'><font color='black'>Internal GetField call now caches results to minimize 

html/debug.html  view on Meta::CPAN

     ARS.c to see what they are.  Make sure you keep ARS.c in
     place so the debugger can find it! <P>
     Here is an example debugging session:
<PRE>
152 cnu(11:13:13)~/ARSperl/ARSperl/example&gt; gdb /usr/local/bin/perl
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (sparc-sun-solaris2.3),
Copyright 1996 Free Software Foundation, Inc...
(gdb) set args -d GetField.pl remedyserver jmurphy mypass User 1
(gdb) run
Starting program: /usr/local/bin/perl -d GetField.pl remedyserver jmurphy mypass User 1
Stack dump during die enabled outside of evals.

Loading DB routines from perl5db.pl patch level 0.94
Emacs support available.

Enter h or `h h' for help.

main::(GetField.pl:31): ($server, $username, $password, $schema, $fieldname) = @ARGV;

html/index.html  view on Meta::CPAN



</head>

 <body style="background-color: rgb(255, 255, 255);">

<img alt="ARSPerl" src="arsperl-logo.gif">
<h2> Overview </h2>

<b>ARSperl</b> is an integration kit for <a href="http://www.perl.com/perl">Perl5</a> and <a href="http://www.remedy.com">Remedy ARS</a> version 5
- version 7 API. It provides a large subset of the functionality found
in the ARS C API. The source code to the integration kit and example
scripts is made available under the <a href="artistic.txt">licensing
terms of Perl itself</a>.
<p> We hope that other ARS fans find the kit useful. </p>

<h2> Version </h2>

The current release is version 1.91 and has support for the AR 5.0
through 7.1
API.

html/manual/AR_DAY.html  view on Meta::CPAN

<HTML>
<HEAD>
<TITLE>ARSperl Manual - ARS::AR_DAY</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">

   <H2><CODE>ARS::AR_DAY(mask, dayNumber)</CODE></H2>

	Determine if the specified day number is set in the mask. Days range
        from 1 to 31. Mask, depending upon semantics, might contain the
        days of the month (1 - 31) or the days of the week (1 - 7).
	<P>

      <DL>
         <DT><B>On success</B><DD>
		Returns 1 (TRUE).
         <DT><B>On failure</B><DD>
                Returns 0 (FALSE).
      </DL>

      <P>Example:

      <PRE>
	if(ARS::AR_DAY($mask, 13) == 1) {
		print "The 13th is set.\n";
	}
      </PRE>

<I>ARS::AR_DAY was introduced in version 1.5 of ARSperl</I>

<P>
<HR WIDTH="30%">
<P>
<A HREF="toc.html"><IMG ALT="&lt;--" SRC="arrow.gif" ALIGN=CENTER> Table of Contents </A>
<p>

html/manual/AR_HOUR.html  view on Meta::CPAN

<HTML>
<HEAD>
<TITLE>ARSperl Manual - ARS::AR_HOUR</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">

   <H2><CODE>ARS::AR_HOUR(mask, hourNumber)</CODE></H2>

	Determine if the specified hour number is set in the mask. Hours
	range from 1 - 24.
	<P>

      <DL>
         <DT><B>On success</B><DD>
		Returns 1 (TRUE).
         <DT><B>On failure</B><DD>
                Returns 0 (FALSE).
      </DL>

      <P>Example:

      <PRE>
	if(ARS::AR_HOUR($mask, 9) == 1) {
		print "0900 hours (9 AM) is set in the mask.\n";
	}
      </PRE>

<I>ARS::AR_HOUR was introduced in version 1.5 of ARSperl</I>

<P>
<HR WIDTH="30%">
<P>
<A HREF="toc.html"><IMG ALT="&lt;--" SRC="arrow.gif" ALIGN=CENTER> Table of Contents </A>
<p>

html/manual/OO/connection.html  view on Meta::CPAN

<DT><A NAME="openForm"><B>openForm()</B></A><DD>

<PRE>
  $f = $c->openForm(-form =&gt; scalar string,
                    -vui  =&gt; scalar string);
</PRE>

	This call opens up a new form and caches some information for you
	to improve performance. The <code>vui</code> parameter currently
	does nothing, but it will eventually alter the field labels that
	you can pass into form->get() form->set(), etc. The form parameter
	is the name of the form you wish to open (e.g. "User"). Upon
	successful completetion this call returns a new ARS::form object.

</DL>

<HR>
<A HREF="../toc.html">Back to Table of Contents</A>
Last updated 12 Mar 1999 by jcmurphy@buffalo.edu.
</BODY>
</HTML>

html/manual/OO/form.html  view on Meta::CPAN

<DT><A NAME="delete"><B>delete()</B></A>
<PRE>
   $f->delete(-entry =&gt; scalar string);
</PRE>

    This method will delete a given entry from the form. It does not "pad
    out" the entry id for you currently. So if there are leading zeros, you 
    must add them.

<P>
<DT><A NAME="set"><B>set()</B></A>
<PRE>
   $f->set(-entry =&gt; scalar string,
           -gettime =&gt; scalar timestamp,
           -value =&gt; { field1 =&gt; value1, ...});
</PRE>

    This method allows you to set the field values of an existing entry. It 
    currently does not obey the VUI setting. You may specify the
    enumeration field text instead of the enumeration value. In the future, 
    you will have the option of specifying either.

<P>
<DT><A NAME="merge"><B>merge()</B></A>
<PRE>
   $f->merge(-type   =&gt; numeric value,
             -values =&gt; { field1 =&gt; value1, ...});
</PRE>

    This method allows you to "merge" the given fields/values into 
    a form. The merge operation is fairly powerful, allowing you
    to bypass the usual pattern, "not-null", etc, checks that are 
    enforced on set() and create() operations. In addition,
    the merge() operation allows you to over-write existing entries
    (including their diary fields). This call  
    currently does not obey the VUI setting. You may specify the
    enumeration field text instead of the enumeration value. In the future, 
    you will have the option of specifying either. In the future, 
    this call will also do the right thing for diary fields. Currently, 
    you need to pass the <I>encoded</I> diary to this
	routine. See <A HREF="ars_EncodeDiary.html">ars_EncodeDiary</A>.

<P>
<DT><A NAME="get"><B>get()</B></A>
<PRE>
   ($value1, ...) = $f->get(-entry =&gt; scalar string,
                            -fields =&gt; [ field1, ... ]);
</PRE>

    This method allows you to retrieve some (or all, if you don't specify
    the -fields parameter) fields for a given record ID from the form. It
    does not currently obey the VUI setting. In addition, you can not
    specify field ID's currently, but will be able to in the
    future. Finally, the entry ID will not be padded out for you currently.
    In addition, enumeration values will be converted on the fly for you.
<P>
<DT><A NAME="getAsHash"><B>getAsHash()</B></A>
<PRE>
   %h = $f->getAsHash(-entry =&gt; scalar string,
                      -fields =&gt; [ field1, ... ]);
</PRE>

    This method is identical to get() in every way except for the return
    value. This method returns a list of key/value pairs where the key is
    the field name (currently doesn't obey vui setting) and the field value 
    (enumeration values are converted to text automatically). <P>

      The current implementation does allow for the specification of sort
      order, but in the future it will and then you should, as usual, put
      the return value into an array instead of a hash.

<P>
<DT><A NAME="getAttachment"><B>getAttachment()</B></A>
<PRE>
   $v = $f->getAttachment(-entry =&gt; scalar string,

html/manual/OO/form.html  view on Meta::CPAN

<DT><A NAME="internal2value"><B>internal2value()</B></A>
<PRE>
  $v = internal2value(-field =&gt; scalar, -id =&gt; scalar, -value =&gt; value);
</PRE>

    This is an internal routine used to translate enumeration text into
    enumeration values for a given field. You must specify either the field 
    or id parameter as well as the value parameter.

<P>
<DT><A NAME="setSort"><B>setSort()</B></A>
<PRE>
  $f->setSort("Field Name1", [<I>ARS::AR_SORT_ASCENDING</I> or <I>ARS::AR_SORT_DESCENDING</I>], 
              "Field Name2", [<I>ARS::AR_SORT_ASCENDING</I> or <I>ARS::AR_SORT_DESCENDING</I>], 
              ...);
</PRE>

    This method allows you to set the sort option (ascending or
    descending) for field names. Each field name must be followed
    by a sort option. The fields will be sorted in the order 
    they are listed in the parameter list.

<P>

</DL>


<HR>

html/manual/OO/index.html  view on Meta::CPAN

<BODY BGCOLOR="#FFFFFF">
<CENTER>
<H1>ARSperl Programmer's Manual - OO Layer Overview</H1>
</CENTER>

<H2> Objective </H2>

Since there are several (at least 3) separate OO layers out there, some of
      which work on top of ARSperl and some of which don't, I decided to
      implement a layer ontop of ARSperl so that you get all of the
      features of ARSperl as well as an OO layer for a subset of those
      features.

<H2> Features </H2>

The following features are available as part of the OO layer.

<DL>
<DT> <B> Exception Handlers </B> <DD>

        The OO layer abstracts exception handling away a bit (optionally,

html/manual/OO/index.html  view on Meta::CPAN

	the API calls you've come to use while allowing you to utilize some 
	OOP practices where available. You don't need to login twice, the
	OO layer and the class functional layer can share a single control
	record. <P>

<DT> <B> Automatic Type Conversion </B> <DD>

        The OO layer converts enumeration values on the fly for you. This
	is done on 
	<a href="connection.html#create">creates</a>,
	<a href="connection.html#set">sets</A> and
	<a href="connection.html#get">gets</a>. You no longer have to lookup
	with enumeration values yourself. <P>

<DT> <B> Named Parameters </B> <DD>

	All of the OO layer's methods accept named parameters so you don't
	have to remember what the correct parameter order is. You can
	optionally leave out the named parameter portion (if you like) but
	then you'll need to be sure you get the order right (just like in
	the "classic", i.e. ars_*, function calls).<P> 

html/manual/ars_BeginBulkEntryTransaction.html  view on Meta::CPAN

<HTML>
<HEAD>
<TITLE>ARSperl Manual - ars_BeginBulkEntryTransaction</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">

   <H2><CODE>ars_BeginBulkEntryTransaction(ctrl)</CODE></H2>

This command can be used to group several create, set, delete and merge
entry operations together into a single transaction. The actual execution
of these functions is deferred until
<a href="ars_EndBulkEntryTransaction.html">ars_EndBulkEntryTransaction</a> is called.

      <DL>
         <DT><B>On success</B><DD>
		   Returns 1
         <DT><B>On failure</B><DD>
           Returns 0
      </DL>

html/manual/ars_CreateField.html  view on Meta::CPAN

</HEAD>
<BODY BGCOLOR="#FFFFFF">

   <H2><CODE>ars_CreateField(ctrl, schema, fieldHash, reservedIdOK=0 )</CODE></H2>

      This function creates a new field. You must first
      populate the <CODE>fieldHash</CODE> before calling this routine.
      <P><CODE>schema</CODE> is the name of the schema where the field is to be created.
      <P><CODE>fieldHash</CODE> is a
      <A HREF="ds_field_hash.html">Field Properties Structure</a> hash. 
      <P><CODE>reservedIdOK</CODE> must be set to 1 if you want to create a field in
      the reserved field id range (i.e. <= 536870912).

      <P>

      <DL>
          <DT><B>On success</B><DD>
              Returns 1
          <DT><B>On failure</B><DD>
              Returns 0
      </DL>



( run in 1.396 second using v1.01-cache-2.11-cpan-49f99fa48dc )