cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Restrict the Types of Files Uploaded for Specific wt.document Types

Restrict the Types of Files Uploaded for Specific wt.document Types

As a Windchill Administrator, I would like to be able to limit the types (one or more) of files uploaded with a wt.document. I would also like to be able to limit the types of files uploaded to a specific wt.document type.

As an example, if I have a wt.document type called Contract, I would like to ensure the primary content is always a Microsoft Word Document to prevent people from uploading the wrong primary content to a specific document type.

This capability should work in the browser interface and the Microsoft Office and Windows Explorer interface provided with Windchill Desktop Integration.

This Idea originally reported under https://support.ptc.com/appserver/cs/view/solution.jsp?&n=CS229999

7 Comments
sm
1-Newbie
1-Newbie

This request comes up periodically, but was never submitted as a Windchill Product Idea. Please vote accordingly.

MikeLockwood
22-Sapphire I

This seems like a great suggestion for a very helpful functionality.  To date, I have only been able to address this by:

A) Create a bunch of Libraries, each intended for only one WTDocument object sub type.  In that Library, create a bunch of OIR's which call out a lifecycle that does not exist, which removes all those sub types from the list that users can select.  Note: The primary reason for doing this is to handle workflow(s) related to the sub type differently and the only easy way to do this w/o users having to select is to have a dedicated context.

B) Create template(s) in each Library with the current standard content file and encourage use of Create from Template.

So - My comment here really is to please address the request above as well as restrict what types can be created in each context.

BrianToussaint
19-Tanzanite

Mike,

I too have many different documents and workflows for those documents.  We also create Libraries and encourage the use of templates.

For A) have you tried to set the ACL to only allow the Library Manager to have access to the other document types?  I don't know if this is easier, but it is the way that I do it.  I know that it starts to become more cumbersome as I add WTDocument subtypes.  You always have to go back to each library and make sure you add the ACL.  See screen shot. (The screen shot is a little fuzzy, but that is "!Full Control (All)"

2-23-2016 9-33-26 AM.png

MikeLockwood
22-Sapphire I

Agree that ACL's work perfectly in terms of preventing.  I settled on OIR's because they remove the type from the drop down list of types that the user can select.  ACL's (at least at Windchill 😎 allowed the user to select the other types but presented a message after selecting Finish in the Create wizard.

BrianToussaint
19-Tanzanite

I've only been on Windchill 10 and above.  Don't remember when I started using documents and routing, think it was 10.1, but the ACL now removes it from the drop down for the user.  I am on 10.2 m030.  So some progress.

d_graham
17-Peridot

You can fairly easily restrict file type upload using  listener.

The event type you listen for is wt.fc.PersistenceManagerEvent/PRE_STORE

The listener can be written to be quite granular.

For example, it would not be difficult to restrict upload of png files as attachments to a sub-type of WTDocument.

You could further refine the restriction by specific only if the WTDocument is in a specific Library or Product.

If a user tried to upload such a file when they hit the OK button a window would open with whatever message you want telling them that PNG files are not allowed as attachments.

olivierlp
Community Manager
Status changed to: Archived

Hello,

We are archiving your idea as part of a general review. This action is based on the age of your idea and the total number of votes received, as per this announcement.

You can always post a new idea with all the details required in the form.

Thank you for your participation.