Skip to Content
author's profile photo Former Member
Former Member

Client Eventing

I am trying to get started with a simple test to verify that the EPCF is working according to documentation.

I have created an html page that should simply display the version of the EPCM object by doing the following.

<script>document.write (EPCM.getVersion());</script>

Then I created a .NET iView with the url to this html page and also selected "bypass iView server".

When I load this iView on a portal page I get an error "EPCM is undefined".

I didn't think I needed to include any files to make this work. I thought from the documentation that any iViews loaded on a portal page automatically include the necessary files to use this framework. Is there something simple I am missing?

Andrea

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 04, 2004 at 12:15 AM

    yes, i believe something "simple" yet not-so-obvious is missing.

    indeed, iviews and contents created in the portal automatically have the epcf files included. but the problem here is, your little html page is external content, at least from the portal's point of view. when loaded into the iview, the portal most likely places the external html contents in a separate iframe.

    the solution is EPCMPROXY object, which is defined in a epcfproxy.js file. you must include it in your external html file, and in the script snippet, use EPCMPROXY instead of EPCM, for example EPCMPROXY.getVersion(). this is well documented in the client framework section in ep6.

    also, due to cross frame scripting, you may need to perform domain relaxation in js. plus, make sure you access the portal and the url to your html page using the full domain path, for example http://server.my.com/page.html instead of simply http://server/page.html. again, this is documented in the client framework section and is sometimes referred to as the java origin policy.

    hope this helped and good luck.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the reply. I think the EPCMPROXY has helped, but I am still not quite there. Now I don't get the "undefine" error, but when I call the EPCMPROXY.getVersion() function the result I get is the word "null". I get the same result for all methods that I call.

      Current script:

      <SCRIPT src="epcfproxy.js"></SCRIPT>

      </HEAD>

      <BODY>

      <script>

      var lnDotPos = document.domain.indexOf( "." );

      if (lnDotPos >= 0)

      document.domain = document.domain.substr( lnDotPos + 1 );

      document.write ('EPCM '+EPCMPROXY.getVersion());

      </script>

      Any ideas? I appreciate your help!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.