SOLR IMPLEMENTATION FOR v4.0 UPDATES (First Part)
This commit is contained in:
@@ -1,43 +1,43 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
/**
|
||||
* Application Solr Queue
|
||||
*/
|
||||
class Entity_AppSolrQueue extends Entity_Base
|
||||
{
|
||||
public $appUid = "";
|
||||
public $appChangeDate = "";
|
||||
public $appChangeTrace = "";
|
||||
public $appUpdated = 0;
|
||||
public $appUid = '';
|
||||
public $appChangeDate = '';
|
||||
public $appChangeTrace = '';
|
||||
public $appUpdated = 0;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_AppSolrQueue ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_AppSolrQueue ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"appUid",
|
||||
"appChangeDate",
|
||||
"appChangeTrace",
|
||||
"appUpdated"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_AppSolrQueue();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_AppSolrQueue();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array(
|
||||
"appUid",
|
||||
"appChangeDate",
|
||||
"appChangeTrace",
|
||||
"appUpdated"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,154 +2,156 @@
|
||||
|
||||
class Entity_Base
|
||||
{
|
||||
|
||||
/**
|
||||
* this function check if a field is in the data sent in the constructor
|
||||
* you can specify an array, and this function will use like alias
|
||||
*/
|
||||
protected function validateField ($field, $default = false)
|
||||
{
|
||||
$fieldIsEmpty = true;
|
||||
|
||||
// this is a trick, if $fields is a string, $fields will be an array with
|
||||
// one element
|
||||
if (is_array( $field )) {
|
||||
$fields = $field;
|
||||
} else {
|
||||
$fields = array ();
|
||||
$fields[] = $field;
|
||||
}
|
||||
|
||||
// if there are aliases for this field, evaluate all aliases and take the
|
||||
// first occurence
|
||||
foreach ($fields as $k => $f) {
|
||||
if (isset( $this->temp[$f] )) {
|
||||
$fieldIsEmpty = false;
|
||||
return $this->temp[$f];
|
||||
}
|
||||
}
|
||||
|
||||
// field empty means the user has not sent a value for this Field, so we are
|
||||
// using the default value
|
||||
if ($fieldIsEmpty) {
|
||||
if ($default !== false) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* this function check if a field is in the data sent in the constructor
|
||||
* you can specify an array, and this function will use like alias
|
||||
*/
|
||||
protected function validateField($field, $default = false)
|
||||
{
|
||||
$fieldIsEmpty = true;
|
||||
|
||||
// this is a trick, if $fields is a string, $fields will be an array with
|
||||
// one element
|
||||
if (is_array ($field)) {
|
||||
$fields = $field;
|
||||
}
|
||||
else {
|
||||
$fields = array ();
|
||||
$fields [] = $field;
|
||||
}
|
||||
|
||||
// if there are aliases for this field, evaluate all aliases and take the
|
||||
// first occurence
|
||||
foreach ($fields as $k => $f) {
|
||||
if (isset ($this->temp [$f])) {
|
||||
$fieldIsEmpty = false;
|
||||
return $this->temp [$f];
|
||||
}
|
||||
}
|
||||
|
||||
// field empty means the user has not sent a value for this Field, so we are
|
||||
// using the default value
|
||||
if ($fieldIsEmpty) {
|
||||
if ($default !== false) {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function validateRequiredFields($requiredFields = array())
|
||||
{
|
||||
foreach ($requiredFields as $k => $field) {
|
||||
if ($this->{$field} === NULL) {
|
||||
throw (new Exception ("Field $field is required in " . get_class ($this)));
|
||||
die ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copy the values of the Entity to the array of aliases
|
||||
* The array of aliases must be defined.
|
||||
*
|
||||
* @return Array of alias with the Entity values
|
||||
*/
|
||||
public function getAliasDataArray()
|
||||
{
|
||||
$aAlias = array ();
|
||||
// get aliases from class
|
||||
$className = get_class ($this);
|
||||
if (method_exists ($className, 'GetAliases')) {
|
||||
$aliases = call_user_func (array (
|
||||
$className,
|
||||
'GetAliases'
|
||||
));
|
||||
// $aliases = $className::GetAliases ();
|
||||
foreach ($this as $field => $value)
|
||||
if (isset ($aliases [$field])) {
|
||||
// echo "Field exists in Aliases: " . $field . "\n";
|
||||
// echo "Alias Name:" . $aliases[$field] . "\n";
|
||||
// echo "Alias value:" . $value . "\n";
|
||||
$aAlias [$aliases [$field]] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
protected function validateRequiredFields ($requiredFields = array())
|
||||
{
|
||||
foreach ($requiredFields as $k => $field) {
|
||||
if ($this->{$field} === null) {
|
||||
throw (new Exception( "Field $field is required in " . get_class( $this ) ));
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
return $aAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* Set the data from array of alias to Entity
|
||||
*
|
||||
* @param $aAliasData array
|
||||
* of data of aliases
|
||||
*/
|
||||
public function setAliasDataArray($aAliasData)
|
||||
{
|
||||
// get aliases from class
|
||||
$className = get_class ($this);
|
||||
if (method_exists ($className, 'GetAliases')) {
|
||||
$aliases = call_user_func (array (
|
||||
$className,
|
||||
'GetAliases'
|
||||
));
|
||||
// $aliases = $className::GetAliases ();
|
||||
foreach ($this as $field => $value)
|
||||
if (isset ($aliases [$field]))
|
||||
$this->{$field} = $aAliasData [$aliases [$field]];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copy the values of the Entity to the array of aliases
|
||||
* The array of aliases must be defined.
|
||||
*
|
||||
* @return Array of alias with the Entity values
|
||||
*/
|
||||
public function getAliasDataArray ()
|
||||
{
|
||||
$aAlias = array ();
|
||||
// get aliases from class
|
||||
$className = get_class( $this );
|
||||
if (method_exists( $className, 'GetAliases' )) {
|
||||
$aliases = call_user_func( array ($className,'GetAliases'
|
||||
) );
|
||||
// $aliases = $className::GetAliases ();
|
||||
foreach ($this as $field => $value) {
|
||||
if (isset( $aliases[$field] )) {
|
||||
// echo "Field exists in Aliases: " . $field . "\n";
|
||||
// echo "Alias Name:" . $aliases[$field] . "\n";
|
||||
// echo "Alias value:" . $value . "\n";
|
||||
$aAlias[$aliases[$field]] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $aAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* Initialize object with values from $data.
|
||||
* The values from data use properties or alias array.
|
||||
*
|
||||
* @param
|
||||
* $data
|
||||
*/
|
||||
protected function initializeObject($data)
|
||||
{
|
||||
// get aliases from class
|
||||
$className = get_class ($this);
|
||||
$aliases = array ();
|
||||
$swAliases = false;
|
||||
if (method_exists ($className, 'GetAliases')) {
|
||||
$aliases = call_user_func (array (
|
||||
$className,
|
||||
'GetAliases'
|
||||
));
|
||||
// $aliases = $className::GetAliases ();
|
||||
$swAliases = true;
|
||||
}
|
||||
// use object properties or aliases to initialize
|
||||
foreach ($this as $field => $value)
|
||||
if (isset ($data [$field])) {
|
||||
$this->$field = $data [$field];
|
||||
}
|
||||
elseif ($swAliases && isset ($aliases [$field]) && isset ($data [$aliases [$field]])) {
|
||||
$this->$field = $data [$aliases [$field]];
|
||||
}
|
||||
}
|
||||
|
||||
public function serialize()
|
||||
{
|
||||
if (isset ($this->temp))
|
||||
unset ($this->temp);
|
||||
return serialize ($this);
|
||||
}
|
||||
|
||||
public function unserialize($str)
|
||||
{
|
||||
$className = get_class ($this);
|
||||
$data = unserialize ($str);
|
||||
return new $className ($data);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Set the data from array of alias to Entity
|
||||
*
|
||||
* @param $aAliasData array of data of aliases
|
||||
*/
|
||||
public function setAliasDataArray ($aAliasData)
|
||||
{
|
||||
// get aliases from class
|
||||
$className = get_class( $this );
|
||||
if (method_exists( $className, 'GetAliases' )) {
|
||||
$aliases = call_user_func( array ($className,'GetAliases'
|
||||
) );
|
||||
// $aliases = $className::GetAliases ();
|
||||
foreach ($this as $field => $value) {
|
||||
if (isset( $aliases[$field] )) {
|
||||
$this->{$field} = $aAliasData[$aliases[$field]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Initialize object with values from $data.
|
||||
* The values from data use properties or alias array.
|
||||
*
|
||||
* @param $data
|
||||
*/
|
||||
protected function initializeObject ($data)
|
||||
{
|
||||
// get aliases from class
|
||||
$className = get_class( $this );
|
||||
$aliases = array ();
|
||||
$swAliases = false;
|
||||
if (method_exists( $className, 'GetAliases' )) {
|
||||
$aliases = call_user_func( array ($className,'GetAliases'
|
||||
) );
|
||||
// $aliases = $className::GetAliases ();
|
||||
$swAliases = true;
|
||||
}
|
||||
// use object properties or aliases to initialize
|
||||
foreach ($this as $field => $value) {
|
||||
if (isset( $data[$field] )) {
|
||||
$this->$field = $data[$field];
|
||||
} elseif ($swAliases && isset( $aliases[$field] ) && isset( $data[$aliases[$field]] )) {
|
||||
$this->$field = $data[$aliases[$field]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function serialize ()
|
||||
{
|
||||
if (isset( $this->temp )) {
|
||||
unset( $this->temp );
|
||||
}
|
||||
return serialize( $this );
|
||||
}
|
||||
|
||||
public function unserialize ($str)
|
||||
{
|
||||
$className = get_class( $this );
|
||||
$data = unserialize( $str );
|
||||
return new $className( $data );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +1,51 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
/**
|
||||
* Facet group entity that represent a facet group
|
||||
*
|
||||
* @property $facetGroupName: The name of the facet (field name in solr index)
|
||||
* @property $facetGroupPrintName: The print name of the facet (Human readable
|
||||
* description)
|
||||
* description)
|
||||
* @property $facetGroupType: The type of facet group, field, daterange, filter,
|
||||
* range
|
||||
* range
|
||||
* @property $facetGroupId: An identifier to find group information
|
||||
* @property $facetItems: array of facet items
|
||||
* @author dev-HebertSaak
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Entity_FacetGroup extends Entity_Base
|
||||
{
|
||||
public $facetGroupName = '';
|
||||
public $facetGroupPrintName = '';
|
||||
public $facetGroupType = ''; // field, daterange, query
|
||||
public $facetGroupId = '';
|
||||
public $facetItems = array ();
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_FacetGroup();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForInsert ($data)
|
||||
{
|
||||
$obj = new Entity_FacetGroup();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ("facetGroupName","facetItems"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
public $facetGroupName = '';
|
||||
public $facetGroupPrintName = '';
|
||||
public $facetGroupType = ''; // field, daterange, query
|
||||
public $facetGroupId = '';
|
||||
public $facetItems = array ();
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_FacetGroup ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForInsert($data)
|
||||
{
|
||||
$obj = new Entity_FacetGroup ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"facetGroupName",
|
||||
"facetItems"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +1,40 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_FacetInterfaceRequest extends Entity_Base
|
||||
{
|
||||
public $searchText = '';
|
||||
public $selectedFacetsString = ''; // string of selected facet groups and
|
||||
|
||||
// items in format:
|
||||
// groupkey1::groupdesc1:::itemkey1::itemdesc1,groupkey2::groupdesc2:::itemkey2::itemdesc2,
|
||||
// groupkey3::groupdesc3:::itemkey3::itemdesc3
|
||||
// var $selectedFacetFields = array();
|
||||
// var $selectedFacetTypes = array();
|
||||
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceRequest();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceRequest();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ("searchText","selectedFacetsString"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
public $searchText = '';
|
||||
public $selectedFacetsString = ''; // string of selected facet groups and
|
||||
// items in format:
|
||||
// groupkey1::groupdesc1:::itemkey1::itemdesc1,groupkey2::groupdesc2:::itemkey2::itemdesc2,
|
||||
// groupkey3::groupdesc3:::itemkey3::itemdesc3
|
||||
// var $selectedFacetFields = array();
|
||||
// var $selectedFacetTypes = array();
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceRequest ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceRequest ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"searchText",
|
||||
"selectedFacetsString"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,37 +1,39 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_FacetInterfaceResult extends Entity_Base
|
||||
{
|
||||
// array of facetsgroups, array of Entity_SelectedFacetGroupItem, filter text
|
||||
|
||||
|
||||
public $aFacetGroup = array ();
|
||||
public $aSelectedFacetGroupItem = array ();
|
||||
public $sFilterText = '';
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceResult();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceResult();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ("aFacetGroup","aSelectedFacetGroupItem","sFilterText"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
// array of facetsgroups, array of Entity_SelectedFacetGroupItem, filter text
|
||||
|
||||
public $aFacetGroup = array ();
|
||||
public $aSelectedFacetGroupItem = array ();
|
||||
public $sFilterText = '';
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceResult ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_FacetInterfaceResult ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"aFacetGroup",
|
||||
"aSelectedFacetGroupItem",
|
||||
"sFilterText"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +1,47 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Entity Face item, represent an option in a facet group
|
||||
*
|
||||
* @author dev-HebertSaak
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Entity_FacetItem extends Entity_Base
|
||||
{
|
||||
public $facetName = '';
|
||||
public $facetPrintName = '';
|
||||
public $facetCount = '';
|
||||
public $facetSelectCondition = ''; // selected condition used to select
|
||||
|
||||
// this facet
|
||||
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_FacetItem();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForInsert ($data)
|
||||
{
|
||||
$obj = new Entity_FacetItem();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ("facetName","facetCount"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
public $facetName = '';
|
||||
public $facetPrintName = '';
|
||||
public $facetCount = '';
|
||||
public $facetSelectCondition = ''; // selected condition used to select
|
||||
// this facet
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_FacetItem ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForInsert($data)
|
||||
{
|
||||
$obj = new Entity_FacetItem ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"facetName",
|
||||
"facetCount"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,45 +1,43 @@
|
||||
<?php
|
||||
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_FacetRequest extends Entity_Base
|
||||
{
|
||||
public $workspace = '';
|
||||
public $searchText = '';
|
||||
public $facetFields = array ();
|
||||
public $facetQueries = array ();
|
||||
public $facetDates = array ();
|
||||
public $facetDatesStart = '';
|
||||
public $facetDatesEnd = '';
|
||||
public $facetDateGap = '';
|
||||
public $facetRanges = array ();
|
||||
public $filters = array ();
|
||||
public $selectedFacetsString = '';
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_FacetRequest ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_FacetRequest ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"workspace"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public $workspace = '';
|
||||
public $searchText = '';
|
||||
public $facetFields = array();
|
||||
public $facetQueries = array();
|
||||
public $facetDates = array();
|
||||
public $facetDatesStart = '';
|
||||
public $facetDatesEnd = '';
|
||||
public $facetDateGap = '';
|
||||
public $facetRanges = array();
|
||||
public $filters = array();
|
||||
public $selectedFacetsString = '';
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_FacetRequest ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_FacetRequest ();
|
||||
|
||||
$obj->initializeObject($data);
|
||||
|
||||
$requiredFields = array(
|
||||
"workspace"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +1,37 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_FacetResult extends Entity_Base
|
||||
{
|
||||
public $aFacetGroups = array ();
|
||||
public $aSelectedFacetGroups = array ();
|
||||
public $sFilterText = '';
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_FacetResult();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_FacetResult();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ("aFacetGroups","aSelectedFacetGroups","sFilterText"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
public $aFacetGroups = array ();
|
||||
public $aSelectedFacetGroups = array ();
|
||||
public $sFilterText = '';
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_FacetResult ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_FacetResult ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"aFacetGroups",
|
||||
"aSelectedFacetGroups",
|
||||
"sFilterText"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +1,40 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_SelectedFacetGroupItem extends Entity_Base
|
||||
{
|
||||
public $selectedFacetGroupName = '';
|
||||
public $selectedFacetGroupPrintName = '';
|
||||
public $selectedFacetItemName = '';
|
||||
public $selectedFacetItemPrintName = '';
|
||||
public $selectedFacetRemoveCondition = ''; // remove condition, string of
|
||||
|
||||
// selected facets without this
|
||||
// facet
|
||||
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_SelectedFacetGroupItem();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_SelectedFacetGroupItem();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ("selectedFacetGroupName","selectedFacetItemName"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
public $selectedFacetGroupName = '';
|
||||
public $selectedFacetGroupPrintName = '';
|
||||
public $selectedFacetItemName = '';
|
||||
public $selectedFacetItemPrintName = '';
|
||||
public $selectedFacetRemoveCondition = ''; // remove condition, string of
|
||||
// selected facets without this
|
||||
// facet
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_SelectedFacetGroupItem ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_SelectedFacetGroupItem ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"selectedFacetGroupName",
|
||||
"selectedFacetItemName"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +1,40 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_SolrQueryResult extends Entity_Base
|
||||
{
|
||||
public $sEcho = '';
|
||||
public $iTotalRecords = 0;
|
||||
public $iTotalDisplayRecords = 10;
|
||||
public $aaData = array (); // array of arrays of records to
|
||||
|
||||
// display
|
||||
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_SolrQueryResult();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_SolrQueryResult();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ('sEcho','iTotalRecords','iTotalDisplayRecords','aaData'
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
public $sEcho = '';
|
||||
public $iTotalRecords = 0;
|
||||
public $iTotalDisplayRecords = 10;
|
||||
public $aaData = array (); // array of arrays of records to
|
||||
// display
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_SolrQueryResult ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_SolrQueryResult ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
'sEcho',
|
||||
'iTotalRecords',
|
||||
'iTotalDisplayRecords',
|
||||
'aaData'
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +1,46 @@
|
||||
<?php
|
||||
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_SolrRequestData extends Entity_Base
|
||||
{
|
||||
public $workspace = '';
|
||||
public $startAfter = 0;
|
||||
public $pageSize = 10;
|
||||
public $searchText = '*:*';
|
||||
public $filterText = ''; // comma separated list of filters field:value
|
||||
public $numSortingCols = 0; // number of columns that are sorted
|
||||
public $sortableCols = array (); // array of booleans indicating if column is
|
||||
// sortable (true, false)
|
||||
public $sortCols = array (); // array of indices of sorted columns index
|
||||
// based in the total number of sorting cols
|
||||
public $sortDir = array (); // array of direction of sorting for each
|
||||
// column (desc, asc)
|
||||
public $includeCols = array ();
|
||||
public $resultFormat = 'xml'; // json, xml, php
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_SolrRequestData ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequestPagination($data)
|
||||
{
|
||||
$obj = new Entity_SolrRequestData ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
'workspace'
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public $workspace = '';
|
||||
public $startAfter = 0;
|
||||
public $pageSize = 10;
|
||||
public $searchText = '*:*';
|
||||
public $filterText = ''; // comma separated list of filters field:value
|
||||
public $numSortingCols = 0; // number of columns that are sorted
|
||||
public $sortableCols = array(); // array of booleans indicating if column is
|
||||
// sortable (true, false)
|
||||
public $sortCols = array(); // array of indices of sorted columns index
|
||||
// based in the total number of sorting cols
|
||||
public $sortDir = array(); // array of direction of sorting for each
|
||||
// column (desc, asc)
|
||||
public $includeCols = array();
|
||||
public $resultFormat = 'xml'; // json, xml, php
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_SolrRequestData ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public static function createForRequestPagination($data)
|
||||
{
|
||||
$obj = new Entity_SolrRequestData ();
|
||||
|
||||
$obj->initializeObject($data);
|
||||
|
||||
$requiredFields = array(
|
||||
'workspace'
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +1,35 @@
|
||||
<?php
|
||||
//require_once ('Base.php');
|
||||
require_once ('Base.php');
|
||||
|
||||
class Entity_SolrUpdateDocument extends Entity_Base
|
||||
{
|
||||
var $workspace = '';
|
||||
var $document = '';
|
||||
|
||||
private function __construct ()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty ()
|
||||
{
|
||||
$obj = new Entity_SolrUpdateDocument();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest ($data)
|
||||
{
|
||||
$obj = new Entity_SolrUpdateDocument();
|
||||
|
||||
$obj->initializeObject( $data );
|
||||
|
||||
$requiredFields = array ("workspace","document"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields( $requiredFields );
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
var $workspace = '';
|
||||
var $document = '';
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
static function createEmpty()
|
||||
{
|
||||
$obj = new Entity_SolrUpdateDocument ();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function createForRequest($data)
|
||||
{
|
||||
$obj = new Entity_SolrUpdateDocument ();
|
||||
|
||||
$obj->initializeObject ($data);
|
||||
|
||||
$requiredFields = array (
|
||||
"workspace",
|
||||
"document"
|
||||
);
|
||||
|
||||
$obj->validateRequiredFields ($requiredFields);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user