Skip to Content

How can I change the Icons for Documents based on the Validity Date?

Oct 26, 2017 at 05:21 PM


avatar image
Former Member

I have read in the configuration guide that the variable $(Valid) can be used with Released status DIRs to control the icon definition. Can you provide an example of how to write a validity statement in the dtype.xml for released docs (released icon group) to display different icons?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Dec 07, 2017 at 12:00 PM

As one might expect. When someone is forced to answer their own questions, they may find themselves working harder than they have to. I supposed I should have gleamed this solution from my work with other areas of ECTR configurations. In any case, while my answer above works, if was much more effort than was needed.

The step or requirement that I missed above was the customer_icons.txt definition. In the icon definition, each flag and variable is identified.

<icondef icon_position="2" icon_group="default" use_status_color="no"

In the configuration guide, it is indicated that the icons are stored in the images.jar file in the %plm_instdir%\basis\classes folder. While that it true, the guide fails to mention that the statement needs to be written into the dtype.xml AND in the customer_icons.txt. The customer_icons.txt translates the statement from the dtype.xml into specific icon references. The code here is from the standard_icons.txt and is how the above code is translated to specific icon sets. Here you can combine multiple icons and overlays as well.

flag/flag_version_000	=	{0}/sap/traffic_light_green
flag/flag_version_010	=	{0}/sap/traffic_light_orange
flag/flag_version_011	=	{0}/sap/traffic_light_red
flag/flag_version_100	=	{0}/sap/traffic_light_green<<{0}/sap/external_references
flag/flag_version_110	=	{0}/sap/traffic_light_orange<<{0}/sap/external_references
flag/flag_version_111	=	{0}/sap/traffic_light_red<<{0}/sap/external_references

Now armed with this knowledge I rebuilt my solution using standard icons from the images.jar. The solution was easier and did not require custom icons in the custom images.jar

The dtype.xml

<icondef icon_position="3" icon_group="released" use_status_color="no"

The customer_icons.txt

flag/doc_is_released_v	=	{0}/sap/done
flag/doc_is_released_p	=	{0}/sap/status_cancelled
flag/doc_is_released_f	=	{0}/sap/status_waiting
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 13, 2017 at 06:41 PM

After some further investigation, I have found that the $(valid) variable can be used to acquire different icons that can be displayed based on a documents validity. It seems that there are not any standard icons available or examples in the guide. So I attempted to build the solution.

I copied and renamed 3 standard icons from the standard images.jar file.

1 for each potential result for the variable $(valid). P.png for Past, V.png for Valid and F.png for future. These icons were then stored within a folder named "flag" within %plm_instdir%\customize\config\patches\images.jar (a compressed file).

I then added the following tag to the DType file for the "Released" Icon_Group.

<icondef icon_position="3" icon_group="released" use_status_color="no"

The Icon in position 3 displays as desired for each of the Valid from periods for the Released DIRs.

10 |10000 characters needed characters left characters exceeded