aXes / Longreach - other folders than longreachdata

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
Joerg Hamacher
Posts: 39
Joined: 09 Mar 2016, 00:29

aXes / Longreach - other folders than longreachdata

Post by Joerg Hamacher » 29 Apr 2020, 02:15

Hi again,

when displaying images or PDFs in aXes42 we have to use longreach.

This works fine as long as I am using IFS folders longreachdata or longreachdata_public.

Now I tried to use another IFS folder that contains special PDFs. Name of this folder is SMH_Inventurbogen, it is created directly under the root folder.


Then I changed httpd.xml like this:

LongReach
-->

<!--
Public users
-->

<parameter name="service.folder.public.get.allow" value="/longreachdata-public/other/"/>
<parameter name="service.folder.public.get.allow" value="/longreachdata-public/other/*"/>
<parameter name="service.folder.public.get.allow" value="/SMH-Inventurbogen/"/>
<parameter name="service.folder.public.get.allow" value="/SMH-Inventurbogen/*"/>

<!--
All non-public users
-->

<parameter name="service.folder.get.allow" value="/longreachdata-public/other/"/>
<parameter name="service.folder.get.allow" value="/longreachdata-public/other/*"/>
<parameter name="service.folder.public.get.allow" value="/SMH-Inventurbogen/"/>
<parameter name="service.folder.public.get.allow" value="/SMH-Inventurbogen/*"/>


Subsystems were restarted - user authorities of folder and files are completely the same as of longreachdata or longreachdata_public:

*PUBLIC *RWX X X X X
AXES *RWX X X X X
AXES_GROUP *RWX X X X X
QDIRSRV *R

But when putting this into a hyperlink or button onClick script like

var url = USERENV.createGETURL("http://192.168.0.4:8063/service/longreach.jsp" , "USER", "PASSWORD", "/SMH-Inventurbogen/", "Inventurbogen_MA1_FI00_2016-10-18_110520.PDF");
window.open(url);


the browser says:
response
type "error"
message "Path access denied: /SMH-Inventurbogen"
sversion "1.2.1"



Why? Did I forget anything?
Is it impossible to use folders other than longreachdata or longreachdata_public? How can I get access to folder SMH_Inventurbogen from inside aXes?


Many thanks in advance,
Joerg

User avatar
jeanmichel
Posts: 109
Joined: 23 May 2014, 11:37
Location: Sydney

Re: aXes / Longreach - other folders than longreachdata

Post by jeanmichel » 29 Apr 2020, 16:47

Hi Jorg,

You have 2x service.folder.public.get.allow where it should be service.folder.get.allow.
See red corrected below.

LongReach
-->

<!--
Public users
-->

<parameter name="service.folder.public.get.allow" value="/longreachdata-public/other/"/>
<parameter name="service.folder.public.get.allow" value="/longreachdata-public/other/*"/>

<!--
All non-public users
-->

<parameter name="service.folder.get.allow" value="/longreachdata-public/other/"/>
<parameter name="service.folder.get.allow" value="/longreachdata-public/other/*"/>
<parameter name="service.folder.get.allow" value="/SMH-Inventurbogen/"/>
<parameter name="service.folder.get.allow" value="/SMH-Inventurbogen/*"/>


I don't think you can use your own hand written function to get the file, as there is more than just a get happening. Also it's a POST.
I strongly recommend to use the lui-connector-min.js as in my example:
For example in a HTML page.

<script type="text/javascript" src="/ws/lui-encrypt-min.js"></script>
<script type="text/javascript" src="/ws/lui-connector-min.js"></script>

var m_host = { endpoint:"/service/longreach.jsp", profile:"jeanmichel", password:"xxx" } ;

function callback ( response, fileData )
{
blabla... }

LUICONNECTOR.getFile ( m_host, { path:"/smhbase/docs", name:"MyPDF.pdf" }, callback ) ;
Regards,

Jean-Michel Rapin

LANSA Pty Ltd
email: JeanMichel.Rapin@lansa.com.au
Address: 122 Arthur Street, North Sydney, NSW 2060, Australia
Tel: +61 289 070 262 http://www.lansa.com | http://blog.lansa.com |

Joerg Hamacher
Posts: 39
Joined: 09 Mar 2016, 00:29

Re: aXes / Longreach - other folders than longreachdata

Post by Joerg Hamacher » 29 Apr 2020, 19:11

Hi Jean-Michel,
thank you for this - 4 eyes see more than 2! Or I need new glasses ;-)

I use these scripts:

in Application onSignOn the lui-functions are defined:
if ( typeof LUICONNECTOR === "undefined" ) {
$.getScript ( USERENV.protocol + "//" + USERENV.ip + ":" + USERENV.jsmPort + "/ws/lui-connector-min.js" )
.done( console.log("lui-connector-min.js loaded.") );
}
if ( typeof LUIENCRYPT === "undefined" ) {
$.getScript ( USERENV.protocol + "//" + USERENV.ip + ":" + USERENV.jsmPort + "/ws/lui-encrypt-min.js" )
.done( console.log("lui-encrypt-min.js loaded.") );
}


... and in USERENV this is what createGETURL does:
createGETURL : function(endpoint, profile, password, path, name)
{
try
{
/*
1. Endpoint is needed to get the LongReach server nonce and RSA public key
*/


// Using synchronous mode to create the URL

var response = LUICONNECTOR.createGetFileRequest ( {profile:profile,password:password,endpoint:endpoint,cacheage:0},{path:path,name:name} ) ;

if ( response.type === "error" )
{

throw response.message ;
}

/*
2. Endpoint is needed to send the encrypted request to the LongReach server to get the file
*/

return endpoint + "?REQUEST=" + encodeURIComponent ( JSON.stringify ( response ) ) ;
}
catch ( e )
{
alert ( "createGETURL exception: " + e ) ;
}
},


This is a function we use since some years when this longreach request was integrated into aXes. Is it still okay to use this or should we change anything?

Best regards,
Joerg

User avatar
jeanmichel
Posts: 109
Joined: 23 May 2014, 11:37
Location: Sydney

Re: aXes / Longreach - other folders than longreachdata

Post by jeanmichel » 01 May 2020, 12:35

HI Jorg,

If it works then all good.
I think we have enhanced this since you implemented this and it's much more simple. All your createGETURL code can be replaced by 2 lines:


createGETURL : function(endpoint, profile, password, path, name)
{
try
{
var m_host = { endpoint:endpoint, profile:profile, password:password } ;
LUICONNECTOR.getFile ( m_host, { path:path, name:name }, callback ) ;
}
catch ( e )
{
alert ( "createGETURL exception: " + e ) ;
}
Regards,

Jean-Michel Rapin

LANSA Pty Ltd
email: JeanMichel.Rapin@lansa.com.au
Address: 122 Arthur Street, North Sydney, NSW 2060, Australia
Tel: +61 289 070 262 http://www.lansa.com | http://blog.lansa.com |

Joerg Hamacher
Posts: 39
Joined: 09 Mar 2016, 00:29

Re: aXes / Longreach - other folders than longreachdata

Post by Joerg Hamacher » 04 May 2020, 18:50

Thank you very much, Jean-Michel

I will try this and replace my old code with the new one.

Best regards,
Joerg

Post Reply