cancel
Showing results for 
Search instead for 
Did you mean: 

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

nadiener
Explorer
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

nadiener
Explorer
0 Kudos

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"
    icon_identifier="flag/flag_version_$(HER)$(HNV)$(HRV)"/>

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"
     icon_identifier="flag/doc_is_released_$(VALID)"/>	

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

Answers (2)

Answers (2)

0 Kudos

Hello Neal,

The explanation provided by you has clarified a lot of my questions related to changing icons. I just did change the icon (position 1) for a different Doc Type. Done all the required settings in Dtype.xml too.

In ECTR, the icon is now showing up just as a white box and missing the actual icon.

I am under the assumption that I have not placed the new icon at the correct path in Images.jar file. Can you suggest where do I need to place that in order to be picked up by ECTR?

Thanks,

Prashanth

nadiener
Explorer
0 Kudos

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"
                                        icon_identifier="flag/$(VALID)"/>

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