Quantcast

[pmapper-users] Hyperlink pdf

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[pmapper-users] Hyperlink pdf

alexganfei
Hi,

I´m trying to hyperlink several pdf in pmapper.

My code is:

*MAPFILE*
METADATA
 "ows_title" "Anfibios_2014_2015_dcnfn"
 "RESULT_HYPERLINK" "link"
 "RESULT_FIELDS" "gid, especie, fonte, link"
 "LAYER_ENCODING" "UTF-8"
END #METADATA

*CUSTOM.JS*

$.extend(PM.Custom,
{
    openHyperlink: function(layer, fldName, fldValue) {
        switch(layer) {
 case 'Anfibios_2014_2015_dcnfn':

 window.open('http:/'+ '/brg_aoliveira/partilha/'+ fldValue);
                }
                break;

            default:
                alert ('See function openHyperlink in custom.js: ' + layer
+ ' - ' + fldName + ' - ' + fldValue);
        }
    },

It returns:

Not Found

The requested URL /partilha/Tese_Mestrado_Acouto.pdf was not found on this
server.

But the file is in that directory

But the file is in that directory - i´ve tried, in the browser, to put
*file://http://brg_aoliveira/partilha/Tese_Mestrado_Acouto.pdf
<http://brg_aoliveira/partilha/Tese_Mestrado_Acouto.pdf>* and it opens.


Can anyone help?

Thanks
Alex
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] Hyperlink pdf

jose mvm
Hi Alex,

try like this:

...
case 'Anfibios_2014_2015_dcnfn':
                if (fldName == 'link') {
                    var linkUrl = 'http:/' + '/yourhost/brg_aoliveira/partilha/' + fldValue;
                    //window.open(linkUrl, 'wikiquery');
                    this.openHyperlinkDialog(linkUrl);
               }
                break;
...

delete your browsing history
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] Hyperlink pdf

jose mvm
in my case it should work like this:

    openHyperlink: function(layer, fldName, fldValue) {
        switch(layer) {

case 'Anfibios_2014_2015_dcnfn':
                if (fldName == 'link') {
                    var linkUrl = 'http:/' + '/xxx.xxx.xxx.xxx/partilha/' + fldValue + '.pdf'; ;
                    //window.open(linkUrl, 'wikiquery');
                    this.openHyperlinkDialog(linkUrl);
               }
                break;

...
    // Sample how to open a link in a p.mapper dialog box
    hyperlinkDlgOptions: {width:600, height:600, resizeable:true, newsize:false, container:'pmDlgContainerHyperlink'},
   
    openHyperlinkDialog: function(linkUrl) {
        var dlg = PM.Dlg.createDnRDlg(this.hyperlinkDlgOptions, _p('Hyperlink'), false);
        var h = '<iframe width="99%" height="98%" src="' + linkUrl + '" />';
        $('#pmDlgContainerHyperlink_MSG').html(h);
    },
   
 
  /*showCategoryInfo: function(catId) {
        var catName = catId.replace(/licat_/, '');
        alert('Info about category: ' + catName);
    },

        showGroupInfo: function(groupId) {
        var groupName = groupId.replace(/ligrp_/, '');
        alert('Info about layer/group: ' + groupName);
    }
        */

});
Loading...