Skip to content
Snippets Groups Projects
Commit e9dbe953 authored by Demian Katz's avatar Demian Katz
Browse files

Updated Symphony driver caching; added missing .ini file.

parent e920cde5
No related merge requests found
; The driver contains defaults designed to minimize necessary configuration.
; Theoretically, a vanilla SymWS installation on the same server as VuFind
; that accepts the clientID 'VuFind' might not even require a configuration
; file.
[WebServices]
; Your Symphony Web Services server
baseURL = http://localhost:8080/symws
;clientID - client ID set up for Vufind in symWS administration panel.
clientID = VuFind
; Installations using the 'Always Require Authentication' option
; must provide a valid login and password for anonymous operations.
;user =
;password =
; You can provide options to be provided to SoapClients here, e.g.
;soapOptions[proxy_host] = proxy.example.edu
[PolicyCache]
; If you wish to cache Symphony policies, uncomment type below and set it to the name of the
; \VuFind\Cache\Manager cache you would like to use for storing data ("object" is recommended).
;type = object
[LibraryFilter]
; Exclude or exclusively include libraries (by ID) from holdings results.
; Filtering at the driver level (instead of, e.g., with VuFind core's
; Record/hide_holdings[]) potentially allows the driver to request less
; from SymWS, instead of filtering it after the fact.
;include_only[] = MAIN
;include_only[] = EAST
;exclude[] = MAIN
[999Holdings]
; When exporting MARC records, Symphony offers to store item information
; in MARC tags (numbered 999 by default). The driver may be configured to use
; that information in lieu of live item information from SymWS.
mode = off
entry_number = 999
[Behaviors]
;showBaseCallNumber - Enables the base call number to be displayed in the hitlist, versus specific call numbers from the item records. The specific call numbers will still be displayed on the record holdings page. Supported values are "true" or "false".
showBaseCallNumber = true
;showStaffNotes - Determines whether to show staff notes in the holdings.
; Supported values are "true" or "false".
showStaffNotes = true
;showFeeType - Determines the type of fees that are shown.
; Supported values are: UNPAID_FEES, PAID_FEES, ALL_FEES
showFeeType = ALL_FEES
;usernameField - Determines from which field from Symphony to populate the
; patron's username in Vufind's user DB. ILS_username_field must be
; to "id" in config.ini for this to work.
; Supported values are: userKey, userID
usernameField = userID
;userProfileGroupField - Determines from which field to populate the "Group" in "My Profile".
; Supported values are: GROUP_ID, USER_PROFILE_ID,
; PATRON_LIBRARY_ID, DEPARTMENT
userProfileGroupField = USER_PROFILE_ID
; This section controls hold behavior; note that you must also ensure that Holds are
; enabled in the [Catalog] section of config.ini in order to take advantage of these
; settings.
[Holds]
; HMACKeys - A list of hold form element names that will be analyzed for consistency
; during hold form processing. Most users should not need to change this setting.
HMACKeys = item_id:holdtype:level
; defaultRequiredDate - A colon-separated list used to set the default "not required
; after" date for holds in the format days:months:years
; e.g. 0:1:0 will set a "not required after" date of 1 month from the current date
defaultRequiredDate = 0:1:1
; extraHoldFields - A colon-separated list used to display extra visible fields in the
; place holds form. Supported values are "comments", "requiredByDate" and
; "pickUpLocation"
extraHoldFields = comments:requiredByDate:pickUpLocation
; A Pick Up Location Code used to pre-select the pick up location drop down list and
; provide a default option if others are not available. Must correspond with one of
; the Location IDs returned by getPickUpLocations()
;defaultPickUpLocation = MAIN
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
* @link http://vufind.org/wiki/building_an_ils_driver Wiki * @link http://vufind.org/wiki/building_an_ils_driver Wiki
*/ */
namespace VuFind\ILS\Driver; namespace VuFind\ILS\Driver;
use SoapFault, VuFind\Config\Reader as ConfigReader, use SoapFault, VuFind\Cache\Manager as CacheManager,
VuFind\Exception\ILS as ILSException; VuFind\Config\Reader as ConfigReader, VuFind\Exception\ILS as ILSException;
/** /**
* Symphony Web Services (symws) ILS Driver * Symphony Web Services (symws) ILS Driver
...@@ -44,7 +44,7 @@ use SoapFault, VuFind\Config\Reader as ConfigReader, ...@@ -44,7 +44,7 @@ use SoapFault, VuFind\Config\Reader as ConfigReader,
class Symphony implements DriverInterface class Symphony implements DriverInterface
{ {
protected $config; protected $config;
protected $cacheManager = false; protected $policyCache = false;
protected $policies; protected $policies;
/** /**
...@@ -108,22 +108,12 @@ class Symphony implements DriverInterface ...@@ -108,22 +108,12 @@ class Symphony implements DriverInterface
'userProfileGroupField' => 'USER_PROFILE_ID' 'userProfileGroupField' => 'USER_PROFILE_ID'
); );
/* TODO
// Initialize cache manager. // Initialize cache manager.
$this->cacheManager = new Zend_Cache_Manager; if (isset($configArray['PolicyCache']['type'])) {
$this->cacheManager->setCacheTemplate( $manager = CacheManager::getInstance();
'policy', array( $this->policyCache
'frontend' => array( = $manager->getCache($configArray['PolicyCache']['type']);
'name' => 'Core', }
'options' => $this->config['PolicyCache']['frontendOptions'],
),
'backend' => array(
'name' => $this->config['PolicyCache']['backend'],
'options' => $this->config['PolicyCache']['backendOptions'],
),
)
);
*/
} }
/** /**
...@@ -1404,14 +1394,12 @@ class Symphony implements DriverInterface ...@@ -1404,14 +1394,12 @@ class Symphony implements DriverInterface
protected function getPolicyList($policyType) protected function getPolicyList($policyType)
{ {
try { try {
$policyCache = is_object($this->cacheManager) $cacheKey = 'symphony' . hash('sha256', "${policyType}");
? $this->cacheManager->getCache('policy') : false;
$cacheKey = hash('sha256', "${policyType}");
if (isset($this->policies[$policyType])) { if (isset($this->policies[$policyType])) {
return $this->policies[$policyType]; return $this->policies[$policyType];
} elseif ($policyCache } elseif ($this->policyCache
&& ($policyList = $policyCache->load($cacheKey)) && ($policyList = $this->policyCache->getItem($cacheKey))
) { ) {
$this->policies[$policyType] = $policyList; $this->policies[$policyType] = $policyList;
return $policyList; return $policyList;
...@@ -1427,7 +1415,9 @@ class Symphony implements DriverInterface ...@@ -1427,7 +1415,9 @@ class Symphony implements DriverInterface
= $policyInfo->policyDescription; = $policyInfo->policyDescription;
} }
$policyCache->save($policyList, $cacheKey); if ($this->policyCache) {
$this->policyCache->setItem($cacheKey, $policyList);
}
return $policyList; return $policyList;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment