0
votes

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");
}
1
Provide a code snippet. A save doesn’t redirect without additional code. Also add an errors control to the page to show if anything pops upstwissel
This may not address your immediate problem but can I suggest that you look at @MarkLeusink's answer to this question stackoverflow.com/questions/17073250/… which shows how to have a bean manage a file upload directly and may remove the need to a) do any tricky Rich Text field manipulation and b) remove the need for calling the Java Agent. It can also then be used to manage the saving of the document and, if necessary, the redirection of the page.TrailDragon

1 Answers

0
votes

When users are using the application, rebuild or to change some code on prod environment can cause this.