NetTalk Central

Author Topic: Global Embeds  (Read 3247 times)

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Global Embeds
« on: August 30, 2010, 08:21:57 AM »
Hi All-

I see global embeds being created for the NetWeb object. I'm curious as to what they can be used for.

Thanks,
Gordon

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Global Embeds
« Reply #1 on: August 31, 2010, 12:06:37 AM »
If you have to ask - then you shouldn't be using them :)

Seriously though - they're not really useful to you except in very specific, fairly bizarre situations. They're there because I always add embed points on the grounds that I like to give folk options if they know better than me, but there's no useful need to embed code there that I can see.

cheers
Bruce

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Global Embeds
« Reply #2 on: August 31, 2010, 08:11:44 AM »
Thanks Bruce-

I was looking for a place where I can set some properties prior to opening a file (PROP:Owner and PROP:Alias). I found an embed in the WebHandler _OpenFile method where I was able to add what I needed (priority 1000 or it would get skipped). BTW, it appears to have unused code genereated:

    RM &= NetWebRelationManager(p_File)
    If NOT RM &= Null
      Loc:Err = RM.Open()
    End
    Return Loc:Err
  ! [Priority 4500]
 
  ! Parent Call
  ReturnValue = PARENT._OpenFile(p_file)

Was this intended?

Regards,
Gordon Nettalk 5 - PR29

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Global Embeds
« Reply #3 on: August 31, 2010, 09:49:26 PM »
Hi Gordon,

The recommended place to add code for setting the file name, or owner, is
in the WebHandler procedure, ProcessLink method, before Parent Call.

Where you have it is probably ok, unless of course, in embed code, you call a procedure that uses Access:File.Open rather than p_web.Openfile. Given that that's a probably use case, I'd recommend moving the code to the "convention" position.

Yes the extra code is there by design. The whole point of the _OpenFile (et al) methods is to provide a consistent interface between ABC and Legacy apps. The Parent call is generated by the standard class code - the ABC bit is slipped in before it in the case where you have an ABC app.

Cheers
Bruce

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Global Embeds
« Reply #4 on: September 03, 2010, 09:49:05 AM »
Thanks Bruce-

The problem with the .ProcessLink method is that I would need to do it for every file (ugh!). I've asked about an embed or template for the FileManager on ClarionLive chat and have a possible solution there.

Regards,
Gordon