![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
Topic Title: Adding Attributes to File Type Objects Topic Summary: How Can I add Attributes to File Type Objects Created On: 1-Feb-2007 23:14 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hello, |
|
![]() |
|
![]() |
|
Hi !
You have to edit attribute "source_attrs" and create an attribute "<attribute>_init" to initialise the attribute "<attribute>". Here is the complete way to do : ################ It's fairly easy add an attribute to objects of a certain type. If the attribute source_attrs exists on the type's cvtype, the attributes listed in source_attrs as well as other built-in attributes are created on new objects of that type. - The format for the source_attrs attribute is a line for each attribute where each line is as follows: - attribute_name[:[attribute_type][options]] - It probably makes most sense just to go through an example here. - I want to create a string attribute called "vendorversion" on every newly created object of type "library" and then display this attribute in the Properties dialog. - 1) Query for the cvtype. - % ccm query -n library -t cvtype - 2) Check if the source_attrs exists locally or is inherited. - % ccm attr -la @ .......... source_attrs (text) (inherited) ......... - 3) If it's inherited, create it locally with the same contents and add a line for the new attribute. You must be in the role ccm_admin to do this. - % ccm attr -s source_attrs @ source: - % ccm attr -c source_attrs -t text @ - % ccm attr -m source_attrs @ - This will open an editor. You should then enter the line which was previously there along with a line for the new attribute. - source: vendorversion:string ![]() - 4) Create an attribute containing the initial value for this attribute. % ccm attr -c vendorversion_init -t string -v no_version @ - I have decided just to initialise it with the string "no_version". - 5) Check if the info_attrs attribute exists on the type. - % ccm attr -s info_attrs @ - 6) If it does not exist, it must be created. - You must be in role of ccm_admin to modify the type - % ccm attr -c info_attrs -t text @ - Then edit it. - % ccm attr -modify info_attrs @ - This will bring up an edit session. Make an entry as follows: - <attribute_name>:<attribute_type>:<Label in Properties Dialog> - So that will be: - vendorversion:string:Vendor Version - That's all there is to it. When you create a new object of type "library", you should see "Vendor Version" in the Properties dialog and the value "no_version" in the field. You will be able to modify this in the GUI or from the command line using "ccm attr -m vendorversion -v <new_string>" if the object is writable by you. ##################### |
|
![]() |
|
![]() |
|
Hello:
I would like to extend this discussion by adding a more complex situation.
I'm working on a configuration control labelling trigger or something like that.
The idea is to apply what you say below in a kind of configuration tree like this
one:
Project
|
|-- Subsystem
|
|-- CSCI (Computer Software Configuration Item)
|
|-- CSC (Computer Software Component, could have many levels)
|
|-- Directory
|
|-- Code type object
|-- Library or other product type object.
Then any kind of object type INSTANCE should have an unique ID attribute.
And:
- For each object type instance the unique ID is saved in it's attribute.
- For each new object instance created of code type there is no need of creating
an ID, the name is enough, but there is the need of make an entry in the code file as a header (perhaps code templates?) with this information:
Project_ID-Subsystem_ID-CSCI_ID-CSC_ID-Path-Code_object_file_name-Version
This should be done when creating the instance of the object (a trigger?), but should be modified each time the object changes of version or any parent object has a change in it's ID attribute.
This label should be entered in the code as a header.
Code templates? Do they manage automatic changes (they don't as far as I know)?
Do you have any hint or previous experience?
We are thinking on using triggers, but triggers are allways a *dangerous* tool if the development is not very clear or all the situations are very controlled and pre-defined.
Does anyone label the code inside SYNERGY/CM by using this kind of technics with ad-hoc attributes or the common way is tu use the own SYNERGY/CM labels?
Many thanks in advance for any hint you could give us.
Best regards.
Edited: 14-Mar-2007 at 16:14 by Aitor Illarramendi |
|
![]() |
|
![]() |
|
quote: The only time you need to edit source_attrs is if the new custom attribute needs to have some special non-default behaviour. You can create an attribute on an object using the ccm attr -c command without any change to source_attrs on the cvtype. By default, such custom attributes will be copied on check out to the new version and will not exist if you create a new instance of an object of that type. If you want to suppress this default behaviour then and only then do you need to touch source_attrs. Suppressing copy-on-derive, or initializing an attribute to some fixed default values are usually the only reasons for doing so. If the issue is making custom attributes visible in the Java client GUI, then you can create/edit info_attrs on the associated cvtype. See the FAQ (ref FAQSCM0166) on the Telelogic support site: https://support.telelogic.com/en/synergy/kb/show_content.cfm?id=712#712 - this is still supported but has been extended since the FAQ was written. It is possible to define choices for use with a Combobox. You can also defined required attributes for tasks, and these attributes will also be displayed on the Task Create dialog. See https://support.telelogic.com/en/synergy/kb/show_content.cfm?id=532#532 for details. Regards, David. |
|
![]() |
|
![]() |
|
quote: The issue is that Synergy is not restricted to a simple hierarchical view. A file version, for example, can be a member of zero, one or many projects. Those projects might represent different components or subsystems. So a product-management-top-down-hierarchy type of view doesn't really map well. You could never say, for example, for some file that it is only used in one context as seen within some strict 1-N decomposition tree. Within a non-DCM-initialized database, the only thing that is a unique "id" is the 4-part objectname. In a DCM environment, the cluster_id is a kind of GUID, but the value should really be treated as just a pseudo-random string. One use for such a GUID might be to provide a unique reference as a kind of link from some external tool to the object in a Synergy database. David. |
|
![]() |
|
![]() |
|
Many thankd David.
I'll read your responses carefully and then show results.
Best regards.
|
|
![]() |
|
![]() |
|
David Dubreu,
do you know if this attribute initialization can be applied to task objects as well? I have tried out various solutions to automatically insert more than one line of text into the task_description attribute automatically on task creation, but none of the workarounds I have found so far doesn't work perfectly. I couldn't make your example work on tasks, but it does work for file objects. |
|
![]() |
|
![]() |
|
Hi Toni,
I have never tried with tasks. This way is for objects. For task cvtype, the source_attrs attribute is local and not inherited. Maybe here is the problem. David D. |
|
![]() |
|
![]() |
|
quote: Hi,David: Follow the above complete steps,I can't initialize the default value "no_version"for attribute "vendorversion_init",In Step 3, I used the two lines after I invoked % ccm attr -m source_attrs @ source: vendorversion:string:init Is something wrong or other steps should be revised? Many thanks! ------------------------- BRs Howard Ling ShenZhen,China ICQ:283072597 MSN:linghuan713@hotmail.com |
|
![]() |
|
![]() |
|
Could David give me some hints to me ?
Thanks! ------------------------- BRs Howard Ling ShenZhen,China ICQ:283072597 MSN:linghuan713@hotmail.com |
|
![]() |
|
![]() |
|
Hi,
There was a smiley because of the ':' and 'd'. it's do_init and not only init. In vendorversion:string:init, replace init by do_init. David. |
|
![]() |
Telelogic SYNERGY
» SYNERGY/CM
»
Adding Attributes to File Type Objects
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.