archi-contribs / specialization-plugin

Plugin for Archi to specialize concepts (figure, icon...)
Other
29 stars 2 forks source link

Plugin working but icons not changing #6

Closed mike548141 closed 6 years ago

mike548141 commented 6 years ago

Hi,

I've followed the instructions, the plugin is installed and showing in Archi preferences. The icon property is set on the Node object and the value is set to the file name. But the icon does not change to the image file... help?

Archi 4.0.3 build 201709061211 Archi installation details.txt OS: Mac OSX 10.13.1 (high sierra) Specialization-plugin: 0.2 (file /Applications/Archi.app/plugins/org.archicontribs.specialization_v0.2.jar)

screen shot 2017-12-07 at 19 52 24 screen shot 2017-12-07 at 19 41 11 screen shot 2017-12-07 at 19 40 18 screen shot 2017-12-07 at 19 47 24

The image file "/Applications/Archi.app/plugins/com.archimatetool.editor_4.0.3.201709061211/img/microsoft/dag.png"

dag
herve91 commented 6 years ago

You need to create a log on the logger tab file to understand what happens.

mike548141 commented 6 years ago

@herve91 I've found no errors in the log using trace, debug or info log levels, but I'm happy to post a log file. Could you describe the log level you want and the steps you want me to take e.g. create object, set property value etc.. Thanks

herve91 commented 6 years ago

I need the trace level. Basically, the log file should contain lines like "found icon" or "missing icon".

The procedure you may follow if to right click somewhere in your view and select the "refresh view" option. This will force all the icons to be refreshed and therefore, a line should be printed in the log file for each element that has got an "icon" property.

mike548141 commented 6 years ago

Hi trace below, but no references to icons sorry

2017-12-08 08:19:50 DEBUG 428:PreferencePage - Logger initialised. 2017-12-08 08:19:50 TRACE 428:PreferencePage ┌ log4j.rootLogger = TRACE, stdout, filelog4j.appender.stdout = org.apache.log4j.ConsoleAppender 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.stdout.Target = System.out 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.stdout.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-30.30C{1} %m%n 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.file = org.apache.log4j.FileAppender 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.file.ImmediateFlush = true 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.file.Append = false 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.file.Encoding = UTF-8 2017-12-08 08:19:50 TRACE 428:PreferencePage │ log4j.appender.file.File = /Users/User/SpecializationPlugin.log 2017-12-08 08:19:50 TRACE 428:PreferencePage └ log4j.appender.file.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-30.30C{1} %m%n 2017-12-08 08:19:52 TRACE 43:SpecializationContextMenu - Showing menu items (1 items selected) 2017-12-08 08:19:52 DEBUG 48:SpecializationContextMenu - Showing menu for class ArchimateElementEditPart 2017-12-08 08:19:52 DEBUG 74:SpecializationContextMenu - adding menu label : Refresh view "Rowan" 2017-12-08 08:20:01 TRACE 43:SpecializationContextMenu - Showing menu items (1 items selected) 2017-12-08 08:20:01 DEBUG 48:SpecializationContextMenu - Showing menu for class ArchimateElementEditPart 2017-12-08 08:20:01 DEBUG 74:SpecializationContextMenu - adding menu label : Refresh view "Rowan" 2017-12-08 08:20:19 TRACE 84:ecializationRefreshViewHandler - refreshing view Rowan 2017-12-08 08:20:57 TRACE 43:SpecializationContextMenu - Showing menu items (1 items selected) 2017-12-08 08:20:57 DEBUG 48:SpecializationContextMenu - Showing menu for class ArchimateElementEditPart 2017-12-08 08:20:57 DEBUG 74:SpecializationContextMenu - adding menu label : Refresh view "Rowan" 2017-12-08 08:20:59 TRACE 84:ecializationRefreshViewHandler - refreshing view Rowan 2017-12-08 08:21:11 TRACE 43:SpecializationContextMenu - Showing menu items (1 items selected) 2017-12-08 08:21:11 DEBUG 48:SpecializationContextMenu - Showing menu for class ArchimateElementEditPart 2017-12-08 08:21:11 DEBUG 74:SpecializationContextMenu - adding menu label : Refresh view "Rowan" 2017-12-08 08:21:13 TRACE 84:ecializationRefreshViewHandler - refreshing view Rowan

