Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
FormAPI download/upload
System
I am trying to allow a file to be downloaded for edit, then uploaded after edit, through a DCT. It seems to work in some cases, but it always opens the document twice - once in word and once in the browser. Is there any way to avoid this? I would prefer to avoid a CGI callout if I can get by without it. Any suggestions?
<container name="Word" combination="and" hide-name="t">
<item name="Download" colspan="4">
<label></label>
<text>
<cgi-callout label="Download" />
<default>-</default>
</text>
</item>
<item name="Upload">
<label></label>
<text>
<cgi-callout label="Upload" />
<default>-</default>
</text>
</item>
</container>
<script><![CDATA[
function download()
{
var parameters = new Object();
parameters.vpath = getDocument();
IWDatacapture.callServer( "/iw/webdesk/edit", parameters, true );
}
function upload()
{
var parameters = new Object();
parameters.vpath = getDocument();
IWDatacapture.callServer( "/iw/webdesk/upload", parameters, true );
}
IWEventRegistry.addItemHandler( "/Word/Download", "onCallout", download );
IWEventRegistry.addItemHandler( "/Word/Upload", "onCallout", upload );
IWDatacapture.getItem( "/Word/Download" ).setValue( "-" );
IWDatacapture.getItem( "/Word/Upload" ).setValue( "-" );
IWDatacapture.getItem( "/Word/Download" ).setReadOnly( true );
IWDatacapture.getItem( "/Word/Upload" ).setReadOnly( true );
]]></script>
Find more posts tagged with
Comments
Migrateduser
Maybe this is a little better, but it still is very confusing (CCI links seem buggy) with all of the extra windows, security dialogs, and opening the doc in a browser instead of word (especially strange on upload).
function edit()
{
var document = getDocument();
var handle = window.open( '', 'manage', 'width=100,height=100,resizable=true,scrollbars=auto' );
handle.document.write( "<html><head><title>" + getFile() + "</title></head><center>" );
handle.document.write( "<a target='download' href='/iw/webdesk/edit?vpath=" + document + "'>Edit</a>" );
handle.document.write( "<br />" );
handle.document.write( "<a target='upload' href='/iw/webdesk/upload?vpath=" + document + "'>Upload</a>" );
handle.document.write( "<br />" );
handle.document.write( "<a href='javascript:window.close();'>Close</a>" );
handle.document.write( "</center></body></html>" );
}
IWEventRegistry.addItemHandler( "/Word/Manage", "onCallout", edit );
IWDatacapture.getItem( "/Word/Manage" ).setValue( getFile());
IWDatacapture.getItem( "/Word/Manage" ).setReadOnly( true );