Author Topic: Present Element Note content in a linked note.  (Read 3844 times)

KenM

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Present Element Note content in a linked note.
« on: October 01, 2020, 02:55:20 am »
I've been able to create a script that will programmatically add a linked note to an element.  Great!

However, I want to also have the note present the Element Note content - in effect, automating the "Link this note to an Element Feature" connector action.

Can someone give me an idea of how to do this?  My search in the forum has only yielded results around modifying the database directly, which is certainly a no-no these days.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #1 on: October 01, 2020, 03:50:37 am »
Just looked into my Inside book and found that t_object.PDATA1 has the linked element feature name. You can start looking into that field and see how it reacts on manipulating the feature link via the context.

q.

KenM

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #2 on: October 01, 2020, 06:04:55 am »
Sorry, I'm unfamiliar with PDATA1 - can you give me a bit more detail?  Are you referring the underlying database?

If so, note that I don't have access to the underlying database; no SQL Server tools to query the database.  I've looked at the PropertyType (which I think may be the same as PDATA1, based on some other statements on the forum?), but it's undefined.

Where do I find this book that you speak of?


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #3 on: October 01, 2020, 08:54:37 am »
My book can be found below in the link.

Yes, I'm talking about the underlying DB. And more sooner than later you will have the need to directly fiddle with it. PDATA1 is column in t_object which holds info about elements. PDATA1 is only readable via the API. To write it you need to use the (undocumented!) operation Repository.Execute, which takes any UPDATE/INSERT SQL. In order to read the DB use the (documented) Repository.SQLQuery which takes any SELECT SQL and returns an XML result.

q.

KenM

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #4 on: October 01, 2020, 11:17:36 pm »
Thanks.  I think you missed supplying the link to your book :)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #5 on: October 01, 2020, 11:21:21 pm »
My signature below should lead you there. Else: see here (the first one).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Present Element Note content in a linked note.
« Reply #6 on: October 01, 2020, 11:43:39 pm »
@q, your signature is missing....

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #7 on: October 01, 2020, 11:54:25 pm »
Oh wow. Thanks Geert. Makes me wonder, why. Have to figure out somehow...

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #8 on: October 03, 2020, 05:59:43 pm »
Hey fellas,


I saw this at work yesterday, and again from home today. I can see the signature now, and I could yesterday as well.

So possibly the link in Q's signature is blocked for some forum readers.
This could in turn be because it's an unsecure (plain HTTP) link, blocked either by a firewall or the browser itself (possibly a plug-in).

This is the link. See if you can open it:
http://liquit.biz/brain/books.html

Maybe it's time the ol' brain got itself a certificate? :)


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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Present Element Note content in a linked note.
« Reply #9 on: October 03, 2020, 07:59:10 pm »
You are right Uffe,

I get a warning page from MalwareBytes (chrome plugin) when I try to visit that link

https://imgur.com/NGzAYNy

I guess that's why I don't see the signature anymore.

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #10 on: October 03, 2020, 08:47:09 pm »
Well no, that there is MalwareBytes saying everything under .biz is a scam. That seems a bit harsh.

But either way, no one should be using HTTP anymore. And that goes for you too, my friend.  ;D

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Present Element Note content in a linked note.
« Reply #11 on: October 03, 2020, 09:21:36 pm »
Well no, that there is MalwareBytes saying everything under .biz is a scam. That seems a bit harsh.

But either way, no one should be using HTTP anymore. And that goes for you too, my friend.  ;D

/U
Yeah, I guess I should update that image :-[. The site itself uses https since long.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Present Element Note content in a linked note.
« Reply #12 on: October 04, 2020, 12:32:22 am »
Well no, that there is MalwareBytes saying everything under .biz is a scam. That seems a bit harsh.

But either way, no one should be using HTTP anymore. And that goes for you too, my friend.  ;D

/U
Partially I agree, but what I publish there is at a postcard level. No security required. What hurts more is the overhead to get a certificate for your server if you're hosting it on your own. I guess I have to live with people not seeing my signature behind firewalls since probably having a pain-free https-setup will be nothing I can expect to see in the rest of my life.

q.