herve91 commented 6 years ago

that is strange. The plugin does not try to change the icon.

Could you please check if your property is correctly spelled (I mean check if there is no space before or after the "icon" word) ?

mike548141 commented 6 years ago

@herve91 Just double checked but its definitely correct. I have created new models, new objects within existing models etc and all the same outcome. The property name is set to "icon" and its value is "microsoft/dag.png" (without the quotes, those are copy and pastes of the whole value). You can see the file paths in my original post which match the image file

Its a fresh install of Archi and the only other plugin installed is the "Model Repository Collaboration Plugin" - https://www.archimatetool.com/plugins

herve91 commented 6 years ago

I do not understand.

  1. the plugin is started (we know it because the preference page is present) 2 . the plugin does not crash (we know it because the log file would have an exception if it was the case)
  2. the plugin does not try to chang ethe icon despite the fact that you set the "icon" property

I see that you are running Archi on a Mac. Unfortunately, I do not hage got a Mac so cannot check if this is related to this.

The only thing I can do is to add more traces in the log file. I'll release a new version with these new traces in the coming days.

herve91 commented 6 years ago

In fact, I just release the version 0.3 that includes more detailed debug and trace messages. Could you please update your plugin (you may use the "check for updates" icon on the preference page) and rerun your tests ?

thanks and regards Hervé

mike548141 commented 6 years ago

@herve91 Thanks for the update, unfortunately still the same outcome in the UI (logo not changing) and the logs Also I should mention that the auto-update successfully downloaded the new version of the plugin but failed to delete the old JAR file so when Archi restarted it complained that it was still using the old version

2017-12-09 09:41:43 DEBUG 428:PreferencePage - Logger initialised. 2017-12-09 09:41:43 TRACE 428:PreferencePage ┌ log4j.rootLogger = TRACE, stdout, filelog4j.appender.stdout = org.apache.log4j.ConsoleAppender 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.stdout.Target = System.out 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.stdout.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-30.30C{1} %m%n 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.file = org.apache.log4j.FileAppender 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.file.ImmediateFlush = true 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.file.Append = false 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.file.Encoding = UTF-8 2017-12-09 09:41:43 TRACE 428:PreferencePage │ log4j.appender.file.File = /Users/User/SpecializationPlugin.log 2017-12-09 09:41:43 TRACE 428:PreferencePage └ log4j.appender.file.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-30.30C{1} %m%n 2017-12-09 09:45:16 TRACE 43:zationDiagramEditorContextMenu - Showing menu items (1 items selected) 2017-12-09 09:45:16 DEBUG 48:zationDiagramEditorContextMenu - Showing menu for class ArchimateDiagramPart 2017-12-09 09:45:16 DEBUG 74:zationDiagramEditorContextMenu - adding menu label : Refresh icons and labels in view "Conceptual view" 2017-12-09 09:45:19 TRACE 84:ecializationRefreshViewHandler - refreshing icons and labels in view Conceptual view 2017-12-09 09:45:21 TRACE 43:zationDiagramEditorContextMenu - Showing menu items (1 items selected) 2017-12-09 09:45:21 DEBUG 48:zationDiagramEditorContextMenu - Showing menu for class ArchimateElementEditPart 2017-12-09 09:45:21 DEBUG 74:zationDiagramEditorContextMenu - adding menu label : Refresh icons and labels in view "Conceptual view" 2017-12-09 09:45:23 TRACE 84:ecializationRefreshViewHandler - refreshing icons and labels in view Conceptual view 2017-12-09 09:45:48 TRACE 43:zationDiagramEditorContextMenu - Showing menu items (1 items selected) 2017-12-09 09:45:48 DEBUG 48:zationDiagramEditorContextMenu - Showing menu for class GroupEditPart 2017-12-09 09:45:48 DEBUG 74:zationDiagramEditorContextMenu - adding menu label : Refresh icons and labels in view "Conceptual view" 2017-12-09 09:45:50 TRACE 84:ecializationRefreshViewHandler - refreshing icons and labels in view Conceptual view

