本文整理汇总了PHP中AJXP_Node::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Node::getPath方法的具体用法?PHP AJXP_Node::getPath怎么用?PHP AJXP_Node::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Node
的用法示例。
在下文中一共展示了AJXP_Node::getPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: moveMeta
/**
*
* @param AJXP_Node $oldFile
* @param AJXP_Node $newFile
* @param Boolean $copy
*/
public function moveMeta($oldFile, $newFile = null, $copy = false)
{
if ($oldFile == null) {
return;
}
$feedStore = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("feed");
if ($feedStore !== false) {
$feedStore->updateMetaObject($oldFile->getRepositoryId(), $oldFile->getPath(), $newFile != null ? $newFile->getPath() : null, $copy);
return;
}
if (!$copy && $this->metaStore->inherentMetaMove()) {
return;
}
$oldMeta = $this->metaStore->retrieveMetadata($oldFile, AJXP_META_SPACE_COMMENTS);
if (!count($oldMeta)) {
return;
}
// If it's a move or a delete, delete old data
if (!$copy) {
$this->metaStore->removeMetadata($oldFile, AJXP_META_SPACE_COMMENTS);
}
// If copy or move, copy data.
if ($newFile != null) {
$this->metaStore->setMetadata($newFile, AJXP_META_SPACE_COMMENTS, $oldMeta);
}
}
示例2: replaceVars
protected function replaceVars($tplString, $mess, $rich = true)
{
$tplString = SystemTextEncoding::fromUTF8($tplString);
$repoId = $this->getNode()->getRepositoryId();
$repoObject = ConfService::getRepositoryById($repoId);
if ($repoObject != null) {
$repoLabel = $repoObject->getDisplay();
} else {
$repoLabel = "Repository";
}
$uLabel = "";
if (strstr($tplString, "AJXP_USER") !== false) {
$uLabel = $this->getAuthorLabel();
}
$em = $rich ? "<em>" : "";
$me = $rich ? "</em>" : "";
$replaces = array("AJXP_NODE_PATH" => $em . $this->getRoot($this->getNode()->getPath()) . $me, "AJXP_NODE_LABEL" => $em . $this->getNode()->getLabel() . $me, "AJXP_PARENT_PATH" => $em . $this->getRoot(dirname($this->getNode()->getPath())) . $me, "AJXP_PARENT_LABEL" => $em . $this->getRoot(basename(dirname($this->getNode()->getPath()))) . $me, "AJXP_REPOSITORY_ID" => $em . $repoId . $me, "AJXP_REPOSITORY_LABEL" => $em . $repoLabel . $me, "AJXP_LINK" => $this->getMainLink(), "AJXP_USER" => $uLabel, "AJXP_DATE" => SystemTextEncoding::fromUTF8(AJXP_Utils::relativeDate($this->getDate(), $mess)));
if ($replaces["AJXP_NODE_LABEL"] == $em . $me || $replaces["AJXP_NODE_LABEL"] == $em . "/" . $me) {
$replaces["AJXP_NODE_LABEL"] = $replaces["AJXP_REPOSITORY_LABEL"];
}
if ($replaces["AJXP_PARENT_LABEL"] == $em . $me || $replaces["AJXP_PARENT_LABEL"] == $em . "/" . $me) {
$replaces["AJXP_PARENT_LABEL"] = $replaces["AJXP_REPOSITORY_LABEL"];
}
if ((strstr($tplString, "AJXP_TARGET_FOLDER") !== false || strstr($tplString, "AJXP_SOURCE_FOLDER")) && isset($this->secondaryNode)) {
$p = $this->secondaryNode->getPath();
if ($this->secondaryNode->isLeaf()) {
$p = $this->getRoot(dirname($p));
}
$replaces["AJXP_TARGET_FOLDER"] = $replaces["AJXP_SOURCE_FOLDER"] = $em . $p . $me;
}
if ((strstr($tplString, "AJXP_TARGET_LABEL") !== false || strstr($tplString, "AJXP_SOURCE_LABEL") !== false) && isset($this->secondaryNode)) {
$replaces["AJXP_TARGET_LABEL"] = $replaces["AJXP_SOURCE_LABEL"] = $em . $this->secondaryNode->getLabel() . $me;
}
return str_replace(array_keys($replaces), array_values($replaces), $tplString);
}
示例3: getMainLink
/**
* @return string
*/
public function getMainLink()
{
$repoId = $this->getNode()->getRepositoryId();
if (isset($_SESSION["CURRENT_MINISITE"])) {
$hash = $_SESSION["CURRENT_MINISITE"];
$shareCenter = ShareCenter::getShareCenter();
if (!empty($shareCenter)) {
return $shareCenter->buildPublicletLink($hash);
}
}
return trim(AJXP_Utils::detectServerURL(true), "/") . "/?goto=" . $repoId . $this->node->getPath();
}
示例4: replaceVars
protected function replaceVars($tplString, $mess, $rich = true)
{
$tplString = SystemTextEncoding::fromUTF8($tplString);
$repoId = $this->getNode()->getRepositoryId();
if (ConfService::getRepositoryById($repoId) != null) {
$repoLabel = ConfService::getRepositoryById($repoId)->getDisplay();
} else {
$repoLabel = "Repository";
}
$uLabel = "";
if (array_key_exists($this->getAuthor(), self::$usersCaches)) {
if (self::$usersCaches[$this->getAuthor()] != 'AJXP_USER_DONT_EXISTS') {
$uLabel = self::$usersCaches[$this->getAuthor()];
}
} else {
if (strstr($tplString, "AJXP_USER") !== false) {
if (AuthService::userExists($this->getAuthor())) {
$obj = ConfService::getConfStorageImpl()->createUserObject($this->getAuthor());
$uLabel = $obj->personalRole->filterParameterValue("core.conf", "USER_DISPLAY_NAME", AJXP_REPO_SCOPE_ALL, "");
self::$usersCaches[$this->getAuthor()] = $uLabel;
} else {
self::$usersCaches[$this->getAuthor()] = 'AJXP_USER_DONT_EXISTS';
}
}
}
if (empty($uLabel)) {
$uLabel = $this->getAuthor();
}
$em = $rich ? "<em>" : "";
$me = $rich ? "</em>" : "";
$replaces = array("AJXP_NODE_PATH" => $em . $this->getRoot($this->getNode()->getPath()) . $me, "AJXP_NODE_LABEL" => $em . $this->getNode()->getLabel() . $me, "AJXP_PARENT_PATH" => $em . $this->getRoot(dirname($this->getNode()->getPath())) . $me, "AJXP_PARENT_LABEL" => $em . $this->getRoot(basename(dirname($this->getNode()->getPath()))) . $me, "AJXP_REPOSITORY_ID" => $em . $repoId . $me, "AJXP_REPOSITORY_LABEL" => $em . $repoLabel . $me, "AJXP_LINK" => $this->getMainLink(), "AJXP_USER" => $uLabel, "AJXP_DATE" => SystemTextEncoding::fromUTF8(AJXP_Utils::relativeDate($this->getDate(), $mess)));
if ($replaces["AJXP_NODE_LABEL"] == $em . $me) {
$replaces["AJXP_NODE_LABEL"] = $em . "[" . $replaces["AJXP_REPOSITORY_LABEL"] . "]" . $me;
}
if ($replaces["AJXP_PARENT_LABEL"] == $em . $me) {
$replaces["AJXP_PARENT_LABEL"] = $em . "[" . $replaces["AJXP_REPOSITORY_LABEL"] . "]" . $me;
}
if ((strstr($tplString, "AJXP_TARGET_FOLDER") !== false || strstr($tplString, "AJXP_SOURCE_FOLDER")) && isset($this->secondaryNode)) {
$p = $this->secondaryNode->getPath();
if ($this->secondaryNode->isLeaf()) {
$p = $this->getRoot(dirname($p));
}
$replaces["AJXP_TARGET_FOLDER"] = $replaces["AJXP_SOURCE_FOLDER"] = $em . $p . $me;
}
if ((strstr($tplString, "AJXP_TARGET_LABEL") !== false || strstr($tplString, "AJXP_SOURCE_LABEL") !== false) && isset($this->secondaryNode)) {
$replaces["AJXP_TARGET_LABEL"] = $replaces["AJXP_SOURCE_LABEL"] = $em . $this->secondaryNode->getLabel() . $me;
}
return str_replace(array_keys($replaces), array_values($replaces), $tplString);
}
示例5: recursiveIndexation
/**
*
* @param AJXP_Node $node
* @param int $depth
* @throws Exception
*/
public function recursiveIndexation($node, $depth = 0)
{
$repository = $node->getRepository();
$user = $node->getUser();
$messages = ConfService::getMessages();
if ($user == null && AuthService::usersEnabled()) {
$user = AuthService::getLoggedUser();
}
if ($depth == 0) {
$this->logDebug("Starting indexation - node.index.recursive.start - " . memory_get_usage(true) . " - " . $node->getUrl());
$this->setIndexStatus("RUNNING", str_replace("%s", $node->getPath(), $messages["core.index.8"]), $repository, $user);
AJXP_Controller::applyHook("node.index.recursive.start", array($node));
} else {
if ($this->isInterruptRequired($repository, $user)) {
$this->logDebug("Interrupting indexation! - node.index.recursive.end - " . $node->getUrl());
AJXP_Controller::applyHook("node.index.recursive.end", array($node));
$this->releaseStatus($repository, $user);
throw new Exception("User interrupted");
}
}
if (!ConfService::currentContextIsCommandLine()) {
@set_time_limit(120);
}
$url = $node->getUrl();
$this->logDebug("Indexing Node parent node " . $url);
$this->setIndexStatus("RUNNING", str_replace("%s", $node->getPath(), $messages["core.index.8"]), $repository, $user);
try {
AJXP_Controller::applyHook("node.index", array($node));
} catch (Exception $e) {
$this->logDebug("Error Indexing Node " . $url . " (" . $e->getMessage() . ")");
}
$handle = opendir($url);
if ($handle !== false) {
while (($child = readdir($handle)) != false) {
if ($child[0] == ".") {
continue;
}
$childNode = new AJXP_Node(rtrim($url, "/") . "/" . $child);
$childUrl = $childNode->getUrl();
if (is_dir($childUrl)) {
$this->logDebug("Entering recursive indexation for " . $childUrl);
$this->recursiveIndexation($childNode, $depth + 1);
} else {
try {
$this->logDebug("Indexing Node " . $childUrl);
AJXP_Controller::applyHook("node.index", array($childNode));
} catch (Exception $e) {
$this->logDebug("Error Indexing Node " . $childUrl . " (" . $e->getMessage() . ")");
}
}
}
closedir($handle);
} else {
$this->logDebug("Cannot open {$url}!!");
}
if ($depth == 0) {
$this->logDebug("End indexation - node.index.recursive.end - " . memory_get_usage(true) . " - " . $node->getUrl());
$this->setIndexStatus("RUNNING", "Indexation finished, cleaning...", $repository, $user);
AJXP_Controller::applyHook("node.index.recursive.end", array($node));
$this->releaseStatus($repository, $user);
$this->logDebug("End indexation - After node.index.recursive.end - " . memory_get_usage(true) . " - " . $node->getUrl());
}
}
示例6: publishNodeChange
/**
* @param AJXP_Node $origNode
* @param AJXP_Node $newNode
* @param bool $copy
*/
public function publishNodeChange($origNode = null, $newNode = null, $copy = false)
{
$content = "";
$repo = "";
$targetUserId = null;
$nodePathes = array();
$update = false;
if ($newNode != null) {
$repo = $newNode->getRepositoryId();
$targetUserId = $newNode->getUser();
$nodePathes[] = $newNode->getPath();
$update = false;
$data = array();
if ($origNode != null && !$copy) {
$update = true;
$data[$origNode->getPath()] = $newNode;
} else {
$data[] = $newNode;
}
$content = AJXP_XMLWriter::writeNodesDiff(array($update ? "UPDATE" : "ADD" => $data));
}
if ($origNode != null && !$update && !$copy) {
$repo = $origNode->getRepositoryId();
$targetUserId = $origNode->getUser();
$nodePathes[] = $origNode->getPath();
$content = AJXP_XMLWriter::writeNodesDiff(array("REMOVE" => array($origNode->getPath())));
}
if (!empty($content) && $repo != "") {
$this->sendInstantMessage($content, $repo, $targetUserId, null, $nodePathes);
}
}
示例7: updateNodeSharedData
/**
* Hook node.change
* @param AJXP_Node $oldNode
* @param AJXP_Node $newNode
* @param bool $copy
*/
public function updateNodeSharedData($oldNode = null, $newNode = null, $copy = false)
{
if ($oldNode == null || $copy) {
// Create or copy, do nothing
return;
}
if ($oldNode != null && $newNode != null && $oldNode->getUrl() == $newNode->getUrl()) {
// Same path => must be a content update, do nothing
return;
}
$this->logDebug("Should update node");
$delete = false;
if ($newNode == null) {
$delete = true;
} else {
$repo = $newNode->getRepository();
$recycle = $repo->getOption("RECYCLE_BIN");
if (!empty($recycle) && strpos($newNode->getPath(), $recycle) === 1) {
$delete = true;
}
}
$shareStore = $this->getShareStore();
$modifiedNodes = $shareStore->moveSharesFromMetaRecursive($oldNode, $delete, $oldNode->getPath(), $newNode != null ? $newNode->getPath() : null);
// Force switching back to correct driver!
if ($modifiedNodes > 0) {
$oldNode->getRepository()->driverInstance = null;
$oldNode->setDriver(null);
$oldNode->getDriver();
}
return;
}
示例8: collectChildrenWithRepositoryMeta
/**
* @param AJXP_Node $ajxpNode
* @param string $nameSpace
* @param string $userScope
* @return array
*/
public function collectChildrenWithRepositoryMeta($ajxpNode, $nameSpace, $userScope)
{
$result = array();
$repositoryId = $ajxpNode->getRepositoryId();
$metaFile = $this->globalMetaFile . "_" . $repositoryId;
$metaFile = $this->updateSecurityScope($metaFile, $ajxpNode->getRepositoryId(), $ajxpNode->getUser());
if (!is_file($metaFile)) {
return $result;
}
$raw_data = file_get_contents($metaFile);
if ($raw_data === false) {
return $result;
}
$metadata = unserialize($raw_data);
if ($metadata === false || !is_array($metadata)) {
return $result;
}
$srcPath = $ajxpNode->getPath();
if ($srcPath == "/") {
$srcPath = "";
}
foreach ($metadata as $path => $data) {
preg_match("#^" . preg_quote($srcPath, "#") . "/#", $path, $matches);
if ($path == $srcPath || count($matches)) {
$relativePath = substr($path, strlen($srcPath));
// REMOVE ORIGINAL NODE PATH
if ($relativePath === false) {
$relativePath = "/";
}
foreach ($data as $userId => $meta) {
if (($userScope == $userId || $userScope == AJXP_METADATA_ALLUSERS) && isset($meta[$nameSpace])) {
if (!isset($result[$relativePath])) {
$result[$relativePath] = array();
}
$result[$relativePath][$userId] = $meta[$nameSpace];
}
}
}
}
return $result;
}
示例9: videoAlternateVersions
/**
* @param AJXP_Node $ajxpNode
*/
public function videoAlternateVersions(&$ajxpNode)
{
if (!preg_match('/\\.mpg$|\\.mp4$|\\.ogv$|\\.webm$/i', $ajxpNode->getLabel())) {
return;
}
if (file_exists(str_replace(".mpg", "_PREVIEW.mp4", $ajxpNode->getUrl()))) {
$ajxpNode->mergeMetadata(array("video_altversion_mp4" => str_replace(".mpg", "_PREVIEW.mp4", $ajxpNode->getPath())));
}
$rotating = array("mp4", "ogv", "webm");
foreach ($rotating as $ext) {
if (preg_match('/\\.' . $ext . '$/i', $ajxpNode->getLabel())) {
foreach ($rotating as $other) {
if ($other == $ext) {
continue;
}
if (file_exists(str_replace($ext, $other, $ajxpNode->getUrl()))) {
$ajxpNode->mergeMetadata(array("video_altversion_" . $other => str_replace($ext, $other, $ajxpNode->getPath())));
}
}
}
}
}
示例10: moveShareIfPossible
/**
* @param String $type
* @param String $element
* @param AJXP_Node $oldNode
* @param AJXP_Node $newNode
* @return bool
*/
public function moveShareIfPossible($type, $element, $oldNode, $newNode)
{
if (!$this->sqlSupported) {
return false;
}
$this->confStorage->simpleStoreGet("share", $element, "serial", $data);
if ($oldNode->isLeaf() && $type == "minisite" && is_array($data)) {
$repo = ConfService::getRepositoryById($data["REPOSITORY"]);
$cFilter = $repo->getContentFilter();
if (isset($cFilter)) {
$cFilter->movePath($oldNode->getPath(), $newNode->getPath());
}
}
}
示例11: nodeBookmarkMetadata
/**
* @param AJXP_Node $ajxpNode
* @return void
*/
public function nodeBookmarkMetadata(&$ajxpNode)
{
$user = AuthService::getLoggedUser();
if ($user == null) {
return;
}
$metadata = $ajxpNode->retrieveMetadata("ajxp_bookmarked", true, AJXP_METADATA_SCOPE_REPOSITORY, true);
if (is_array($metadata) && count($metadata)) {
$ajxpNode->mergeMetadata(array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png", "overlay_class" => "icon-bookmark-empty"), true);
return;
}
if (!isset(self::$loadedBookmarks)) {
self::$loadedBookmarks = $user->getBookmarks();
}
foreach (self::$loadedBookmarks as $bm) {
if ($bm["PATH"] == $ajxpNode->getPath()) {
$ajxpNode->mergeMetadata(array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png", "overlay_class" => "icon-bookmark-empty"), true);
$ajxpNode->setMetadata("ajxp_bookmarked", array("ajxp_bookmarked" => "true"), true, AJXP_METADATA_SCOPE_REPOSITORY, true);
}
}
}
示例12: saveMetaFileData
/**
* @param AJXP_Node $ajxpNode
* @param String $scope
* @param String $userId
*/
protected function saveMetaFileData($ajxpNode, $scope, $userId)
{
$currentFile = $ajxpNode->getUrl();
$repositoryId = $ajxpNode->getRepositoryId();
$fileKey = $ajxpNode->getPath();
if (isset($this->options["METADATA_FILE_LOCATION"]) && $this->options["METADATA_FILE_LOCATION"] == "outside") {
// Force scope
$scope = AJXP_METADATA_SCOPE_REPOSITORY;
}
if ($scope == AJXP_METADATA_SCOPE_GLOBAL) {
$metaFile = dirname($currentFile) . "/" . $this->options["METADATA_FILE"];
$fileKey = basename($fileKey);
} else {
if (!is_dir(dirname($this->globalMetaFile))) {
mkdir(dirname($this->globalMetaFile), 0755, true);
}
$metaFile = $this->globalMetaFile . "_" . $repositoryId;
}
if (@is_file($metaFile) && call_user_func(array($this->accessDriver, "isWriteable"), $metaFile) || call_user_func(array($this->accessDriver, "isWriteable"), dirname($metaFile)) || $scope == "repository") {
if (!isset(self::$fullMetaCache[$fileKey])) {
self::$fullMetaCache[$fileKey] = array();
}
if (!isset(self::$fullMetaCache[$fileKey][$userId])) {
self::$fullMetaCache[$fileKey][$userId] = array();
}
self::$fullMetaCache[$fileKey][$userId] = self::$metaCache;
$fp = fopen($metaFile, "w");
if ($fp !== false) {
@fwrite($fp, serialize(self::$fullMetaCache), strlen(serialize(self::$fullMetaCache)));
@fclose($fp);
}
if ($scope == AJXP_METADATA_SCOPE_GLOBAL) {
AJXP_Controller::applyHook("version.commit_file", array($metaFile, $ajxpNode));
}
}
}
示例13: nodeBookmarkMetadata
/**
* @param AJXP_Node $ajxpNode
* @return
*/
function nodeBookmarkMetadata(&$ajxpNode)
{
$user = AuthService::getLoggedUser();
if ($user == null) {
return;
}
if (!isset(self::$loadedBookmarks)) {
self::$loadedBookmarks = $user->getBookmarks();
}
foreach (self::$loadedBookmarks as $bm) {
if ($bm["PATH"] == $ajxpNode->getPath()) {
$ajxpNode->mergeMetadata(array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"), true);
/*
* TESTING MULTIPLE OVERLAYS
$ajxpNode->mergeMetadata(array(
"overlay_icon" => "shared.png"
), true);
*/
}
}
}
示例14: loadNodeInfo
/**
* @param AJXP_Node $ajxpNode
* @param bool $parentNode
* @param bool $details
* @return void
*/
public function loadNodeInfo(&$ajxpNode, $parentNode = false, $details = false)
{
$nodeName = basename($ajxpNode->getPath());
$metaData = $ajxpNode->metadata;
if (!isset($metaData["is_file"])) {
$isLeaf = is_file($ajxpNode->getUrl()) || AJXP_Utils::isBrowsableArchive($nodeName);
$metaData["is_file"] = $isLeaf ? "1" : "0";
} else {
$isLeaf = $metaData["is_file"] == "1" ? true : false;
}
$metaData["filename"] = $ajxpNode->getPath();
if (RecycleBinManager::recycleEnabled() && $ajxpNode->getPath() == RecycleBinManager::getRelativeRecycle()) {
$mess = ConfService::getMessages();
$recycleIcon = $this->countFiles($ajxpNode->getUrl(), false, true) > 0 ? "trashcan_full.png" : "trashcan.png";
$metaData["icon"] = $recycleIcon;
$metaData["mimestring"] = $mess[122];
$ajxpNode->setLabel($mess[122]);
$metaData["ajxp_mime"] = "ajxp_recycle";
} else {
$mimeData = AJXP_Utils::mimeData($ajxpNode->getUrl(), !$isLeaf);
$metaData["mimestring_id"] = $mimeData[0];
//AJXP_Utils::mimetype($ajxpNode->getUrl(), "type", !$isLeaf);
$metaData["icon"] = $mimeData[1];
//AJXP_Utils::mimetype($nodeName, "image", !$isLeaf);
if ($metaData["icon"] == "folder.png") {
$metaData["openicon"] = "folder_open.png";
}
if (!$isLeaf) {
$metaData["ajxp_mime"] = "ajxp_folder";
}
}
//if ($lsOptions["l"]) {
$metaData["file_group"] = @filegroup($ajxpNode->getUrl()) || "unknown";
$metaData["file_owner"] = @fileowner($ajxpNode->getUrl()) || "unknown";
$crtPath = $ajxpNode->getPath();
$vRoots = $this->repository->listVirtualRoots();
if (!empty($crtPath)) {
if (!@$this->isWriteable($ajxpNode->getUrl())) {
$metaData["ajxp_readonly"] = "true";
}
if (isset($vRoots[ltrim($crtPath, "/")])) {
$metaData["ajxp_readonly"] = $vRoots[ltrim($crtPath, "/")]["right"] == "r" ? "true" : "false";
}
} else {
if (count($vRoots)) {
$metaData["ajxp_readonly"] = "true";
}
}
$fPerms = @fileperms($ajxpNode->getUrl());
if ($fPerms !== false) {
$fPerms = substr(decoct($fPerms), $isLeaf ? 2 : 1);
} else {
$fPerms = '0000';
}
$metaData["file_perms"] = $fPerms;
$datemodif = $this->date_modif($ajxpNode->getUrl());
$metaData["ajxp_modiftime"] = $datemodif ? $datemodif : "0";
$metaData["bytesize"] = 0;
if ($isLeaf) {
$metaData["bytesize"] = $this->filesystemFileSize($ajxpNode->getUrl());
}
$metaData["filesize"] = AJXP_Utils::roundSize($metaData["bytesize"]);
if (AJXP_Utils::isBrowsableArchive($nodeName)) {
$metaData["ajxp_mime"] = "ajxp_browsable_archive";
}
if ($details == "minimal") {
$miniMeta = array("is_file" => $metaData["is_file"], "filename" => $metaData["filename"], "bytesize" => $metaData["bytesize"], "ajxp_modiftime" => $metaData["ajxp_modiftime"]);
$ajxpNode->mergeMetadata($miniMeta);
} else {
$ajxpNode->mergeMetadata($metaData);
}
}
示例15: getIndexedChildrenDocuments
/**
* Find all existing lucene documents based on the parent url
* @param Zend_Search_Lucene_Interface $index
* @param AJXP_Node $ajxpNode
* @return Zend_Search_Lucene_Search_QueryHit
*/
public function getIndexedChildrenDocuments($index, $ajxpNode)
{
// Try getting doc by url
$testQ = str_replace("/", "AJXPFAKESEP", SystemTextEncoding::toUTF8($ajxpNode->getPath()));
$pattern = new Zend_Search_Lucene_Index_Term($testQ . '*', 'node_path');
$query = new Zend_Search_Lucene_Search_Query_Wildcard($pattern);
$hits = $index->find($query);
return $hits;
}