client side javascript in lotus notes client not working - xpages

I am working on xpages project which I want to run in notes client browser not in the any othe browser because this application is not server based application , This application is kind of desktop applicationn with extension .nsf and can be run on notes clients.
In the first case I thoought it needs to hosted on server and then CSJS will work but it wont work that way also.
a simple alert("Hello World"); throws the error, 'An error occurred while updating some of the page. Not enough arguments [insIDE Window.alert] notes'
Is there any specific settings which I am missing in the applcation ?
I have tried the same in notes 10 , notes 9 , but the result is same.
Even partial refreshes workimg not expectedly .

Related

Prevent showing the UI5 app internal page without successful authentication

OpenUI5 version: 1.86
Browser/version (+device/version): Chrome Dev
Upon the authentication I validate the user session:
if (isUserSessionValid) {
const oRouter = UIComponent.getRouterFor(this);
oRouter.navTo("overview");
} else {
this.getOwnerComponent().openAuthDialog();
}
If isUserSessionValid is true, then I forward an user to the internal page, otherwise I show the login dialog.
The problem is, however, that an user can change the value of isUserSessionValid in DevTools and then getting forwarded to the UI5 app internal page. Of course, due to a lack of a valid session, no piece of the business data will be displayed, just an empty UI5 app template, but I would like to prevent even such screen.
If it would be a classical webapp, I would just send an appropriate server response with a redirect to the login page (e.g. res.redirect(403, "/login");). But, if I understand it correctly, since I'm sending am asynchronous request, a plain res.redirect won't work out and I'm required to implement a redirection logic on the UI5-client, which can be manipulated and bypassed by user.
How to prevent a manipulation of a view navigation in UI5 and ensure that unauthorized user can't get any piece of the UI5-app code?
The answer from SAP:
If you want to prevent an unauthorized user from accessing the client-side code (e.g. view/controller) you need to enforce
authorization on the server also for those static files. When bundling
the application code you also need to ensure that those files are
separate from the "public" files. One approach would be to have 2
separate components, one for the public page/auth dialog and one for
the actual application.

Intermittent behavior in xpages application: by pressing the button to save, the document is not redirected and is displayed again

I'm having a problem with a new xpages application that was deployed in production for a few months, but has now only been expanded to the entire enterprise now. The problem that did not happen while the application was in production pilot is intermittent and happens when an action executes a current notesxsppdocument save (currentdocument). The symptom is that by pressing the button you save, the document is not redirected and is displayed again. What can be this problem. session timeout, a bug from xpages? The application basically uses the components of the extension library, there is no external component to the xpages. When the problem occurs, if the user closes the document's xpages opens again and then clicks the button again the code runs successfully.
I have a function that stores a file attached to the doc in a repository. I suspect she's the problem. The function uses the file upload component and a button to execute a java agent that stores the file in a repository. The button code below follows. Its function is basically to create the rich text if it does not exist and call the agent that consumes a web service to transfer the file to a repository and erase it from the document.
I asked the user not to use the function for a few days at the time of the service to verify that the problem will persist.
if(validaArquivo())
{
var url=#ReplaceSubstring(context.getUrl(),"openDocument","editDocument")
url += '&tab=dossie' ;
var fieldItem:NotesItem =
currentDocument.getDocument().getFirstItem("arquivos");
if (fieldItem==null){
// create the field as an RTF
//writeToLog("Creating xxxxx field");
var rtItem:NotesRichTextItem =
currentDocument.getDocument().createRichTextItem("arquivos");
currentDocument.save();
}else if (fieldItem.getType()==1280){
//writeToLog("--> Converting xxxxx to RTF");
currentDocument.replaceItemValue("arquivosTEXT",
fieldItem.getText());
fieldItem.remove();
var rtItem:NotesRichTextItem =
currentDocument.getDocument().createRichTextItem("arquivos");
currentDocument.save();
}
var agente:NotesAgent=database.getAgent("(SalvaAnexos)");
agente.runWithDocumentContext(currentDocument.getDocument(true));
context.redirectToPage(url)
}
else
{
document1.removeAllAttachments("arquivos");
}
When users are using the application, rebuild or to change some code on prod environment can cause this.

How do i do a Contact form hosted in an Azure app using Mailgun?

I finally got my html website working in an Azure App.
Now I want to add a Contact Form.
I have done a simple HTML form that calls the MailGun API but nothing happens when I click submit.
There are no errors showing in the browser.
I followed the instructions here to create the form.
It turned out that I had incorrect settings in
$api_key = 'INSERT_API_KEY_HERE';
$api_domain = 'INSERT_DOMAIN_HERE';
$send_to = 'YOUR_EMAIL';
This became apparent after displaying the error from the Ajax call.
As explained here

display sharepoint app in outlook 2013 and owa

I have created an SharePoint- hosted app and using office API’s within the start page. The app is added in exchange and enter image description hereapp web links are referred in appmanifest.xml.
1) On click of link, page renders as expected in OWA every time except for 1st time, following error occurs .
"App Error Something went wrong and we couldn't start this app. Please
try again later or contact your system administrator." console log
shows:“Uncaught Sys.ArgumentNullException: Sys.ArgumentNullException:
Value cannot be null.Parameter name: conversationId “ in
outlook-web-16.00.js:
It works as expected in subsequent calls.
2) The app doesn’t load in outlook client. Following error occurs in Microsoft Office Alerts :
App Error This app could not be started. Close this dialog to ignore
the problem or click "Restart" to try again. P1: Apps for Office P2:
15.0.4719.1001 P3: 0x80010105 P4: following is displayed in fiddler: X-MSDAVEXT_Error: 917656; HTTP/1.1 401 Unauthorized ........ ..
Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
.....
All suggestions are highly appreciated.
This issue appears when we debug outlook apps in debug mode and the app exceeded the allotted time to load required office 365 js files into your app.
One thing i am doing to avoid this issue, in the browser you are using to authenticate using o365 account, check the box to login automatically to save time and load client js files faster post authentication step.

Invoking Browser via application Icon Like Youtube Application Without Showing My Application

i want to invoke browser with a specific url like youtube application. I've try using Navigator Invoke but, its show my application. i dont want to show my application just show browser when user click the application icon, can anybody help me please ..
Put this into your main() in main.cpp
QDesktopServices::openUrl(QUrl("http://example.com",QUrl::TolerantMode));
But you MUST remove (comment) the following lines:
new ApplicationUI(&app);
return Application::exec();
Otherwise application will open anyway

Resources