-
Another try..
Here is a simplified query:
============
SELECT fcs.SetID AS ID, fcs.Name AS DocTray, fc.name AS FileCabinet, fcs.settings, r.name
FROM DWFCSettings fcs
INNER JOIN DWFileCabinet fc ON fcs.settings.value('(/WebBasketSettings/@AssignedFileCabinetGuid)[1]', 'varchar(50)') = fc.Guid
INNER JOIN DWFCSettingsToFCProfile fcsp ON fcs.setid = fcsp.setid
INNER JOIN DWFCProfile fcp ON fcsp.fpid = fcp.fpid
INNER JOIN DWFCProfileToRole fcpr ON fcsp.fpid = fcpr.fpid
INNER JOIN DWRoles r ON fcpr.rid = r.rid
WHERE UPPER(fcs.Type) LIKE '%WEBBASKETSETTINGS%'=============
It still needs to parse the "settings" field, so still may not work in LySQL. But I don't know a way around it, as the link from tray to cabinet is buried in that XML field (which seems pretty silly). And you need to know the cabinet in order to get permissions, though I may be reading the data model incorrectly (and there might be another way).
In any case, I give a big +1 to needing better Document Tray administration and better control of names and permissions visibility. These dependencies can get you in a real bind, real fast.
Thanks,
Joe Kaufman
-
Steve,
Steve,
I expressed a similar dismay about Document Tray admin and the fact that the same names can be used over on this thread:
I understand why same-names are allowed, but it all still seems very confusing to me from an admin standpoint.
I am guessing MySQL doesn't have the same XML parsing built in, so the query I posted isn't going to work. But if you can parse from the query the names of the fields with the various properties, you can do simpler queries to pluck out the XML and then read through all those doing a search for the correct tag. It is going to be more manual, but it should be doable. I will take a look at the query when I have a chance...
Thanks,
Joe Kaufman
-
Forgot
Josef,
I had forgotten about that -- Grupo never replied, so I am not sure it met his needs (but it should...) Hope iit helps, Steve!
Thanks,
Joe Kaufman
-
More thoughts
Cody,
The name of the fulltext field is the same one I listed in the URL integration: "DocuWareFulltext"
So, to call the RunQuery() method with more than one argument, I could do something like the following code that sets up variables and then makes the call:
Dialog dialog = <generate a Dialog object for the search dialog for the cabinet>;
List<DialogExpressionCondition> exprConditions = new List<DialogExpressionCondition>();
// *** NOTE *** Wild cards are allowed in expression conditions, emulating a SQL "LIKE".
exprConditions.Add(DialogExpressionCondition.Create("DocuWareFulltext", "the"));
exprConditions.Add(DialogExpressionCondition.Create("<OTHER_FIELD_NAME>", "<value to search for>"));
List<SortedField> sortFields = new List<SortedField>();
DocumentsQueryResult result = DWFuncs.RunQuery(dialog, exprConditions, sortFields, DialogExpressionOperation.And);That would do an AND query on the two conditions, that fulltext contains the word "the" and that <OTHER_FIELD_NAME> equals "<value to search for>".
Now, you have a bit of a tricky situation. What you want to search for looks like:
((Guid = val1) OR (Guid = val2) OR (Guid = val3)...) AND (DocuWareFulltext = "<search term>")
As far as I know, this cannot be done. You cannot parenthesize a search in that way and mix your ANDs and ORs. If there is a way, I have not seen it. Even in some parts of DocuWare that allow free queries, using parentheses with regard to the Boolean conditions does not seem doable.
But there is good news. Remember, the DocumentsQueryResult (which is simply a collection of Document objects) is not a bulging mass of all the documents pulled down over the wire. It is just the header information for the documents returned. For example, in the query above when I did a full-text search on the word "the", I got back 1800 Document objects in about six seconds. It isn't as fast as doing straight SQL Server queries on regular indexes, but it is still quick. And each Document object can be checked quickly via a loop:
for (int i = 0; i < result.Items.Count; i++)
{
Document doc = result.Items[0];
string val = doc.Fields[3].Item.ToString();
}Now, this means you have to know which field is which, ordinally (the object does not support named indexing). But if the Guid you are after is in, say, field 6 (zero-indexed), you could scan through all documents and find out which one has a field 6 that matches your list of Guids you are looking for.
In other words, lead with the fulltext search and then filter down from there. Because you can filter down further on the Guid -- you can't filter down further on full-text unless you find a way to pull down and decode the full-text on the query result. If you ever DID find a way to get the text back and do your own search, then you could do an OR query by guids at the start and then analyze those documents.
Like I said, though, DocuWare is pretty dang fast. So if you can lead with the full-text and let DocuWare run that query, that part of the filtering is done. If you don't have any full-text to search for, use an OR-based query with all the business guids joined together and just get all the documents back at once.
I do not know if any of this works in version 6.7 (we are on 6.11). But 6.7 (aka "platform Eagle") is still listed in the API help here:
http://help.docuware.com/sdk/platform-eagle/html/66b2ed1e-2aef-452a-97cd-5014bbf0242b.htm
so that is a good sign...
For completeness, here is my RunQuery() function that I have in namespace "DWFuncs":
==================================
public static DocumentsQueryResult RunQuery(Dialog dialog, List<DialogExpressionCondition> exprConditions, List<SortedField> sortFields = null, DialogExpressionOperation operation = DialogExpressionOperation.And)
{
// *** NOTE *** Wild cards are allowed in expression conditions, emulating a SQL "LIKE".
LastError = "";
if (dialog == null)
{
LastError = "Parameter 'dialog' cannot be null.";
return null;
}
if ((exprConditions == null) || (exprConditions.Count == 0))
{
LastError = "Parameter 'exprConditions' cannot be null or empty.";
return null;
}
DocumentsQueryResult queryResult = null;
try
{
DialogExpression queryExpr = new DialogExpression();
queryExpr.Count = int.MaxValue;
queryExpr.Operation = operation;
queryExpr.Condition = exprConditions;
if ((sortFields != null) && (sortFields.Count > 0))
{
queryExpr.SortOrder = sortFields;
}
else
{
// Sort field list is null or has no elements. So, use a default sort order for results.
queryExpr.SortOrder = new List<SortedField>();
queryExpr.SortOrder.Add(SortedField.Create("DWSTOREDATETIME"));
}
queryResult = dialog.Query.PostToDialogExpressionRelationForDocumentsQueryResult(queryExpr);
}
catch (Exception ex)
{
LastError = ex.Message;
queryResult = null;
}
return queryResult;
}==================================
Hope this helps,
Joe Kaufman
-
Temp file
Phil,
We probably aren't going to force users to navigate into a temporary folder every time they want to sign a document, so that is not a route we want to go down.
We posted this mainly just to see if other people are affected by this. For example, if you edit a document from DocuWare and digitally sign it in your PDF tool of choice, does the "Save As" pop up? In PDF-XChange it appears to happen every time and I do not see any settings to make it stop (I have posted on the PDF-XChange forums to check about all this).
Has no one ever run into this before? I imagine actual digital signing forces a save in many PDF tools so that it knows to lock fields down and disallow further editing. Otherwise someone could add a signature, make additional changes, and THEN save (doesn't really seem like a problem to me, but order of operations might affect such an "official" operation, especially if the signature contains a timestamp).
I cannot test Adobe Acrobat because I do not know how to officially digitally sign something, just the cursive pseudo signature Adobe generates for you. And going back to Adobe isn't an option anyway since we really like PDF-XChange and can't very well change our preferred PDF editor any time we run into a DocuWare editing anomaly.
So, any ideas on what other people are running into? Can you replocate this issue with your PDF editor of choice by chance?
Thanks,
Joe Kaufman
-
Cody,
Cody,
I believe URL Creator is part of the DocuWare Desktop tools. The same way you would install scanning or import jobs, that's how you install URL Creator.
But if you are wanting to do native SQL Server queries, that's a whole other can of worms, and I don't think URL Integration will get you where you want to be. .NET would definitely be ideal, and the "proof of concept" would be cleaner from a long-term standpoint.
I do not know how to decode the textshots stored in the database. People have asked about it here:
https://www.docuware.com/forum/english-forums/docuware-questions-about-u...
but you may want to start another thread specifically asking how to decode the textshot directly from the database (and it may not be possible -- that is always the risk you run when trying to query directly to the backend database).
As far as Question 2, to enable full text? You just check the checkbox when you create the file cabinet. In the web client configuration it is a checkbox that says, "Fulltext search" on the "General" tab when configuring a cabinet. Turn that on, and the field "Fulltext" becomes available in search dialogs, and that system field is available to query via URL Integration and the Platform SDK API. Note: the server will start chugging when you check that box, as it will start generating textshots for all the documents already in the cabinet, and all documents added from then on.
Thanks,
Joe Kaufman -
Cody,
Cody,
I am not sure I completely understand the GUID part of the question, but it sounds like you are basically saying you want to do a search that pulls down documents by one of the indexed fields as well as a keyword in the fulltext (OCR'd) portion of the document.
That can be done by simply doing a compund query -- you search both fields at the same time.
Here is an example of querying via the Platform SDK:
http://help.docuware.com/sdk/platform/html/b8b6ddf4-fee5-4b5c-84cc-046895c8aa5a.htm
Alternately, you could use URL integration and search on multiple fields in one query. Query expressions can involve multiple fields ANDed together. The name of the full text field in any cabinet where full-text is enabled is "DocuWareFulltext". I just used URL Creator to search a file cabinet where fulltext contained a certain item code and another field equaled the word "Customer" -- came back with the exact document I needed. My "free query" in the URL creator looked like:
[DocuWareFulltext] = "22112" AND [PROMO_TYPE] = "Customer"
Play around with the URL creator and do free queries involving that GUID field you mention and free-text at the same time. Should be doable. I do not know how to do a fulltext query on documents already pulled down. As I said, I have never had need of trying to pull the textshot along down with the document and manipulating it further. I would just do the full query all at once and get down exactly what I need. Let the DocuWare server do all the work and just get down relevant hits.
Thanks,
Joe Kaufman -
Cody,
Cody,
Then yeah, URL integration would work. Are you building the forms in .NET? Then I highly recommend learning the Platform SDK and utilizing the DocuWare NuGet packages -- it works quite well. You can do searches on the fulltext fields from there as well and get back Document objects to work with further. You are then in control of how to present and view the documents as opposed to utilizing URL integration which leverages the web client (result list and viewer).
Thanks,
Joe Kaufman
-
URL Integration
Cody,
Do you mean you would like to see the actual textshot behind the fulltext indexing of the document, that you want to search via fulltext keywords, or something else?
If you want to do a fulltext search via URL integration, you could do something like:
http://<servername>/DocuWare/Platform/WebClient/Client/Result?fc=<file cabinet GUID>&q=DocuWareFulltext=<keyword>&displayOneDoc=True&orgId=1&_auth=<authorization>
This is a very rough URL -- you would need to study up on using URL integration. I can no longer find a link to the document I found about it, but here is a thread where I discussed overcoming a login issue:
You can download the URL Creator and play around with that so see how to do various queries. The bottom line is that you need to encode the URL so that characters like the equals sigbn don't interfere, and the auth credentials also need to be encoded in a certain way (and you can go ever further with encrypting the URL if you wish). URL integration can then show a result list or display the document if a single one is returned.
You can also use the Plkatform SDK to do searches and get back Document objects that could then be manipulated further (e.g. downloaded). Using the SDK is a whole additional layer.
If you are wanting access to the actual textshot generated when the server OCRs documents, I do not know how to do that (haven't looked into it).
Thanks,
Joe Kaufman -
OCR
Cody,
I am not sure I follow you... If you turn on full-text indexing for a file cabinet then you can search for keywords from the web client and via URL Integration. Why are you needing to do your own customized full-text searching?
If you are interested in OCR from .NET, you can probably start with one of the companies DocuWare itself apparently uses, Nuance (at least according to the "About" page of listed licensing in play). Looks like Nuance makes something called OmniPage:
https://www.nuance.com/print-capture-and-pdf-solutions/training/developer-portal.html
Alternately, if you just do a web search on "OCR" you will find lots of different tools including some freeware ones like FreeOCR.
Is that the kind of thing you are looking for? DocuWare's fulltext indexing is pretty darn good, and it is relatively simple to run searchs against the fulltext field from the Platform SDK, I think.
Thanks,
Joe Kaufman