herve91 commented 6 years ago

That's strange ...

Could you please try the following very simple model (copy the xml to a file called test.archimate and open it in Archi):

<?xml version="1.0" encoding="UTF-8"?>
<archimate:model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:archimate="http://www.archimatetool.com/archimate" name="test" id="eb6c0618-81c5-4fbe-b40f-952b6d0dd4a1" version="4.0.0">
  <metadata/>
  <folder name="Strategy" id="e93c56a3-63da-42ac-aae8-b2106a4d7916" type="strategy"/>
  <folder name="Business" id="c69c630b-7d44-4a92-9a8a-d2bfed8504fc" type="business"/>
  <folder name="Application" id="68e2cefc-5a58-4a50-878f-d48268214b4d" type="application"/>
  <folder name="Technology &amp; Physical" id="a39b8750-7f69-4670-ac7c-8d1ba8b41ed5" type="technology">
    <element xsi:type="archimate:Node" name="Node" id="f29ca156-5bab-461c-b1a2-88d8d80c0515">
      <property key="icon" value="app-16.png"/>
    </element>
  </folder>
  <folder name="Motivation" id="85547f61-3c86-4b63-8599-2131ec3499a2" type="motivation"/>
  <folder name="Implementation &amp; Migration" id="a255afdb-162c-43de-a2e2-5ba35709c1ff" type="implementation_migration"/>
  <folder name="Other" id="6e1df214-dc5b-4d93-8347-d6f74d9704aa" type="other"/>
  <folder name="Relations" id="d0747f6c-7595-4e1c-a3a3-3fc1b4323b31" type="relations"/>
  <folder name="Views" id="cab7f3bd-0b2f-4b1b-8174-0daa410cb719" type="diagrams">
    <element xsi:type="archimate:ArchimateDiagramModel" name="Default View" id="5c07a12e-0941-454c-a8ed-b6714847410c">
      <child xsi:type="archimate:DiagramObject" id="eaa703e3-bbb7-4d12-90d6-91c5a6091e60" archimateElement="f29ca156-5bab-461c-b1a2-88d8d80c0515" type="1">
        <bounds x="96" y="132" width="120" height="55"/>
      </child>
    </element>
  </folder>
</archimate:model>

You should obtain the following: test

And your log file should contain the following lines:

