In Valence 4.1 I wrote a spool file viewer that shows only a users spool files for viewing, converting to PDF, TXT or deleting etc.etc. I used the vvsysutil program in valence for the viewing. It is requiring that the user have *SPLCTL authority, I can't give this to the users. Can it check to see if the user has authority to just the one spool file only ? Below is the code for the view. This code is from your spool file viewer except the highlighting using a search field. Thanks Jim Malugin and also thanks for the enhancements we requested in Valence42.
onFileGridItemDblClick: function(dataview, record, item, index, e, eOpts) {
var me = this;
var myField = Ext.ComponentQuery.query('#highLightText')[0];
var search = myField.getValue();
var htmlhigh = ' ';
Ext.Ajax.request({
url: '/valence/vvcall.pgm',
params: {
pgm: 'vvsysutil',
action: 'actOnSpoolFile',
act: 'VIEW',
textfile: true,
splnum: record.get('SFFNBR'),
splname: record.get('SFFILE'),
jobname: record.get('SFJNAM'),
jobnumber: record.get('SFJNBR'),
jobuser: record.get('SFUSER')
},
scope: me,
success: function(response) {
var html = response.responseText.replace(/ /g, " ").replace(/\n/g,"<br>"); // add line feeds compress out spaces
if (search.length > 0){
htmlhigh = html.replace((new RegExp('('+search+')', 'gi')), '<span class="highlight">$1</span>');
} else {
htmlhigh = html;
}
Ext.widget('spoolfileview',{
rec : record,
title : record.get('SFFILE'),
html : htmlhigh,
}).show();
}
});
onFileGridItemDblClick: function(dataview, record, item, index, e, eOpts) {
var me = this;
var myField = Ext.ComponentQuery.query('#highLightText')[0];
var search = myField.getValue();
var htmlhigh = ' ';
Ext.Ajax.request({
url: '/valence/vvcall.pgm',
params: {
pgm: 'vvsysutil',
action: 'actOnSpoolFile',
act: 'VIEW',
textfile: true,
splnum: record.get('SFFNBR'),
splname: record.get('SFFILE'),
jobname: record.get('SFJNAM'),
jobnumber: record.get('SFJNBR'),
jobuser: record.get('SFUSER')
},
scope: me,
success: function(response) {
var html = response.responseText.replace(/ /g, " ").replace(/\n/g,"<br>"); // add line feeds compress out spaces
if (search.length > 0){
htmlhigh = html.replace((new RegExp('('+search+')', 'gi')), '<span class="highlight">$1</span>');
} else {
htmlhigh = html;
}
Ext.widget('spoolfileview',{
rec : record,
title : record.get('SFFILE'),
html : htmlhigh,
}).show();
}
});
Comment