Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mlk

Pages: [1]
1
General Board / Re: AppliesTo filter for Predefined Structured Typ
« on: November 15, 2012, 09:57:32 pm »
Thank you. I caught the idea. I suggest adding this clarification you post for the AppliesTo filter in the help. Such a "intervention" will help more people.

2
General Board / AppliesTo filter for Predefined Structured Types
« on: November 13, 2012, 09:28:14 pm »
Hi.

a. What's the difference between these: AppliesTo and BaseStereope?
b.Could I use them both at the same time (when I try the defined tag doesn't show itself)?
c. Could you please give me any example how to use AppliesTo with Predefined Structured Types, because there is no example inside the help?

Rgds.

3
Thanks Geert. It means EA has a gap in security management functionality.

I don't even know how can I be sure, that from the last GetCurrentLoginUser invocation the logged user didn't change his credentials by logging as someone else.

Maciek

4
Context: Security is enabled. User has no "Update Elements" permission granted. Addin works in the context of that user. The user is trying to change name of an element  via addin. The element is not locked.

Problem: When addin invokes EA.Element.Update()  there is no exception and GetLastError is empty. The user changes element's name. At the same time read only privillige is respected only by EA GUI (the user cannot change the name via Project Browser) .

Question: How to deal with it in code? How to guard repository against an unauthorized access?

Any help appreciated.

Maciek

5
Try this:

Code: [Select]
Element newElement = package.Elements.AddNew("Example_dev1", "Class");
newElement.Stereotype = "ArchiMate_Device";
newElement.Update();

6
Thanks for your replies. I forgot to mention I want to avoid too many interactions with EA.Interop methods, just for performance reason. Thanks.

Now I know that it’s impossible in COM model to get the GUID directly from within EA.EventProperties.
The only way IMHO is to use  EA_OnNotifyContextItemModified(EA.Repository repo, String GUID, EA.ObjectType ot) instead of EA_OnPostNewElement(EA.Repository repo, EA.EventProperties info).


Maciek

7
Is there a possibility to get object GUID directly from
EA.EventProperties info (i.e. "string str = info.Get("GUID").Value;")?


The Get works only for "string str = info.Get("ElementID").Value; ". I've tried with "GUID", "Guid", "ea_guid". Only exception message is "stable" and easy to predict ;)

Rgds,
Maciek

8
I thought so. I hoped there is either an API or some magic work-around. Parsing MDG XML it's not a bypass, because I would have to parse all active MDGs. It's not a nice day :-[

9
Problem: no information about format of TVT built in MDG at runtime

Context: Addin needs to know uppon what definition
(i.e.
"Type=Enum;
Values=Val1,Val2,Val3;
Default=Val2;
")
some tag is based on (if at all)

Description: Tagged Value Type (TVT) format for project's data is stored in t_propertytypes table. MDG stereotype tagged values enumerations for existing elements can be seen in [t_objectpropertes.Note] column (i.e. "Values: true,false Default: false")
...But what about tagged value types defined in MDG and loaded at runtime from MDG XML?

Any Tips (SQL, automation code, ...) Appreciated!

10
@stao, I handle the native window's message loop (Sparx Enterprise Architect). Unfortunately messages tell me nothing.

The code below writes every native's message (handle parameter in the contructor comes from clicht's code):
Quote

public class MyNativeWindow : NativeWindow {                  

                  public MyNativeWindow(IntPtr handle) {
                        this.AssignHandle(handle);
                  }

                  [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
                  protected override void WndProc(ref Message m) {
                        Debug.WriteLine("Native::" + m.ToString());
                        base.WndProc(ref m);
                  }
            }

11
I need it (connector dialog), so I would like to try, but I will be appreciated if any of you give me a tip how to start (tools, methods, etc). Groping for the right abbreviation (i.e. "CNN", "CND", "CN") gives nothing.

12
Great job, but... have you already found the DLG parameter for connector dialog?  

Pages: [1]