Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View-functionality behind the doc-icon 1

Status
Not open for further replies.

RuudBax

Technical User
Sep 6, 2003
4
NL

We've disabled the viewing functionality from all of our office-documents by configuring this in the opentext.ini file.
However I would like to give advanced users the ability to use this feature anyway by changing the functionality of the document-icon that's shown before the document-name in a Livelink-page.
Can anyone tell me how to accomplish this ? What oscript-code should I use ?
 
The Ospace is
Code:
WEBDOC:DocNodeCmd
and you should see the View and ViewDoc as a WebNodeCmd object.By default the .fPerms=$PSeeContents which is equivalent to the object permission to the selected user as SeeContents.If you change that to $PModify then the request is checked very throroughly against the permissions mask laid out in dtreeacl table.I do suggest you adhere to proper module building conventions as laid out by OT.Take my advice only as a guide line

However out of curiosity I want to ask why you cannot set the permissions model of your objects (folders,docs etc).If you do not give
Code:
'see'
permissions to a user and not
Code:
 'seecontents' [code]then wouldn't the object  appear but not clickable for the not-so-privileged user against the privileged user.

[i]We know nothing at all. All our knowledge is but the knowledge 
of school children. The real nature of things we shall never know.
	- Albert Einstein[/i]
 
Apparently we've got a misunderstanding. I'm not talking about permissions but I'm talking about the html-conversion.
Because Livelink is the basis for our intranet we know i.e. that all users use the same Office applications. Therefor we've chosen to disable the html-conversion when clicking the name of a document.
However, in some case it's very useful to have this functionality available. I've heard that more customers have put the html-conversion functionality behind the document icon; but who and how !?. Advanced users can then still use the viewing feature.
 
A particularly useful article for me as I was just trying to understand why in my old company we could click on the icon and get the HTML rendition and yet in my new one the functionality is the same wherever you click. Can you explain what OT ini setting needs to be changed to affect all to save me a little time and let the other users know ?
 
This is still not the answer to the question but this is in reply tp oscript's need

By default the hyperlink as well as the icons are set to do a This is basically a setting of the ViewableMimeTypes in your opentext.ini
If you want to change that to all documents to invoke the 'Fetch'do this

go to the line in your opentext.ini and under

[ViewableMimeTypes]

add a new line for the type of document,Say you want to suppress HTML viewing of MS-WORD documents.You will have to add a new line after the last line like.Make sure you add one plus the last existing line as I 'm sure that somebody is converting that to a List and may help them index the array.

MimeType_10=image/pjpeg
MimeType_11=application/msword
MimeType_12=application/MSWORD


Capitalizing MSWORD is strictly not needed but
I have seen sometimes it works.

After you have restarted your server the links will
change to

Now as you can see the default behaviour has been changed to doc.Fetch

The additional stuff that you put in should be defined in your mime.types file for the whole thing to work

True knowledge exists in knowing that you know nothing.
And in knowing that you know nothing, that makes you the
smartest of all.
- Socrates
 
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=&quot;1%&quot;>`%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,&quot;Fetch&quot;,&quot;ViewDoc&quot;)
;else
;switchViewer=open.DisabledUnescapedLink( prgCtx, request, nodeRec, webNode.IMG( nodeRec), Undefined, data.NextURL )
;switchToView=switchViewer
;end
<TD NOWRAP WIDTH=&quot;1%&quot;>`%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






 
looks like an interesting solution, have yourself a star ;-)
 
Thanks for the reply; I was already on the same route but I've done it a little different. It's more static/hard coded but the problem you're referring to with the fetch in the document-name isn't an issue this way.

;if nodeRec.subtype == 144
;String livelinkURL = 'livelink.exe?func=doc.ViewDoc&nodeId=' + Str.ValueToString(nodeRec.dataid)
`%LStr.Format( '<A HREF=&quot;%1&quot;>', livelinkURL)`
`%LwebNode.IMG( nodeRec )`</a>
;else
`%Lopen.DisabledUnescapedLink( prgCtx, request, nodeRec, webNode.IMG( nodeRec ) )`
;end

It also doesn't only apply to the browseview.html page. There are several more pages where I have to add this code, i.e. browsecatalogs.html, browseproject.html, cdview.html, viewnews.html.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top