本文整理汇总了PHP中System::solrEnv方法的典型用法代码示例。如果您正苦于以下问题:PHP System::solrEnv方法的具体用法?PHP System::solrEnv怎么用?PHP System::solrEnv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::solrEnv方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
//get Solr initialization variables
if (($solrConf = System::solrEnv()) !== false) {
G::LoadClass('AppSolr');
$this->appSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
}
}
示例2: getAllCounters
function getAllCounters()
{
$userUid = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : null;
$oAppCache = new AppCacheView();
$aTypes = array();
$aTypes['to_do'] = 'CASES_INBOX';
$aTypes['draft'] = 'CASES_DRAFT';
$aTypes['cancelled'] = 'CASES_CANCELLED';
$aTypes['sent'] = 'CASES_SENT';
$aTypes['paused'] = 'CASES_PAUSED';
$aTypes['completed'] = 'CASES_COMPLETED';
$aTypes['selfservice'] = 'CASES_SELFSERVICE';
//$aTypes['to_revise'] = 'CASES_TO_REVISE';
//$aTypes['to_reassign'] = 'CASES_TO_REASSIGN';
$solrEnabled = false;
if (($solrConf = System::solrEnv()) !== false) {
G::LoadClass('AppSolr');
$ApplicationSolrIndex = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) {
$solrEnabled = true;
}
}
if ($solrEnabled) {
$aCount = $ApplicationSolrIndex->getCasesCount($userUid);
//get paused count
$aCountMissing = $oAppCache->getAllCounters(array('completed', 'cancelled'), $userUid);
$aCount = array_merge($aCount, $aCountMissing);
} else {
$aCount = $oAppCache->getAllCounters(array_keys($aTypes), $userUid);
}
$response = array();
$i = 0;
foreach ($aCount as $type => $count) {
$response[$i] = new stdclass();
$response[$i]->item = $aTypes[$type];
$response[$i]->count = $count;
$i++;
}
echo G::json_encode($response);
}
示例3: caseList
/**
* Get case list
*
* @param string $userId
* @return $result will return an object
*/
public function caseList($userUid)
{
try {
$solrEnabled = 0;
if (($solrEnv = System::solrEnv()) !== false) {
G::LoadClass("AppSolr");
$appSolr = new AppSolr(
$solrEnv["solr_enabled"],
$solrEnv["solr_host"],
$solrEnv["solr_instance"]
);
if ($appSolr->isSolrEnabled() && $solrEnv["solr_enabled"] == true) {
//Check if there are missing records to reindex and reindex them
$appSolr->synchronizePendingApplications();
$solrEnabled = 1;
}
}
if ($solrEnabled == 1) {
try {
G::LoadClass("searchIndex");
$arrayData = array();
$delegationIndexes = array();
$columsToInclude = array("APP_UID");
$solrSearchText = null;
//Todo
$solrSearchText = $solrSearchText . (($solrSearchText != null)? " OR " : null) . "(APP_STATUS:TO_DO AND APP_ASSIGNED_USERS:" . $userUid . ")";
$delegationIndexes[] = "APP_ASSIGNED_USER_DEL_INDEX_" . $userUid . "_txt";
//Draft
$solrSearchText = $solrSearchText . (($solrSearchText != null)? " OR " : null) . "(APP_STATUS:DRAFT AND APP_DRAFT_USER:" . $userUid . ")";
//Index is allways 1
$solrSearchText = "($solrSearchText)";
//Add del_index dynamic fields to list of resulting columns
$columsToIncludeFinal = array_merge($columsToInclude, $delegationIndexes);
//.........这里部分代码省略.........
示例4: array_unshift
//array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'unpauseLink' ) );
}
/*
if ( $action == 'to_reassign' ) {
array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'reassignLink' ) );
}
*/
// if ( $action == 'cancelled' ) {
// array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'reactivateLink' ) );
// }
$userUid = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : null;
$oAppCache = new AppCacheView();
$oAppCache->confCasesList = $confCasesList;
$solrEnabled = 0;
if ($action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" || $action == "unassigned" || $action == "search") {
$solrConfigured = ($solrConf = System::solrEnv()) !== false ? 1 : 0;
if ($solrConfigured == 1) {
G::LoadClass('AppSolr');
$applicationSolrIndex = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
if ($applicationSolrIndex->isSolrEnabled()) {
$solrEnabled = 1;
}
}
}
//get values for the comboBoxes
$processes[] = array('', G::LoadTranslation('ID_ALL_PROCESS'));
$status = getStatusArray($action, $userUid);
$category = getCategoryArray();
$users = getUserArray($action, $userUid);
$allUsers = getAllUsersArray($action);
$oHeadPublisher->assign('reassignReaderFields', $reassignReaderFields);
示例5: processWorkspace
function processWorkspace()
{
global $sLastExecution;
global $ScriptAction;
global $SkipRecords;
global $TrunkSize;
global $appUid;
try {
if (($solrConf = System::solrEnv(SYS_SYS)) !== false) {
G::LoadClass('AppSolr');
print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n";
print "solr_enabled: " . $solrConf['solr_enabled'] . "\n";
print "solr_host: " . $solrConf['solr_host'] . "\n";
print "solr_instance: " . $solrConf['solr_instance'] . "\n";
$oAppSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
if ($ScriptAction == "reindexall") {
$oAppSolr->reindexAllApplications($SkipRecords, $TrunkSize);
}
if ($ScriptAction == "reindexmissing") {
$oAppSolr->synchronizePendingApplications();
}
if ($ScriptAction == "optimizeindex") {
$oAppSolr->optimizeSearchIndex();
}
if ($ScriptAction == "reindexone") {
if ($appUid == "") {
print "Missing -appuid parameter. please complete it with this option.\n";
}
$oAppSolr->updateApplicationSearchIndex($appUid);
}
} else {
print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini";
}
} catch (Exception $oError) {
saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n");
}
}
示例6: processWorkspace
function processWorkspace()
{
global $sLastExecution;
global $ScriptAction;
try {
if (($solrConf = System::solrEnv(SYS_SYS)) !== false) {
G::LoadClass('AppSolr');
print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n";
print "solr_enabled: " . $solrConf['solr_enabled'] . "\n";
print "solr_host: " . $solrConf['solr_host'] . "\n";
print "solr_instance: " . $solrConf['solr_instance'] . "\n";
$oAppSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
if ($ScriptAction == "reindexall") {
$oAppSolr->reindexAllApplications();
}
if ($ScriptAction == "reindexmissing") {
$oAppSolr->synchronizePendingApplications();
}
} else {
print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini";
}
} catch (Exception $oError) {
saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n");
}
}
示例7: getAppsData
public function getAppsData (
$type,
$start = null,
$limit = null,
$user = null,
$filter = null,
$search = null,
$process = null,
$status = null,
$dateFrom = null,
$dateTo = null,
$callback = null,
$dir = null,
$sort = "APP_CACHE_VIEW.APP_NUMBER",
$category = null)
{
require_once ("classes/model/AppNotes.php");
$appNotes = new AppNotes();
$start = empty( $start ) ? $this->appListStart : $start;
$limit = empty( $limit ) ? $this->appListLimit : $limit;
$notesStart = 0;
$notesLimit = 4;
switch ($user) {
case 'CURRENT_USER':
$user = $this->userID;
break;
case 'ALL':
$user = null;
break;
case null:
$user = $this->userID;
break;
default:
//$user = $this->userID;
break;
}
$solrEnabled = false;
if ((
$type == "todo" || $type == "draft" || $type == "paused" || $type == "sent" ||
$type == "selfservice" || $type == "unassigned" || $type == "search"
) &&
(($solrConf = System::solrEnv()) !== false)
) {
G::LoadClass("AppSolr");
$ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"],
$solrConf["solr_host"],
$solrConf["solr_instance"]
);
if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) {
//Check if there are missing records to reindex and reindex them
$ApplicationSolrIndex->synchronizePendingApplications();
$solrEnabled = true;
} else{
$solrEnabled = false;
}
}
if ($solrEnabled) {
$cases = $ApplicationSolrIndex->getAppGridData(
$user,
$start,
$limit,
$type,
$filter,
$search,
$process,
$status,
'',
$dateFrom,
$dateTo,
$callback,
$dir,
$sort,
$category
);
} else {
G::LoadClass( 'applications' );
$apps = new Applications();
$cases = $apps->getAll(
$user,
$start,
$limit,
$type,
$filter,
$search,
$process,
$status,
'',
$dateFrom,
$dateTo,
//.........这里部分代码省略.........
示例8: isset
$type = isset($_GET["type"]) ? $_GET["type"] : (isset($_POST["type"]) ? $_POST["type"] : "extjs");
$dateFrom = isset($_POST["dateFrom"]) ? substr($_POST["dateFrom"], 0, 10) : "";
$dateTo = isset($_POST["dateTo"]) ? substr($_POST["dateTo"], 0, 10) : "";
try {
$userUid = isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "" ? $_SESSION["USER_LOGGED"] : null;
$result = "";
switch ($action) {
case "search":
case "to_reassign":
$user = $user == "CURRENT_USER" ? $userUid : $user;
$userUid = $user;
break;
default:
break;
}
if (($action == "todo" || $action == "draft" || $action == "paused" || $action == "sent" || $action == "selfservice" || $action == "unassigned" || $action == "search") && ($solrConf = System::solrEnv()) !== false) {
G::LoadClass("AppSolr");
$ApplicationSolrIndex = new AppSolr($solrConf["solr_enabled"], $solrConf["solr_host"], $solrConf["solr_instance"]);
$data = $ApplicationSolrIndex->getAppGridData($userUid, $start, $limit, $action, $filter, $search, $process, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort, $category);
$result = G::json_encode($data);
} else {
G::LoadClass("applications");
$apps = new Applications();
$data = $apps->getAll($userUid, $start, $limit, $action, $filter, $search, $process, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort, $category);
$result = G::json_encode($data);
}
echo $result;
} catch (Exception $e) {
$msg = array("error" => $e->getMessage());
echo G::json_encode($msg);
}
示例9: AppSolr
$result = G::json_encode($result);
echo $result;
return ;
}
$user = ($user == "CURRENT_USER")? $userUid : $user;
$userUid = $user;
break;
default:
break;
}
if ((
$action == "todo" || $action == "draft" || $action == "paused" || $action == "sent" ||
$action == "selfservice" || $action == "unassigned" || $action == "search"
) &&
(($solrConf = System::solrEnv()) !== false)
) {
G::LoadClass("AppSolr");
$ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"],
$solrConf["solr_host"],
$solrConf["solr_instance"]
);
if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) {
//Check if there are missing records to reindex and reindex them
$ApplicationSolrIndex->synchronizePendingApplications();
$solrEnabled = true;
} else{
$solrEnabled = false;
示例10: getCaseInfo
/**
* Get data of a Case
*
* @param string $applicationUid Unique id of Case
* @param string $userUid Unique id of User
*
* return array Return an array with data of Case Info
*/
public function getCaseInfo($applicationUid, $userUid)
{
try {
$solrEnabled = 0;
if (($solrEnv = \System::solrEnv()) !== false) {
\G::LoadClass("AppSolr");
$appSolr = new \AppSolr(
$solrEnv["solr_enabled"],
$solrEnv["solr_host"],
$solrEnv["solr_instance"]
);
if ($appSolr->isSolrEnabled() && $solrEnv["solr_enabled"] == true) {
//Check if there are missing records to reindex and reindex them
$appSolr->synchronizePendingApplications();
$solrEnabled = 1;
}
}
if ($solrEnabled == 1) {
try {
\G::LoadClass("searchIndex");
$arrayData = array();
$delegationIndexes = array();
$columsToInclude = array("APP_UID");
$solrSearchText = null;
//Todo
$solrSearchText = $solrSearchText . (($solrSearchText != null)? " OR " : null) . "(APP_STATUS:TO_DO AND APP_ASSIGNED_USERS:" . $userUid . ")";
$delegationIndexes[] = "APP_ASSIGNED_USER_DEL_INDEX_" . $userUid . "_txt";
//Draft
$solrSearchText = $solrSearchText . (($solrSearchText != null)? " OR " : null) . "(APP_STATUS:DRAFT AND APP_DRAFT_USER:" . $userUid . ")";
//Index is allways 1
$solrSearchText = "($solrSearchText)";
//Add del_index dynamic fields to list of resulting columns
$columsToIncludeFinal = array_merge($columsToInclude, $delegationIndexes);
$solrRequestData = \Entity_SolrRequestData::createForRequestPagination(
array(
"workspace" => $solrEnv["solr_instance"],
"startAfter" => 0,
"pageSize" => 1000,
"searchText" => $solrSearchText,
"numSortingCols" => 1,
"sortCols" => array("APP_NUMBER"),
"sortDir" => array(strtolower("DESC")),
"includeCols" => $columsToIncludeFinal,
"resultFormat" => "json"
)
);
//Use search index to return list of cases
$searchIndex = new \BpmnEngine_Services_SearchIndex($appSolr->isSolrEnabled(), $solrEnv["solr_host"]);
//Execute query
$solrQueryResult = $searchIndex->getDataTablePaginatedList($solrRequestData);
//Get the missing data from database
$arrayApplicationUid = array();
foreach ($solrQueryResult->aaData as $i => $data) {
$arrayApplicationUid[] = $data["APP_UID"];
}
$aaappsDBData = $appSolr->getListApplicationDelegationData($arrayApplicationUid);
foreach ($solrQueryResult->aaData as $i => $data) {
//Initialize array
$delIndexes = array(); //Store all the delegation indexes
//Complete empty values
$applicationUid = $data["APP_UID"]; //APP_UID
//Get all the indexes returned by Solr as columns
for ($i = count($columsToInclude); $i <= count($data) - 1; $i++) {
if (is_array($data[$columsToIncludeFinal[$i]])) {
foreach ($data[$columsToIncludeFinal[$i]] as $delIndex) {
$delIndexes[] = $delIndex;
}
}
}
//Verify if the delindex is an array
//if is not check different types of repositories
//the delegation index must always be defined.
if (count($delIndexes) == 0) {
$delIndexes[] = 1; // the first default index
}
//Remove duplicated
$delIndexes = array_unique($delIndexes);
//Get records
foreach ($delIndexes as $delIndex) {
$aRow = array();
//Copy result values to new row from Solr server
$aRow["APP_UID"] = $data["APP_UID"];
//Get delegation data from DB
//Filter data from db
$indexes = $appSolr->aaSearchRecords($aaappsDBData, array(
"APP_UID" => $applicationUid,
"DEL_INDEX" => $delIndex
));
foreach ($indexes as $index) {
$row = $aaappsDBData[$index];
}
if (!isset($row)) {
//.........这里部分代码省略.........
示例11: getListUids
function getListUids($usrUid, $action)
{
if (($solrConf = System::solrEnv(SYS_SYS)) !== false) {
G::LoadClass('AppSolr');
print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n";
print "solr_enabled: " . $solrConf['solr_enabled'] . "\n";
print "solr_host: " . $solrConf['solr_host'] . "\n";
print "solr_instance: " . $solrConf['solr_instance'] . "\n";
$oAppSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
G::LoadClass("applications");
$apps = new Applications();
} else {
print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini";
return;
}
//get the list of id's
$userUid = $usrUid;
$start = 0;
$limit = 1;
$action = $action;
//todo,
$filter = '';
$search = '';
$process = '';
$user = '';
$status = '';
$type = 'extjs';
$dateFrom = '';
$dateTo = '';
$callback = 'stcCallback1001';
$dir = 'DESC';
$sort = 'APP_NUMBER';
$category = '';
$dataSolr = $oAppSolr->getAppGridData($userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort);
$dataDB = $apps->getAll($userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort, $category);
$aAppUidsSolr = array();
$aAppUidsDB = array();
$trunkSize = 1000;
//get DB uids
print "Get DB Uids \n";
$totalCasesDB = $dataDB["totalCount"];
$loops = $totalCasesDB % $trunkSize > 0 ? $totalCasesDB / $trunkSize + 1 : $totalCasesDB / $trunkSize;
for ($i = 0; $i < $loops; $i++) {
$start = $i * $trunkSize;
$limit = $trunkSize;
//print " Loop $start to " . (String)($start + $trunkSize) . " \n";
$dataDB = $apps->getAll($userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort, $category);
foreach ($dataDB["data"] as $caseDB) {
$aAppUidsDB[] = $caseDB["APP_UID"];
}
}
//get Solr uids
print "Get Solr Uids \n";
$totalCasesSolr = $dataSolr["totalCount"];
$loops = $totalCasesSolr % $trunkSize > 0 ? $totalCasesSolr / $trunkSize + 1 : $totalCasesSolr / $trunkSize;
for ($i = 0; $i < $loops; $i++) {
$start = $i * $trunkSize;
$limit = $trunkSize;
//print " Loop $start to " . (String)($start + $trunkSize) . " \n";
$dataSolr = $oAppSolr->getAppGridData($userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort);
foreach ($dataSolr["data"] as $caseSolr) {
$aAppUidsSolr[] = $caseSolr["APP_UID"];
}
}
$result = array();
$result['total_cases_db'] = $totalCasesDB;
$result['aDBAppUids'] = $aAppUidsDB;
$result['total_cases_solr'] = $totalCasesSolr;
$result['aSolrAppUids'] = $aAppUidsSolr;
return $result;
}
示例12:
//sending the columns to display in grid
$oHeadPublisher->assign('action', $action);
//sending the action to make
$oHeadPublisher->assign('PMDateFormat', $dateFormat);
//sending the fields to get from proxy
$oHeadPublisher->assign('statusValues', $status);
//Sending the listing of status
$oHeadPublisher->assign('processValues', $processes);
//Sending the listing of processes
$oHeadPublisher->assign('categoryValues', $category);
//Sending the listing of categories
$oHeadPublisher->assign('userValues', $users);
//Sending the listing of users
$oHeadPublisher->assign('allUsersValues', $allUsers);
//Sending the listing of all users
$oHeadPublisher->assign("solrEnabled", ($aux = System::solrEnv()) !== false ? 1 : 0);
//Sending the status of solar
//menu permissions
/*$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn( AppThreadPeer::APP_THREAD_PARENT );
$c->add(AppThreadPeer::APP_UID, $APP_UID );
$c->add(AppThreadPeer::APP_THREAD_STATUS , 'OPEN' );
$cnt = AppThreadPeer::doCount($c);*/
$cnt = '';
$menuPerms = '';
$menuPerms = $menuPerms . ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) ? 'R' : '';
//can reassign case
$oHeadPublisher->assign('___p34315105', $menuPerms);
// user menu permissions
G::LoadClass('configuration');
示例13: isset
$start = isset($_POST['start']) ? $_POST['start'] : '0';
$limit = isset($_POST['limit']) ? $_POST['limit'] : '25';
$filter = isset($_POST['filter']) ? $_POST['filter'] : '';
$search = isset($_POST['search']) ? $_POST['search'] : '';
$process = isset($_POST['process']) ? $_POST['process'] : '';
$user = isset($_POST['user']) ? $_POST['user'] : '';
$status = isset($_POST['status']) ? strtoupper($_POST['status']) : '';
$action = isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : 'todo');
$type = isset($_GET['type']) ? $_GET['type'] : (isset($_POST['type']) ? $_POST['type'] : 'extjs');
$user = isset($_POST['user']) ? $_POST['user'] : '';
$dateFrom = isset($_POST['dateFrom']) ? substr($_POST['dateFrom'], 0, 10) : '';
$dateTo = isset($_POST['dateTo']) ? substr($_POST['dateTo'], 0, 10) : '';
try {
$result = "";
$userUid = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : null;
if (($action == 'todo' || $action == 'draft' || $action == 'sent' || $action == 'selfservice' || $action == 'unassigned' || $action == 'search') && ($solrConf = System::solrEnv()) !== false) {
G::LoadClass('AppSolr');
$ApplicationSolrIndex = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
$data = $ApplicationSolrIndex->getAppGridData($userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort);
$result = G::json_encode($data);
} else {
G::LoadClass('applications');
$apps = new Applications();
$data = $apps->getAll($userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort);
$result = G::json_encode($data);
}
echo $result;
} catch (Exception $e) {
$msg = array('error' => $e->getMessage());
print G::json_encode($msg);
}