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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Defining Target Folder Check in

B.Champ
1-Visitor

Defining Target Folder Check in

Has anyone successfully change the default target folder check in of objects on a user basis? Currently, all of the users are checking in objects into a main root folder set up in Windchill because that is the default check in location. The only way to avoid checking in object into the root folder, that I know of, is to have the user change the target folder location when they create a new workspace. I would like to set up the system so that when a user checks in objects it goes into their personalize folder within the system. I don't want the user to have to set the target location every time they create a new workspace.

15 REPLIES 15
MikeLockwood
22-Sapphire I
(To:B.Champ)

By object type, you can specify what folder all new objects go into, using the SubFolders element of the OIR.

Store at root level (all are this way OTB):

<AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">
<Arg>/Default</Arg>
</AttrValue>

Store one level down (need to create this folder):

<AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">
<Arg>/Default/Other Folder</Arg>
</AttrValue>

If you create this at Site or Org level, then need to create the folder in every Product / Library where they need to be created.

Hi Mike...

I've read your response and I see what you're proposing... but how would you set the folder by user? I think this technique successfully sets the default checkin folder to a subfolder under the default but without the ability to vary that "Other Folder" by the current users' ID, I think the same problem still exists. Then again, perhaps I'm missing something?

Thanks!

-Brian

idk if this will work, but maybe you could extend FolderPathAttributeAlgorithm and override the calculate method?

if(args != null && args.length == 1 && args[0].equals("(somethingunique)")) {

return FolderHelper.service.getFolder(xxxxxxx, wtcontainerref);

} else {

return super.calculate(args,wtcontainerref);

}

Right - it will store all in the same folder regardless of user. No need to store by folder for each user. Assume that all data is created randomly by any user, then worked over time by any other user.

At any time, reports can be run (or the details page can be inspected) to determine who has created / modified any data item. The data that defines the product should be managed by product end item, not by who has created / modified it.

If you're looking at using a folder per user in order to somehow control permissions, then look again at the use of states (the lifecycle applied to the data); control by group who can do what at each state.

Understood... the original post seems to suggest there's just one big folder everyone is dumping files into. Obviously there should be some "Product" directories to split up the work by project (context). Perhaps there's already a set of Products but there are subfolders for each user inside those products. I was merely point out that if the question was "How do I automatically set each user's default to be their own personal subfolder" then we haven't answered the question.

Not that there aren't alternatives to having separate folders by user name... just that if he did require it, we haven't figured out a way to do it (yet).

The xxxx was for you to figure out. I'm pretty sure the algorithm runs as the current user. I still don't know if it will work though.




Folder folder;



if(args != null && args.length == 1 && args[0].equals("${PERSONAL}")) {




WTPrincipal principal = SessionHelper.manager.getPrincipal();




StringBuilder path = new StringBuilder();




path.append("/Default/PersonalFolders/").append(principal.getName());




try {





folder = FolderHelper.service.getFolder(path.toString(), wtcontainerref);




} catch (FolderNotFoundException e) {





FolderHelper.service.createSubFolder(path.toString(), wtcontainerref);





folder = FolderHelper.service.getFolder(path.toString(), wtcontainerref);




}



} else {




folder = super.calculate(args,wtcontainerref);



}

return folder;

B.Champ
1-Visitor
(To:B.Champ)

Sorry for the confusion but by personalized folder I meant project folder. Brian, you are on the right track. Currently our system is set up so that there is only one Product and under product there are project (context) folders setup. I know you can change the checkin location for the group as a whole but I want to vary the checkin for each user. I would like us to be able to manage our data better by project not by the user who created/modified it.

Hi Bon

In our organisation(and in common practice)

We make individual product for each project

Define team and role for each product to give access to persons

Can you give a screenshot of your folder structure

Regards

K.Mahanta

I think he's just got one monolithic structure with subfolders taking the traditional place of products. Hmm... a screenshot might help!

B.Champ
1-Visitor
(To:B.Champ)

Here is a screen shot.

untitled1.JPG

Hi Bon...

Is it true that Nuvasive is your only product?

Thanks...

-Brian

That is correct.

Hi Bon...

Most organizations have their structure set up a bit different. Usually there are multiple Products and each show up as a potential Context when users create a new workspace. The default folder is set via this Context. As well, when you select Windchill Cabinets from the folder navigator, you're taken to the top level folder of the Product context as a convenience (rather than to the top level of the entire server/Commonspace). If users want to set a specific sub-folder as their default, they can go to their workspace and Edit Preferences to set this.

In your case, the context is always the same- Nuvasive. Therefore, to set anything other than the top level fodler as default, your users are forced to Edit Preferences in the workspace. I've tried snippets of code to shortcut this process but I haven't been able to do it yet. Matthew Knight apparently believes there's a way to do it by overriding the default calculate method. If you're not a Windchill customization guy, this probably doesn't make sense though.

Do you have the ability or knowledge to implement Matthew's suggestion? I tried the low-tech way of snagging bits of the code using View Source from the preferences page. I couldn't find any easy and automatic way to achieve the effect you're after, though.

Unfortunately I think I'm in over my head... I think this might be a job for the customization gurus.

😕 Sorry...

-Brian

Brian,

Our users are currently doing exactly what you have described. We go into the Edit Preference in the workspace and define the path through there. I just thought I would give it a shot to see if there was an easier way of defining the path without having to do it for every new workspace. I think this may be a job for a customization guru as you have suggested for I am not savy in coding to approach the issue suggested by Matthew. Thanks for all of your guy's effort to help address the issue.

Maybe we'll both get lucky and Matthew or one of the guys who DO have such knowledge can either share it... or point us in the right direction so we can teach ourselves. I don't even know where to start!

Announcements


Top Tags