Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #1 

I have a process in which the user creates a request and then adds attachments.  Some of the attachments are confidential.

I want to create a 'View Attachments' Form in which Role 'A' can see all the attachments, but Role 'B' can only see attachments which are not confidential.  I can't see how I can achieve this with a standard multi-clip as there doesn't appear to be any option to restrict the attachment list displayed.

Would the answer be to hold the eKey of the Attachment along with the Confidentiality status for the document in a Solution table and then create two Business Objects one of which display all documents and the other which displays only unrestricted documents.  Each BO would then be linked to a Grid on the same Form.  The Role of the User would then determine which Grid they could see. 

However, I'm not sure how to then code the method of viewing the documents from the Grid.

Any thoughts from someone who may have done something similar?
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #2 
We have a similar requirement, but our is easier ... we secure all local file attachments if you are not an "allowed" user.  To do this we only show the standard multi-clip if you are allowed, otherwise it is hidden and a memo field displays the list of file attachment names, but no way to open them.

However, this will not address your needs since you need to secure only some of the documents.  You are correct in that you cannot do this via the built-in clips (multi or single, though there's a bit more control over the single option).

Having though for only a moment, I believe your proposed is in the right direction.  You don't necessarily need to have two different BO's as long as you pass in a parameter to the BO of whether to display only "open" or all of the rows.  I also don't think you need to store the entire eKey value as it can be calculated, but there isn't much harm in doing do, though I'd personally recommend separating the segments of eKey into separate fields so you can index/join on the Folder ID more cleanly.

The challenge you may face in either case is keeping your solution table in sync with what is actually in eAttachment.  Depending on how you allow you handle how users attach document, this could be easy or a bit of a hassle.
0
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #3 
Thanks,

What I'm struggling on is how to replicate the functionality of the Add, Open, Delete buttons on the MultiClip. 

Does anyone know the coding behind these functions?

Regards,
TD
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #4 
Viewing attachments is easier to emulate - something like this below

var tmp = Bpm.UI.FormManager.get_current().get_applicationPath()
+'ReadAttachment.ashx?AttachmentFile='
+encodeURIComponent(attachmentName)
+'&AttachmentOwner='
+Bpm.UI.FormManager.get_current().get_folderId()
+'&AttachmentType=Folder';
window.open(tmp);

As for Adding/Deleting though, you might have a much harder time and deal with client side scripting + server + timing the two using temp variables and setTimeout.

Basically, the only way I've seen this done is using an external audit table to store "meta data" about your attachments, and using single clip attachments as a placeholder.

The idea is as follows:
a) Have a "meta data" table that has a foreign key to eKey on eAttachment
b) Put a grid BO that joins meta data table and eAttachment
c) Have a hidden "single clip attachment" on the form
d) Put client side buttons on top of the grid that for upload/delete/view. You can replace them with images using jquery and make it look like the grid control if you want
e) For upload, you'll have to make the client button click the single clip attachment - that will upload the file you need. Once the file is "available", you have to click a hidden server side button that will now audit that file into your meta data table. Once that is done, clear up the "single clip" data, so its available to upload the next file.
f) For view - on grid click, store the filename into a temp variable, and then call the client script above
g) For delete, you'll pretty much do the same as (f), but call a hidden server script button that will delete from your audit table and use Mstm.DeleteAttachment to delete from eAttachment.

Not fun, but once you get it working, the audit table will give full control on what to show, when, etc.

Metastorm isn't really designed to be a document management system :)



0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #5 
Quote:
Originally Posted by praxkan

Metastorm isn't really designed to be a document management system :)

That is definitely true.  And what's worse is that, for SQL Server anyway, even though Microsoft suggested to stop using the image data types and use varbinary(max) instead years ago ... well before V9 it turns out ... MBPM still uses that data type to store attachments.  (Of course, it doesn't help that Microsoft will allows that data type even though its well deprecated.)

At leave in V9 they are no longer  Unicode encoding the attachments, so they take up 1/2 the space they did in V7.  (Though converting from V7 to V9 has been painful at best.)
0
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #6 
Thanks for the suggestions,

I've created a solution table which holds key data to find the attachment in the eAttachment data and to build a URL to mimic the open attachment button used on a standard multi-clip.  I also store a file status ('restricted' or 'unrestricted').

I've then built a business object to access this solution table and display the data on a Grid, the URL can be displayed in a hyperlink in the first column with the File name and Status in the next two columns.  Clicking on the hyperlink then opens the attachment.

I'll develop some further coding to allow addition/deletion of attachments.  This shouldn't be too much of a problem

Of course, using attachments for restricted view is not ideal in Metastorm as anyone with any computer knowledge could replicate the URL to access the file given the File Name and Folder ID.  No offense to my users though, I don't think they are that savvy, so I think my solution will suffice! :-)
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!