Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 1-Feb-2007 23:14
User is offline View Users Profile Print this message


Johnny Morgan

Posts: 1
Joined: 20-Jan-2007

Hello,
I am creating an integration between Synergy/CM and another tool. I want to create a custom property to store some info about an object in the other tool. Can anyone tell me how to create custom properties?

Report this to a Moderator Report this to a Moderator
 6-Feb-2007 17:02
User is offline View Users Profile Print this message


David Dubreu

Posts: 43
Joined: 21-Aug-2003

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:stringo_init
-
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.
#####################
Report this to a Moderator Report this to a Moderator
 14-Mar-2007 16:13
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

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
Report this to a Moderator Report this to a Moderator
 14-Mar-2007 18:01
User is offline View Users Profile Print this message


David Honey

Posts: 20
Joined: 26-Sep-2002

quote:

Originally posted by: David Dubreu
Hi !

You have to edit attribute "source_attrs" and create an attribute "_init" to initialise the attribute "". Here is the complete way to do :


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.
Report this to a Moderator Report this to a Moderator
 14-Mar-2007 18:09
User is offline View Users Profile Print this message


David Honey

Posts: 20
Joined: 26-Sep-2002

quote:

Originally posted by: Aitor Illarramendi
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.


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.



Report this to a Moderator Report this to a Moderator
 14-Mar-2007 19:24
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

Many thankd David. I'll read your responses carefully and then show results. Best regards.
Report this to a Moderator Report this to a Moderator
 15-Mar-2007 10:20
User is offline View Users Profile Print this message


Toni Arte

Posts: 30
Joined: 16-Aug-2004

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.
Report this to a Moderator Report this to a Moderator
 26-Mar-2007 13:13
User is offline View Users Profile Print this message


David Dubreu

Posts: 43
Joined: 21-Aug-2003

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.
Report this to a Moderator Report this to a Moderator
 13-May-2007 17:10
User is offline View Users Profile Print this message


howard ling

Posts: 20
Joined: 6-Apr-2007

quote:

Originally posted by: David Dubreu
Hi ! You have to edit attribute "source_attrs" and create an attribute "_init" to initialise the 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:stringo_init - 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: - ::


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
Report this to a Moderator Report this to a Moderator
 26-May-2007 19:34
User is offline View Users Profile Print this message


howard ling

Posts: 20
Joined: 6-Apr-2007

Could David give me some hints to me ?

Thanks!

-------------------------
BRs
Howard Ling
ShenZhen,China
ICQ:283072597
MSN:linghuan713@hotmail.com
Report this to a Moderator Report this to a Moderator
 11-Jun-2007 14:02
User is offline View Users Profile Print this message


David Dubreu

Posts: 43
Joined: 21-Aug-2003

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.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 0 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.