07-22-2008 06:39 AM
public function fetchFromURL($url)
{
$version = $this->urlToVersion($url);
return preg_replace("#\n<html>\n<head>\n<title></title><meta http-equiv=\"refresh\" content=\"0; URL=http://XXXYOURSERVERADDRESSXXX/index.php/.*\">\n</head>\n<body>\n#", "", preg_replace("#\n</body>\n</html>#", "", $version->cm_content->content, 1), 1);
} public function &store($store, $data)
{
$url = $_SESSION["lastVersionUrl"];
$node = null;
$isNormalText = (strpos($url, 'alfresco://') === false);
if ($url != null && $isNormalText == false)
{
$node = $this->urlToNode($url);
}
else
{
$node = $this->wikiSpace->createChild("cm_content", "cm_contains", "cm_".$_SESSION["title"]);
$node->cm_name = $_SESSION["title"];
$node->addAspect("cm_versionable");
$node->cm_initialVersion = false;
$node->cm_autoVersion = false;
}
// Set the content and save
$node->setContent("cm_content", "text/html", "UTF-8", "\n<html>\n<head>\n<title></title><meta http-equiv=\"refresh\" content=\"0; URL=http://XXXYOURSERVERADDRESSXXX/index.php/" . preg_replace("#Image - #", "Image:", $_SESSION["title"]) . "\">\n</head>\n<body>\n" . $data . "\n</body>\n</html>");
$this->session->save();
$description = $_SESSION["description"];
if ($description == null)
{
$description = "";
}
// Create the version
$version = $node->createVersion($description);
$result = "alfresco://".$node->store->scheme."/".$node->store->address."/".$node->id."/".$version->store->scheme."/".$version->store->address."/".$version->id;
return $result;
}01-02-2009 06:52 PM
01-02-2009 06:54 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.