Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Martin S. on March 20, 2013, 09:32:53 pm
-
Hello,
is it possible to include diagrams into the search results (CTRL + F)?
When I search for a string I want also that diagrams are listed in the search results which include that string in their diagram name.
-
I use an sql search to search for diagrams
select d.ea_guid as CLASSGUID,d.Diagram_Type as CLASSTYPE,d.name as Name ,package.name as PackageName
,package_p1.name as PackageLevel1,package_p2.name as PackageLevel2 ,package_p3.name as PackageLevel3
from ((((t_diagram d
inner join t_package package on d.package_id = package.package_id)
left join t_package package_p1 on package_p1.package_id = package.parent_id)
left join t_package package_p2 on package_p2.package_id = package_p1.parent_id)
left join t_package package_p3 on package_p3.package_id = package_p2.parent_id)
where d.name like '#WC#<Search Term>#WC#'
Geert
-
Unfortunately you can't add the diagram search type to any other filter types.
But you can add an additional search for your required string
-
Extending on that last remark, the next best thing would be the custom search below that extends 'Simple' with the -parent- of matching diagrams.
Matching diagrams are identified by a 'Note' symbol in the search result, and ALT+G on the result will navigate the project browser to the parent of the diagram.
best regards,
Paulus
select ea_guid AS CLASSGUID,
Object_Type AS CLASSTYPE,
Name
FROM t_object
where t_object.alias like '#WC#<Search Term>#WC#'
or t_object.name like '#WC#<Search Term>#WC#'
UNION
select t_object.ea_guid AS CLASSGUID,
"Note" AS CLASSTYPE,
t_diagram.Name
FROM t_diagram
, t_object
where t_diagram.name like '#WC#<Search Term>#WC#'
and t_diagram.parentid = t_object.object_id
UNION
select t_package.ea_guid AS CLASSGUID,
"Note" AS CLASSTYPE,
t_diagram.Name
FROM t_diagram
, t_package
where t_diagram.name like '#WC#<Search Term>#WC#'
and (t_diagram.parentid = 0
and t_diagram.Package_ID = t_package.Package_ID)
-
Thanks for your replies so far! I'm new to Enterprise Architect so I have no clue what to do with the code snippets. Can you give me a link to a page which shows what I'm supposed to do with these snippets?
-
More info on SQL Searches
On my blog here:
http://geertbellekens.wordpress.com/2011/01/14/harvesting-the-power-of-eas-sql-searches/
In the manual here: http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/navigate_search_and_trace/creating_filters.html
Geert
-
Wow. That is really a core functionality of a modeling tool missing in EA.
-
I've been looking at this, more to filter out certain diagrams types from specific reports (that's why I don't want to use the feature to exclude a diagram from ALL reports)
What I find odd: the help section on Filters in EA 10 specifically shows and mentions filtering by Diagram properties:
"If you are adding filters to an existing search, the list contains only items appropriate to the initial filter. For example, if the initial filter is on diagram properties, the list for any subsequent filters for the search only contains the Diagram option"
http://www.sparxsystems.com/enterprise_architect_user_guide/10/navigate_search_and_trace/adding_filters.html
But like everyone else, I can't find this option, did it exist and was removed????
-
I'll have to admit that the quoted text is not very clear. I have edited it to read:
If you are adding filters to an existing search, the list contains only items appropriate to the initial filter.
For example:
- If the initial filter is set to search on Element, the drop-down list for subsequent filters on the search will show a long list of element properties that you can filter more specifically on
- If the initial filter is set to search on Diagram, the list for any subsequent filters for the search only contains the Diagram option, as there are no other filters that can be applied to a search on diagrams
[/i]If you experiment with new searches and new filters, you will see that the possible values for the Search On field are themselves filtered by the type object you are performing the search on.
-
Hi RoyC, I understand that.
Unfortunately "Diagram" does not show up in the "Search On" list (the initial filter), Element, Attribute etc. do, but not Diagram.
In the manual it shows Diagram in the "Search On" list:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/navigate_search_and_trace/adding_filters.html
Am I looking in the wrong spot?
-
No, you are looking in the right place but Diagram only appears for the first brand new filter on, effectively, a brand new search.
In the Search Builder, right-click on the body of the Search Builder tab and select the New Search context menu option. Type in a name - say, DiagSearch. The Editor Type radio button is selected by default. Click on the OK button. So, the Search Builder tab should be clear.
Right-click on the body of the Search Builder tab again and select the Add Filter option. On the Add Filters dialog, the Search On field defaults to Element. Click on the drop-down arrow and see that the second item on the list is Diagram. Select it! Quick!
This gives you a search on a small group of diagram properties, which you can enable and set values for as necessary. Click on the OK button.
In theory, you could select to add another filter to this search, in which case the drop-down arrow on the Search On field would show you Diagram and only Diagram - you can't mix any other object type search into the Diagram search. In practice, I'm not sure that adding another filter would give you anything you couldn't acheive with the first, single filter.
If you had selected Element for the first filter, or indeed pretty much any option other than Diagram, the Search would have to act initially on an element and thereafter you could add more filters on a number of element properties. So the Search On field would continue to offer several options, but not Diagram because you can't mix the Diagram filter into an Element search.
I hope that helps.
-
Roy
the way I see it is that a search (ctrl-F), simple or extended, returns no diagrams in the results even if the search term is in the diagram name.
In fact from a usability point of view it seems impossible to search for diagrams using a specific name or keyword.
How about improving EA do it can find diagrams in the search. Perhaps a built in "diagram" search would do the trick.
(http://i306.photobucket.com/albums/nn245/copperkiwi/Sparx/2013-09-2513_12_03-_zpsff01c541.png) (http://s306.photobucket.com/user/copperkiwi/media/Sparx/2013-09-2513_12_03-_zpsff01c541.png.html)