Formatting of element names

Started by TEK, August 15, 2018, 19:32:30 PM

Previous topic - Next topic

TEK

Hi

I'm wondering if there is any way to get Archi to do a better text splitting than it does for me.

Let say that I have for example a service named "UserProfileService", or in Norwegian that would be "Brukerprofiltjeneste"
In English I might have called it "User Profile Service", in Norwegian that does not work and it would be named "Brukerprofiltjeneste".

To make this easier I will use "Userprofileservice" as a name from now on.

The problem is when I have a model and I have several services I want to show in one drawing.
Then the boxes soon becomes to narrow, and the text may display like this:
Userprofil
eservice

Of course, if I name it like this "User-profile-service" I will typical get this:
User-
profile-
service

But I might as well get this
User-profile-
service


I would really like it to be like this when there is enought space:
Userprofileservice
And like this
Userprofile-
service

or this
User-
profile-
service

if there is to little space

I think what I need is to be able to insert either a soft-hyphen or a  zero-width space.

Is this possible to do in Archi? If so, how?

Best regards, TEK

Hervé

Hi,

I know this will not fulfill your requirement, but it may be of some help.

You may have a try with my specialization plugin (https://github.com/archi-contribs/specialization-plugin) that allows you to replace labels and icons in views and do some (basic) formatting.

You will be able to specify user\nprofile\nservice that will give you:
user
profile
service

Hope this helps

Best regards
Hervé

TEK

Thanks, that solved it good enough I think.

It did not solve my problem perfectly, but always showing for example:
Userprofile-
service

is mutch better than something showing¨
Userprofile-service
and something showing
Userprofile-
service


Great work on the plugin!

pst, maybe it could be expanded to support soft-hypens?

Hervé

Hi,

The point is that my plugin does a simple string replace and does not rewrite the whole picture mechanism.

So unfortunately, it won't be possible  :-\

Sorry

TEK

Great plugin anyway!

But wait a second. Are you sure? You are able to replace \n with a newline.
A soft hypens is just a character in the windows characther map. It has unicode U+00AD or key Alt + 0173.
I'm unable to type it in - as when I press Alt + key the menu is activated. So if the plugin for example supported insertion of unicore characters, like this \u00ad, and replaced that with the actual character that might actually fix this as well as any other special characater you want to insert...
I think (or hope) that the render engine of Archi would recognize and handle soft-hypens. As it support regular word breaking I think that it is a good possiblity that it would.

BTW: I did not find anything in the help about what "Replace label" supports. Obvious I have figured out that \n is supported. And also \t.
But what else does it support? Any place where it is documented?

Best regards, TEK

Hervé

Hi Tek,

Before I start to do some dev to check it, could you please test it on your side first ...

I mean, create an empty model with one element. then save your model in an Archimate file.

This Archimate file is an XML file that can be edited using any text editor (like notepad on Windows or vim on Linux).

Then insert your soft hyphen in your element name end check if Archi manages it correctly.

If yes, then I'll provide a way to insert soft hyphens  :D

Best regrds
Hervé

TEK

Hi

I found out that special characters are supportert, so that this should work in theory:
<element xsi:type="archimate:ApplicationComponent" name="LongName­Here" id="3df7ce83-fb6e-4ca7-9661-611fb00300fe"/>

However, Archi always prints the hyphen. So it does not work.
Other chacaters, as for example non-breaking spaces did work.

Bummer  :(

Hervé


TEK

BTW - it would be a great feature if the plugin could have an uption to update the Name based on the Label given in "Replace label".
I for example mostly just want to control linebreaks. So if I type:
My service\n
has a long\
name

It would have been great to have the option that the Name was automatically updated to "My service has a long name"
Now I have to remember to change the name every time I change the label - and that is easly forgotten.

Hervé

My apologies but it wont be possible as it may lead to loops if the label include the names like in "this is ${name}".

TEK

#10
 :'( To bad, would have been really swell to have a easy way of updating the name...

If anyone is interested:
I have reported a issue in Archi that it does not support soft-hypens.
https://github.com/archimatetool/archi/issues/387