Author Topic: Inserting a Document  (Read 12630 times)

Amy_N

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Inserting a Document
« on: June 09, 2015, 10:24:22 am »
Hi there. I can't seem to work out how to insert a document e.g. a word or excel reference document. I don't want to be able to edit it within the model or anything, just click on it and it opens the document in the relevant application

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Inserting a Document
« Reply #1 on: June 09, 2015, 11:29:05 am »
There are a few places where you could link to an external document. Where do you want to click on the name/link? For example, in the element properties, or on a diagram?
Best Regards, Roy

Amy_N

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Re: Inserting a Document
« Reply #2 on: June 09, 2015, 12:35:28 pm »
Hi Roy. On the diagram preferably. I did think of inserting a hyerlink bu we are using a cloud connection. I was wondering ifthere was a way of storing the document in the model?

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Inserting a Document
« Reply #3 on: June 09, 2015, 02:01:56 pm »
The simplest way is to just drag the file from your file browser onto an EA diagram. That prompts you to select a hyperlink or external document (which you don't seem to want) or an internal document (which you do). When you make that selection, EA adds an Artifact element to the diagram, and you can double-click on the Artifact to open the file. You might have to pass through an import/format dialog to open the file each time, though.

The equivalent right-click context menu option for opening the document is Open Stored Document.

If that doesn't do what you want, ask again!

EDIT:  For more information, see:
http://www.sparxsystems.com/enterprise_architect_user_guide/12.0/standard_uml_models/create_artifact_for_external_f.html
« Last Edit: June 09, 2015, 02:17:59 pm by RoyC »
Best Regards, Roy

Amy_N

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Re: Inserting a Document
« Reply #4 on: June 09, 2015, 04:38:16 pm »
That's perfect Roy, just what I was looking for thank you  :)

I tried searching in help before but I was searching for 'stored document' and 'linked document' and nothing useful was coming up.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1372
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Inserting a Document
« Reply #5 on: October 01, 2015, 05:54:39 pm »
Hi Roy,

I need to use the External Artifact as I store all my documents in a separate SVN repository.
Representing each document in my EA project is great but I need to open the linked external doc when I double click instead of opening its properties (same expected behaviour as the Internal Artifact).
Is there any way round it?

I started writing a file to retrieve the artifact's filename and launch it. However I cannot find any method to launch the file.
Could the Repository.CustomCommand include a method to achieve this e.g. "Repository","LaunchFile",file.Name ?

Thanks
« Last Edit: October 01, 2015, 06:22:28 pm by gfuk »
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Inserting a Document
« Reply #6 on: October 05, 2015, 02:19:21 pm »
(Response from Roy with helpful explanations from Simon.)

The only way to open the external file is to go into element Properties, select the Files page, select the file path and click on the Launch button.
The problem is that there can be multiple files linked in this method. The system can't just assume there is one.

There isn't a method in the API because you should be calling the shell directly to open the file.

I hope that makes things a bit clearer; sorry it probably wasn't what you wanted.
Best Regards, Roy

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1372
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Inserting a Document
« Reply #7 on: October 05, 2015, 05:50:29 pm »
Hi,

As a workaround I added a hyperlink on the artifact.

I understand that there isn't an ideal way to address this as you indeed could have a single, none or several files associated. One option would involve opening the first file in the list on a double click, or the artifact's properties when the list is empty.
Is it worth submitting as an enhancement request?

Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Inserting a Document
« Reply #8 on: October 06, 2015, 08:52:34 am »
Quote
first file in the list
It's an unordered list. (ie. No sort buttons) How would you determine/specify the first item?

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1372
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Inserting a Document
« Reply #9 on: October 08, 2015, 05:31:54 pm »
Hi Simon,

I see your point.
So as a simple rule, would it make sense to apply the following for External Artifacts ?
-> if there is a single item in the list, change the double click behaviour so it opens this file. If there is no file or more than 1, then open the element's properties.

Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Inserting a Document
« Reply #10 on: October 09, 2015, 08:37:00 am »
An external artifact would be any artifact (potentially unstereotyped) that has a file link. I don't see anything else that distinguishes them. So my feeling is that would too greatly impact other users.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Inserting a Document
« Reply #11 on: October 09, 2015, 06:44:34 pm »
Hi Guillaume,


Since all element types have "file" links, I agree that the default EA behaviour should be to open the regular properties dialog. But what you're after is pretty simple to implement in an Add-In. I've done so in the past.

If you want to get a little fancy, you can create an "external" stereotype which applies to Artifact, add an "L", or an "X" maybe, to the shape script and icon (in place of the "A" shown in linked documents), and only launch on double-click for those artifacts. I also think you should launch all files, if the user has added more than one.

Of course, if Sparx were to implement that, they could create a custom properties dialog for it and include it in the Artifacts toolbox page. But a home-grown solution is a matter of hours to implement.

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.