Our team is currently wondering if there's a way to add a new field type to iTop. A way to have a new option, like how we have AttributeString, AttributeExternalKey, we'd like to create our own. Is there any way to do this through an extension?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In theory it is possible since version 3.1, but there isn't any documentation about this option.
We are not sure that it will cover all cases (REST, DataSynchro, test in OQL, Portal,...)
Hey Vincent, I used your AttributeEncryptedPassword repo as a guidance and tried to create a new attribute type extending from AttributeExternalKey but when I tried to apply the new attribute type to a field I am stuck with "ERROR missing parameter 'target_class' in AttributeX declaration for class AttributeExternalKey" despite adding those parameters in bose the attribute and datamodel xml file.
It seems itop isn't recognizing a few parameters like "filter" and "target_class" in my new attribute and I am wondering if you have any tips regarding this issue or this is limited because we are on iTop version 3.0.3 instead of a newer version?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We want to have a field that works exactly like AttributeExternalKey where you can select the keys from dropdown but we want to prevent showing hover ids and disable the hyperlink that points to the selected object from the original class.
We don't want to modify core methods responsible for generating the hyperlink so we want to see if it's possible to extend a new attribute type from ExternalKey.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hm, since you do want the functionality of an external key...
Have you considered a different approach; injecting some JavaScript to delete the link and replace it with plain text? (It might very briefly show, then gets replaced immediately)
If you target the element with the proper element selector, you could do this for specific fields only.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree with Jeffrey, you could display your ExternalKey while editing and hide it when displaying the object details with some hacks, and then use an ExternalField based on this ExternalKey to only display a name in the details
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey there,
Our team is currently wondering if there's a way to add a new field type to iTop. A way to have a new option, like how we have AttributeString, AttributeExternalKey, we'd like to create our own. Is there any way to do this through an extension?
In theory it is possible since version 3.1, but there isn't any documentation about this option.
We are not sure that it will cover all cases (REST, DataSynchro, test in OQL, Portal,...)
Here are the new attribute types that we have created this way :
1. one for defining a 1:1 relationship is still a prototype somewhere and was never released, so hardly tested
2. the second is public here : https://github.com/Combodo/itop-attribute-encrypted-password
3. And there was also a repo for showing an example: https://github.com/Combodo/sample-new-attribute-type
Don't hesitate to share the results of your investigation
Hey Vincent, I used your AttributeEncryptedPassword repo as a guidance and tried to create a new attribute type extending from AttributeExternalKey but when I tried to apply the new attribute type to a field I am stuck with "ERROR missing parameter 'target_class' in AttributeX declaration for class AttributeExternalKey" despite adding those parameters in bose the attribute and datamodel xml file.
It seems itop isn't recognizing a few parameters like "filter" and "target_class" in my new attribute and I am wondering if you have any tips regarding this issue or this is limited because we are on iTop version 3.0.3 instead of a newer version?
For sure 3.0.3 is not enough to be able to create new type of Attribute, taht was not supported at that time
It depends what kind of functionality you're looking after.
For instance, even for iTop 2.7, I created a new field type "AttributeGeometry" and "AttributeCRS".
What kind of attribute would you like to make?
Hey, we are on iTop 3.0 and we are mostly trying to create a AttributeExternalKey but without the hyperlink and key tooltip in extensions.
What's the main goal if there is no link? You just want to show an ID, or the class and the ID?
( if so, you could just use an AttributeInteger type or something ).
We want to have a field that works exactly like AttributeExternalKey where you can select the keys from dropdown but we want to prevent showing hover ids and disable the hyperlink that points to the selected object from the original class.
We don't want to modify core methods responsible for generating the hyperlink so we want to see if it's possible to extend a new attribute type from ExternalKey.
Hm, since you do want the functionality of an external key...
Have you considered a different approach; injecting some JavaScript to delete the link and replace it with plain text? (It might very briefly show, then gets replaced immediately)
If you target the element with the proper element selector, you could do this for specific fields only.
I agree with Jeffrey, you could display your ExternalKey while editing and hide it when displaying the object details with some hacks, and then use an ExternalField based on this ExternalKey to only display a name in the details
Thank you for the recommendation, I will we will stick with JS scripts to strip the link for now until we update to the latest version.