Hi RuudBax
After pondering over several options and not wanting to do any OScript modification on the core code I have a not too difficult proposition.When the [ViewableMimeTypes] have been modified the llserver changes the links to doc.Fetch even though the actual command handlers viewdoc is enabled.You can verify that by doing a 'View' from the function menu and you will see that the document command still as 'Fetch'.So all said and done this anchor has to change to doc.ViewDoc for the viewer to launch
Affected Templates
[red]<your opentext root>\module\webnode_2_2_0\html\browseview.html[/red]
Make a backup of browseview.html
Open browseview.html in your favorite editor
add these lines after the last variable declaration
//fetch to viewvariables
;String switchToView,switchViewer
Find this line.This is the line of HTML/OScript
code that gives you the icon and the anchor href
[red] <TD NOWRAP WIDTH="1%">`%Lopen.DisabledUnescapedLink( prgCtx, request, nodeRec, webNode.IMG( nodeRec ), Undefined, data.NextURL )`</TD>[/red]/
Apply an HTML comment to the above and add these modified lines.As you can see what I am doing is replacing the occurrences of 'Fetch' with ViewDoc.One caveat would be if your URL contains fetch it could be replaced also.You may improve upon this by parsing the func= part of URL and make it more production worthy
The conditional If statement does this only
if it is a document subtype.You will have to handle this for
other types separately
[red];if $ApplTypeDocument in webNode.ApplTypes()
;switchViewer=open.DisabledUnescapedLink( prgCtx, request, nodeRec, webNode.IMG( nodeRec), Undefined, data.NextURL )
;switchToView=Str.Replace(switchviewer,"Fetch","ViewDoc"
;else
;switchViewer=open.DisabledUnescapedLink( prgCtx, request, nodeRec, webNode.IMG( nodeRec), Undefined, data.NextURL )
;switchToView=switchViewer
;end
<TD NOWRAP WIDTH="1%">`%LswitchToView`</TD>[/red]
Once you re-start your server.you will see that the document link will do a Fetch wheras the image link will do a viewDoc.
If the code looks undecipherable you can write to me at
kn_nair@ssa-sa.sel.sony.com or if you think this is a worthwhile post I will send it to the greg griffith's site
We have a hunger of the mind which asks for knowledge of all
around us, and the more we gain, the more is our desire,
the more we see, the more we are capable of seeing.
- Maria Mitchell