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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Translate the entire conversation x

Adding URL Variable to Change Activity JSP

BrianToussaint
19-Tanzanite

Adding URL Variable to Change Activity JSP

I am using Windchill PDMLink Release 12.1 and Datecode with CPS 12.1.2.8

How do I put an URL variable on a custom JSP page for a change activity? When I put the variable, it comes out as text.
ACCEPTED SOLUTION

Accepted Solutions

Hi @BrianToussaint 

It is very simple. The url can not contain a space character 

you have to replace the space character with a encoding character %20

check following link https://www.w3schools.com/tags/ref_urlencode.ASP

 

PetrH

View solution in original post

6 REPLIES 6

I think you have assign a data utility to that variable for it to render as a hyperlink.

Hi @BrianToussaint 

I use a following code to build the a download URL for the URL link variable in the workflow that is set this object in the variable URL type that I show in the task page.

//URL urlSet = ContentHelper.service.getDownloadURL(orderDocument, apData);
String serverURL = AttachmentsDataUtilityHelper.getBaseURL();
String urlString = serverURL + "/servlet/AttachmentsDownloadDirectionServlet?oid=OR:";

urlString = urlString + contents.getPersistInfo().getObjectIdentifier().getStringValue();
urlString = urlString + "&cioids=";
urlString = urlString + apData.getPersistInfo().getObjectIdentifier().getStringValue();
urlString = urlString + "&role=";
urlString = urlString + apData.getRole();

URL urlSet = null;
try
{
	urlSet = new URL(urlString);
} catch (MalformedURLException e)
{
	e.printStackTrace();
}

 

the urlSet is the final object that is saved in a wokrflow variable and then I show this variable in the task activity page

 

hope this can help

 

PetrH

@HelesicPetr, the  problem that I am running into is that I have a space and it stops the link at the space and then shows the rest but it isn't part of the link.

 

String PowerBI_Lnk = PowerBI_WU_Begin + " " + wtpartList;

Hi @BrianToussaint 

It is very simple. The url can not contain a space character 

you have to replace the space character with a encoding character %20

check following link https://www.w3schools.com/tags/ref_urlencode.ASP

 

PetrH

Hi @HelesicPetr 

Thank you!!!

Brian

Hi @HelesicPetr 

The strange thing is that if I don't use a custom JSP page and show the variable, it worked.  It was just in the instructions section of either the OOTB or custom JSP page.  That is why I found it strange.

Thanks again for the help!

Announcements

Top Tags