cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Intralink UI Script - compile outside of the Scripting Window using JDK.

Newbie

Intralink UI Script - compile outside of the Scripting Window using JDK.

Pro/E and Intralink masters - I'm working on the concept of generating
PDFs from Intralink CS upon drawing check in, the free version, using
Intralink's scripting to record and check out drawing(s) and execute a
Pro/E Trail File etc... It's working pretty good.



My problem is I want to modify the main script .java file to replace the
model name (programmatically) and then re-compile the .java file and
execute the Intralink script.



Using the JDK, how can one re-compile the source .java file? Using
javac.exe I get 6 errors like "package com.ptc.intralink.client.script
does not exist" and ILIntralinkScript function not being found.



Does anyone know where these library files/classes are so that I can
included them in the compile directory? I'm pretty green with Java, and
I don't really know what Intralink is doing when I re-compile using the
Scripting Screen.



Thanks - Robert Maillet

QuestAir Technologies

9 REPLIES 9

Re: Intralink UI Script - compile outside of the Scripting Window using JDK.

--- Robert Maillet <maillet@questairinc.com> wrote:
>
> My problem is I want to modify the main script .java file to replace the
> model name (programmatically) and then re-compile the .java file and
> execute the Intralink script.

Rather than editing and recompiling the java code, you should try do
do all of the processing within java, which will be much easier and
less prone to other problems.

> Using the JDK, how can one re-compile the source .java file? Using
> javac.exe I get 6 errors like "package com.ptc.intralink.client.script
> does not exist" and ILIntralinkScript function not being found.

Use a batch file like this to compile the code:

@echo off
set ilink_install=c:\ptc\ilink3.3
set path=%ilink_install%\bin;%ilink_install%\i486_nt\jre\bin;%path%
set classpath=%ilink_install%\i486_nt\lib\tools.jar
set ilink_jar=%ilink_install%\java\lib\Intralink.jar
java sun.tools.javac.Main -classpath %ilink_jar% -d . %1

Change the 'set ilink_install=' like to have it point to your install
of the intralink client. Run it like this: whatever.bat blah.java
Move the .class file to your .proi/.data/user.data/lib folder.


Marc
















Re: Intralink UI Script - compile outside of the Scripting Window using JDK.

Intralink can recompile the java file via the command line:

proilink3.3 -- -p filename.java -nographics
Highlighted

re: Intralink UI Script - compile outside of the Scripting Window using JDK.

Another option to compile outside of Intralink that's worked well for me is to use the Eclipse IDE. It compiles automatically as you edit your source, giving you syntax checking as you edit. Also very helpful especially for the undocumented UIScripting API is that it's "Content assist" gives you a popup listing of all available methods for the ILIntralinkScriptInterface object.
Just make sure to add the external jar proiclient\java\lib\Intralink.jar to your project, and copy the generated class files over to the .proi\.data\user.data\lib folder.

Gary Hoffman
CAD Systems Analyst
Solar Turbines Incorporated
Telephone: (858) 694-6961
E-mail: -

re: Intralink UI Script - compile outside of the Scripting Window using JDK.

Eclipse is the best. And it's free. I've been using it for a year and I'm still amazed with it. I use it for JLINK programming and the content assist is invaluable. It also has an add on for desinging GUI's in Swing (Visual Editor) that makes dialogs quick and easy to create.

Also very helpful (although more on the Pro/E side) is another free IDE called DRJAVA. Its advantage is that it has an 'interaction pane' that allows code snippets to be evaluatated in real time freeing you from the compile/test/edit routine. Best of all it's possible to use this interaction window to interact directly with a session of Pro/E via "asynchronous mode"- a JLINK jungle gym.

Greg Montgomery
Information Technology Analyst
John Deere Horicon Works

Re: Intralink UI Script - compile outside of the Scripting Window using JDK.

