I cannot find any examples using basic FOLDER manipulation from SOA JAVA/NET. HelloTeamcenter contains sample code for Items and Revisions. But I am trying hard to create a reference from a folder to an existing Item Revision without any luck. Folders seem to use a different approach to Items regarding content, instead of using 'references' they seem to be using the 'contents' property.
Could someone guide me in the right direction? all I want is to 'copy' and 'paste' an item revision from a source folder to a destination one. I have not found any example for that simple operation so far.
Solved! Go to Solution.
I wish that was the case, but it is not working at all (at least for me):
Does not create the relationship and throws:
Error Msg.: Invalid relation type
Error Val.: Invalid relation type
If the type is set to "IMAN_reference", the relation is created, but not shown as content of the folder.
I also tried through CAD API, same result: Invalid relation type.
Any idea about what could I be doing wrong?
It should be that easy, but it is not. I have to faithfully stick to the loose API. Teamcenter is not refusing the structure, it is rejecting the "contents" relation.
Adjusting the code (it was not putting an array in secondary data, but it seemed that way, maybe it is not a good idea to post code afterall).
Same results... the structure is accepted but the "contents" relation is rejected.
Does not make any sense to me. Providing the UID of an Item does not change the situation, the "Invalid relation type" is still thrown. Your code most probably work fine with revisions when it does work with items. I am unable to make it paste the content when using the loose API.
Somehow the "contents" relation is not accepted and I have no idea of how to make it work. A simple code with an unexpected behaviour.
I have found it :)
The 'contents' of a folder is a Property whose name is 'contents' and its value is the UID of the contained element (Item, Revision, a Unicorn or a Candy) and voilá, there you have it in RAC shown as being part of the folder.
Thank you Amol.
did you try to create an new item- from orhet revision with save as button? ( and whilce creation if you try to creta under your newstuff or your special folder alltime you can see under your folder)