Just a side note, you can get the username and password from the HTTP
header like this...
<%
/*
* Set authUser and authPass to be equal to the supplied
* username and password
*/
String authHeader = request.getHeader("Authorization");
String authUser = null;
String authPass = null;
if (authHeader != null && authHeader.substring(0,6).equalsIgnoreCase("Basic "))
{
String decoded = com.infoengine.util.Base64.decode(authHeader.substring(6).trim());
if (decoded != null)
{
int i = decoded.indexOf(":");
if (i != -1)
{
authUser = decoded.substring(0, i);
authPass = decoded.substring(i + 1);
}
}
}
%>
As far as your question, you can also access information in the group by
creating a com.infoengine.SAK.IeService object called "ie" like this...
Then check out the javadoc for Info*Engine for the methods you can use
against it (for example, ie.getElements("group_name");). I think
there's a method to get the Mime type for the elements in the group.
Best Regards,
Bill Palm
PDC - CAD Support Group
Harley-Davidson Motor Company
Phone: 414.465.6604
Fax: 414.465.6948
William.Palm@xxxxxxxxxxxxxxxxxxx
Thank you Antonio.. I'll let you know how it turns out.
Rich Alford
Knowledge Management Office
(973) 724-5673
________________________________
Here's snippet from my document retriever. The main section is bolded
and what I am doing is getting the MIME type and setting it to the
response content type like this:
response.setContentType(data.getFormat().getDataFormat().getMimeType());
Now, you can ignore my special checks and logging but the line above
gets the mime type.
ContentHolder holder=ContentHelper.service.getContents(doc);
ApplicationData data=(ApplicationData)ContentHelper.service.getPrimary(doc);
//build server call to export content file
String path=indexerProperties.getString("outputPath");
Class[] args={ApplicationData.class,String.class};
Object[] args2={data,path};
//export file
rms.invoke("writeOutDocumentContent","customization.aerovantix.retrieve.AerovantixServerCommands", null,args,args2);
//pickup file from disk
File file;
if(Boolean.valueOf(indexerProperties.getString("nonITARMode")).booleanValue())
file=new File(indexerProperties.getString("nonITARFile"));
else
file=new File(path+File.separator+data.getFileName());
FileInputStream fin=new FileInputStream(file);
//set header
logger.debug("MIME Type:" + data.getFormat().getDataFormat().getMimeType());
if(Boolean.valueOf(indexerProperties.getString("nonITARMode")).booleanValue()){
logger.debug("Non ITAR MIME is "+indexerProperties.getString("nonITARMIME"));
response.setHeader("Content-Disposition","attachment;filename=\"NonITARFile.pdf\"");
response.setContentType(indexerProperties.getString("nonITARMIME"));
}
else {
response.setHeader("Content-Disposition","attachment;filename=\"" + data.getFileName() + "\"");
response.setContentType(data.getFormat().getDataFormat().getMimeType());
}
//write file to response
BufferedInputStream in=new BufferedInputStream(fin);
OutputStream out=response.getOutputStream();
Hi all:
I'm running a jsp file (non-xml), that retrieves a document from
PDM-LINK. I want to open this document in it's specific application in
Windows, specifically MS-Word. I perform a Get-ContentItems webject and
download the data, but it's all just streamed/dumped to the screen; Word
never opens. Please see code below.
PTC tech support claims that it works for him.. does anybody have any
idea what I can do?
Thank you,
Rich
Notes:
1) I don't have Office Integration installed since this application will
be used by non-Windchill users.
2) This is a jsp program that is outside Windchill's authorization; i.e.
strictly explicit authorization.
3) This is JSP, non-XML.
Code:
<%@ page anguage="java" session="true"%>
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<% String instance= wt.util.WTProperties.getLocalProperties().getProperty("wt.federation.ie.VMName");%>