Now fully opposite question. How to compile java within ilink. My small automation program consists of Ilink and ProE portions. It compiles ok outside of ilink since I have CLASSPATH env properly set for ilink/proe libraries. But when I try to compile within Ilink it is ignoring system CLASSPATH and using its own intralink.jar only. So question is how to force ilink compiler to use proe libraries?
"Robert Maillet" <maillet@questairinc.com> wrote in message news:226630@datamgt...
Pro/E and Intralink masters - I'm working on the concept of generating PDFs from Intralink CS upon drawing check in, the free version, using Intralink's scripting to record and check out drawing(s) and execute a Pro/E Trail File etc. It's working pretty good.



My problem is I want to modify the main script .java file to replace the model name (programmatically) and then re-compile the .java file and execute the Intralink script.



Using the JDK, how can one re-compile the source .java file? Using javac.exe I get 6 errors like "package com.ptc.intralink.client.script does not exist" and ILIntralinkScript function not being found.



Does anyone know where these library files/classes are so that I can included them in the compile directory? I'm pretty green with Java, and I don't really know what Intralink is doing when I re-compile using the Scripting Screen.



Thanks - Robert Maillet

QuestAir Technologies

Re: Intralink UI Script - compile outside of the Scripting Window using JDK.

From a call I put in with PTC a while back:

Description:

How can the classpath that the Pro/INTRALINK client uses to execute java scripts be modified to include user defined classes.

Resolution:

Under \.proi\.data There’s LoginData.properties It’s default content is: #### 'classpath' used to launch Pro/Intralink scripts #RUNTIME_CLASSPATH= #### 'classpath' used to compile Pro/Intralink scripts #COMPILER_CLASSPATH=

Re: Intralink UI Script - compile outside of the Scripting Window using JDK.

Thank you and thank you Randy Jones who replied by email,

That works great now

Andrei
<-> wrote in message news:227346@datamgt...
>
> From a call I put in with PTC a while back:
>
> Description:
>
> How can the classpath that the Pro/INTRALINK client uses to execute java
> scripts be modified to include user defined classes.
>
> Resolution:
>
> Under \.proi\.data There's LoginData.properties It's default content is:
> #### 'classpath' used to launch Pro/Intralink scripts #RUNTIME_CLASSPATH=
> #### 'classpath' used to compile Pro/Intralink scripts
> #COMPILER_CLASSPATH=
>
>

Re: Intralink UI Script - compile outside of the Scripting Window using JDK.

--- Andrei <alapitski@rogers.com> wrote:
>
> Now fully opposite question. How to compile java within ilink. My small
> automation program consists of Ilink and ProE portions. It compiles ok
> outside of ilink since I have CLASSPATH env properly set for ilink/proe
> libraries. But when I try to compile within Ilink it is ignoring system
> CLASSPATH and using its own intralink.jar only. So question is how to force
> ilink compiler to use proe libraries?

I assume you're referring to JLink libraries. Yes, you can do this,
in a couple of different ways. Editing the LoginData.properties file
is the easiest.

If you're an administrator, you might find it easier to deploy your
application by adding the JLink jar file(s) to this folder:
<intralinkinstallfolder>\i486_nt\jre\lib\ext

Java automatically knows about and uses any jar files in there. If
other users are going to run your app, it would be easier to add the
jar file there, than edit several LoginData.properties files. This
takes care of compilation and runtime issues.


I don't know about you guys, but I had to use forward slashes on
windows for Intralink to recognize the jar file:

COMPILER_CLASSPATH=<proe_installdir>/text/java/pfcasync.jar;<proe_installdir>/text/java/pfc.jar

That's all on one line. Kind of weird if you ask me.


Marc










Re: Intralink UI Script - compile outside of the Scripting Window using JDK.

--- Marc Mettes <-> wrote:

>
> If you're an administrator, you might find it easier to deploy your
> application by adding the JLink jar file(s) to this folder:

The example for the 'ext' folder should have read something like this:
(IntralinkInstallFolder)\i486_nt\jre\lib\ext


> I don't know about you guys, but I had to use forward slashes on
> windows for Intralink to recognize the jar file:
> COMPILER_CLASSPATH=.../pfcasync.jar;.../text/java/pfc.jar

The example for the jar file syntax I had to use should have looked like
this:

COMPILER_CLASSPATH=C:/ptc/proe/text/java/pfcasync.jar;c:/blah/blah/pfc.jar


Anyone had that issue?


Marc