Drawback with namespaces for included file

0 votes
asked Sep 29, 2015 in Bug by Rezequiel (120 points)
retagged Sep 30, 2015 by Rezequiel

Hi, like the title saids, I found a drawback working with some co-workers with different diagrams, under version control (svn). The following issue is that when somebody use the include feature and upload the code for the others users, the path of the included file, it doesn't the same, for example:

User 1 creates foo.iuml, with the following:

@startuml

!include /home/user1/PATH/TO/FILE/clases/UC_skinparam.skp

/' More code '/

@enduml

After he concluded the work, uploads the file and the User 2 receive the file with a sintax error beacuse the path to the included file is:

!include /home/user1/PATH/TO/FILE/clases/UC_skinparam.skp

when it sholud be:

/home/user2/LARGE/PATH/TO/THE/FILE/clases/UC_skinparam.skp  for example.

Its any way to solve this?

 

If it doesn't, I was looking to the automatic path that the application constructs for a included file, and its is possible to change that,

- define a root folder (where the diagrams project resides),

- automatic construct the path to that root folder, and allow the users define a namespace in the top of each file? Like in Symfony projects (php).

So, it will be something like this:

Root folder: UML_Diagrams/

bar.iuml:

@startuml

namespace PATH\TO\THIS\FILE

/' SOME CODE '/

@enduml

foo.iuml

@startuml

namespace PATH\TO\THIS\FILE

!include \PATH\TO\BAR_FILE\bar.iuml

@enduml

 

Then, in low level, the path that the application constructs it will be:

\home\user\...\...\UML_Diagrams\PATH\TO\BAR_FILE\bar.iuml

 

I hope you can understand me :) .

Regards!

1 Answer

0 votes
answered Sep 29, 2015 by plantuml (294,960 points)
Hello,

Yes, it's very clear!

You can use environement variable in included path, this should do the job.

See http://plantuml.sourceforge.net/qa/?qa=1576/use-environment-variable-for-include-directive-path or http://plantuml.sourceforge.net/qa/?qa=1553/how-to-pass-a-search-path-for-include-files

Hope it helps!
commented Sep 30, 2015 by Rezequiel (120 points)
Thanks for the reply! Yes its helps, only the environment part because, and I forgot to explain, I work with Eclipse (with Symfony and SVN)and can't do it in the command line.

If it helps, what I do was:
Create an environment variable in my Fedora, with some part of the path (which varies from one SO -and user-, to another) and merges it with the other part of the path that is invariable. Example:

!include /%HOME%/%MY_APLICCATION%/invariable/part/of/the/path/foo.iuml .

So, thanks for the help and for point me to the right direction.

Regards!
commented Oct 1, 2015 by Rezequiel (120 points)
I complety solved using two dots - slash for each level on the directories tree (../../)

Hope it helps!.

Regards!
...