根据他们的网站,他们有DocuWare Platform .NET API但我看不到任何关于连接到DocuWare并从DocuWare检索文档的教程。
我们有一个用PHP编写的现有客户端门户,我们最近购买并开始使用DocuWare进行文档管理。我们为客户端门户添加了功能,以连接到DocuWare SQL Server数据库以执行查询,并向客户显示DocuWare中可用的文档。
我们坚持的观点是如何检索实际文档并使用PHP在我们的客户端门户中显示它?
答案 0 :(得分:1)
我不是PHP专家,但您需要做的就是发送并获取http请求到docuware服务器并跟踪cookie。如果您的浏览器中有所谓的平台API,您可以查看文档: http://your.docuware.server/DocuWare/Platform
答案 1 :(得分:0)
您可以提供一个链接并在iframe中打开它(但这似乎被docuware禁止):
echo '<a href="http://myServer/DocuWare/Platform/WebClient/Client/Document?fc=630a90e4-d6a8-4c9d-b8e0-045008e380ba&did=850351"
target="docuware">Link to Document</a>';
echo '<iframe id="docuware" name="docuware" style="height:400px; width:400px;"></iframe>';
所以你可以在新的窗口/标签中打开它:
echo '<a href="http://myServer/DocuWare/Platform/WebClient/Client/Document?fc=630a90e4-d6a8-4c9d-b8e0-045008e380ba&did=850351"
target="_blank">Link to Document</a>';
或者您可以下载孔文档以将其存储在服务器上的临时文件夹中。然后你必须管理身份验证(见here):
private function _downloadDocuware($dwdocid, $destination, $withAnnotations = null) {
$source = DOCUWARE_HOST . "DocuWare/Platform/FileCabinets/630a90e4-d6a8-4c9d-b8e0-045008e380ba/Documents/" . $dwdocid . "/FileDownload?";
// check Annotations
if ($withAnnotations == true){
$source .= "targetFileType=PDF&keepAnnotations=true&downloadFile=true&autoPrint=false&layers=1%2C2%2C3%2C4%2C5";
}
else{
$source .= "keepAnnotations=false&downloadFile=true&autoPrint=false";
}
require_once 'docuware/DwPlatformAuthentication.php';
DwPlatformAuthentication::GetAuthentication ();
$dwplatformauth = DwPlatformAuthentication::GetDwPlatformAuth ();
$dwplatformbrowserid = DwPlatformAuthentication::GetDwPlatformBrowserId ();
$options = array (
"http" => array (
"header" => "Content-Type: */*\r\n" .
"Cookie: DWOrganization=MyCompany; " .
"openInNewWindow=False; " .
"DWPLATFORMBROWSERID=" . $dwplatformbrowserid . "; " .
".DWPLATFORMAUTH=" . $dwplatformauth . "\r\n",
"method" => "GET"
)
);
$context = stream_context_create ( $options );
try {
file_put_contents ( utf8_decode ( $destination ), file_get_contents ( $source, false, $context ) );
return true;
}
catch ( Exception $e ) {
return false;
}
}
希望这有帮助。