2017-12-08 23:30:57 DEBUG  147:SpecializationPlugin           - Logger initialised.
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           ┌ log4j.rootLogger = TRACE, stdout, filelog4j.appender.stdout = org.apache.log4j.ConsoleAppender
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.stdout.Target = System.out
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.stdout.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-30.30C{1} %m%n
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.file = org.apache.log4j.FileAppender
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.file.ImmediateFlush = true
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.file.Append = false
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.file.Encoding = UTF-8
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           │ log4j.appender.file.File = C:\Users\Hervé\SpecializationPlugin.log
2017-12-08 23:30:57 TRACE  147:SpecializationPlugin           └ log4j.appender.file.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-30.30C{1} %m%n
2017-12-08 23:30:57 INFO   149:SpecializationPlugin           - Initialising SpecializationPlugin plugin ...
2017-12-08 23:30:57 INFO   151:SpecializationPlugin           - ===============================================
2017-12-08 23:30:57 DEBUG  167:SpecializationPlugin           - plugin's package  = org.archicontribs.specialization
2017-12-08 23:30:57 DEBUG  168:SpecializationPlugin           - plugin's folder   = C:\Program Files\Archi 4.1\plugins
2017-12-08 23:30:57 DEBUG  169:SpecializationPlugin           - plugin's filename = C:\Program Files\Archi 4.1\plugins\org.archicontribs.specialization_v0.3.jar
2017-12-08 23:30:57 INFO   201:SpecializationPlugin           - Specialization plugin v0.3 initialized.
2017-12-08 23:30:57 TRACE  777:SpecializationPlugin           - DiagramModelArchimateObject:"Node": must replace label
2017-12-08 23:30:57 TRACE  805:SpecializationPlugin           - Node:"Node": property "label" not found, label not replaced
2017-12-08 23:30:57 TRACE  715:SpecializationPlugin           - DiagramModelArchimateObject:"Node": must replace icon in view
2017-12-08 23:30:57 DEBUG  741:SpecializationPlugin           - Node:"Node": Replacing icon from property "icon" value "app-16.png"
2017-12-08 23:30:57 TRACE  746:SpecializationPlugin           - Node:"Node": icon file "/img/app-16.png" has been found
2017-12-08 23:30:58 TRACE  715:SpecializationPlugin           - DiagramModelArchimateObject:"Node": must replace icon in view
2017-12-08 23:30:58 DEBUG  741:SpecializationPlugin           - Node:"Node": Replacing icon from property "icon" value "app-16.png"
2017-12-08 23:30:58 TRACE  746:SpecializationPlugin           - Node:"Node": icon file "/img/app-16.png" has been found
2017-12-08 23:30:58 TRACE  715:SpecializationPlugin           - DiagramModelArchimateObject:"Node": must replace icon in view
2017-12-08 23:30:58 DEBUG  741:SpecializationPlugin           - Node:"Node": Replacing icon from property "icon" value "app-16.png"
2017-12-08 23:30:58 TRACE  746:SpecializationPlugin           - Node:"Node": icon file "/img/app-16.png" has been found
2017-12-08 23:30:58 TRACE  715:SpecializationPlugin           - DiagramModelArchimateObject:"Node": must replace icon in view
2017-12-08 23:30:58 DEBUG  741:SpecializationPlugin           - Node:"Node": Replacing icon from property "icon" value "app-16.png"
2017-12-08 23:30:58 TRACE  746:SpecializationPlugin           - Node:"Node": icon file "/img/app-16.png" has been found
mike548141 commented 6 years ago

@herve91 No luck unfortunately, followed the process above and I got this

SpecializationPlugin.log

screen shot 2017-12-10 at 21 54 06
herve91 commented 6 years ago

Could you please send me the log file (in trace mode) ?

mike548141 commented 6 years ago

@herve91 Hi its in the post above an uploaded file https://github.com/archi-contribs/specialization-plugin/files/1545441/SpecializationPlugin.log

herve91 commented 6 years ago

Sorry, I did not see the link in your previous post ...

What I do not understand is why you do not have any error message. The plugin is initialized but nothing happens, even in the log file.

I'll do some more testing, may be add some more trace messages ... I'll let you know ASAP.

herve91 commented 6 years ago

I just released the version 1.0 of my plugin.

Please do not hesitate to open a new issue if this does not work as expected.

mike548141 commented 6 years ago

@herve91 Hi the issue is still happening (using v1.0) but there is more in the log now. I can't find the "refresh view" option when I right click anymore. I tested using the same XML archimate file you posted above, and I configured the image folder etc as required by the v1.0 plugin

Log file: SpecializationPlugin.log

rich-biker commented 6 years ago

I'm seeing a similar experience as Mike on my Mac. I can't reference the default images in the Archi Application itself, but I can define my own outside (if I make a copy of app-16.png image to my local folder):

screen shot 2017-12-21 at 14 17 00

herve91 commented 6 years ago

answer in #9