Save xspdocument with attachment runs into error - file-upload

I'm using an upload control with this code:
<xp:table>
<xp:tr>
<xp:td>
<xp:button id="buttonUpload"value="Upload"rendered="#{javascript:docApplication.isEditable();}">
<xp:eventHandler event="onclick"submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:docApplication.save()}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:td>
<xp:td>
<xp:fileUpload id="fuAttachments" value="#{docApplication.Attachments}">
</xp:fileUpload></xp:td>
</xp:tr>
</xp:table>
So all I want to do is, to upload a file to the current document and then save the document. I choose a document and as soon as I click Upload I get this error:
The translated error message:
Script interpreter error, line = 1, col = 43: [TypeError] While
calling the methode NotesXspDocument an error occurred.
NotesXspDocument(save) access to the file or to change the
NotesXspDocument is not allowed
This error only occurs on our production server, but not on our test server. If I do the exact same steps on our test server, the document is saved. But on the production server, I get this error message. So what's the problem? Any idea?

Remove the docApplication.save() and the event handler. add type="submit" (in the UI) to the button. This will trigger a full form submission and save what needs to be saved.

Related

Selenium - FileNotFound in OpenFileDialog

After clicking a button on a page, a file dialog opens up.
I wrote the following code to send keys:
Driver.SwitchTo().ActiveElement().SendKeys(
"\"Q:\\OneDrive\\Documents\\Production\\01-Intro.mp4\""
);
The file is there and the path is correct but I catch:
System.InvalidOperationException: 'invalid argument: File not found : "Q:\OneDrive\Documents\Production\01-Intro.mp4\"
Any clues on how to fix that?
You can directly send the file location to the input element which handles the upload.
driver.findElement(path to input).sendKeys(location of the file);
In your case try with one double quote:
Driver.SwitchTo().ActiveElement().SendKeys("Q:\\OneDrive\\Documents\\Production\\01-Intro.mp4");

Oracle APEX: Error: SyntaxError: Unexpected end of JSON input

I'm having an issue where I've got a button that's action is to 'submit page' upon being clicked. The code then executes a PL SQL statement:
IF :REQUEST = 'btn_create_company' THEN
INSERT INTO COMPANIES (company_name) VALUES(:COMPANY_NAME);
However, when the code comes to execute, whilst it is adding the entry to the database, I'm getting this error on the client which is preventing the page from redirecting after processing:
Error: SyntaxError: Unexpected end of JSON input
I don't understand why this is happening as I'm confident there's nothing wrong with the above statement.
Ok, so I get this problem too, It's when I submit the page but instead of reload the whole page, I'm running a process and stay there.
The process itself works well, however I get the error message, just like you.
So I don't get the a solution, but found a workaround by adding this to the end of my process:
apex_json.open_object;
apex_json.write('success', true);
apex_json.close_object;
You are missing the page number on :COMPANY_NAME. It should be something like :P1_COMPANY_NAME
I was encountering a similar error when operating the last page in a chained dialog (aka "wizard") I had created.
The cause of my issue was that I had created a branch on the "After Submit" with the Behaviour/Type attribute set to "PL/SQL Procedure" and then had the code I wanted to be executed within the PL/SQL code attribute. When the "Finish" button was clicked, I was seeing the same error.
My resolution was to delete the branch and instead to use Create Process, with the Identification/Type set to "PL/SQL Code" and then placing the code I wanted to be executed within the "Source/PL/SQL Code" attribute.

The file XXXXXXXXXXXX.xlsm has been modified by UERSNAME on [DATE] 12:25:31 +0200

I am trying to copy file from one SharePoint library and to another using custom workflow activity, after copying I am trying to update this Author and editor of file name.
Following is my code,
item["Author"] = sourceItem["Author"];
item["Editor"] = sourceItem["Editor"];
if (item.File.CheckOutType != SPFile.SPCheckOutType.None)
item.File.CheckIn("Check in");
item.UnlinkFromCopySource(); item.UpdateOverwriteVersion();
I am getting following exception to only one document . It is working fine with another document.
Exception
The file XXXXXXXXXXXX.xlsm has been modified by UERSNAME on [DATE] 12:25:31 +0200.
This message indicates that before saving your changes it has some other changes to save,and that causes a conflict and sharaepoint gives this error.
Do you put DisableEventFiring() before performing any updates ?
Thanks

log.entering / log.exiting prints org.apache.struts.util.PropertyMessageResources loadLocale

When I try to log method entering and exiting using log.entering(CLASS_NAME, METHOD_NAME); or log.exiting(CLASS_NAME, METHOD_NAME); I see console message as
PropertyMessa W org.apache.struts.util.PropertyMessageResources loadLocale Resource ../resources/ApplicationResources_en.properties Not Found.
While all other logging works perfectly. Please advice how to remove this message from console.
To remove this message from the console, in
struts-config.xml
add the code snippet as <message-resources parameter="...resources.ApplicationResources_en_US" /> with in <struts-config></struts-config>
And place the file
ApplicationResources_en_US in class path..
this message vanishes.

Error using Aspose.Email to open an embedded PDF attachment, then load into Datalogics

I am using using the Aspose.Email to get attachments out of an Outlook email like this:
var mailMessage = Aspose.Email.Mail.MailMessage.Load(stream);
var attachments = Aspose.Email.Outlook.MapiMessage.FromMailMessage(mailMessage).Attachments;
var pdfAttachment = attachments.ToList()[attachmentIndexDesired];
Then, I am loading the attachment into DataLogics like this:
var pdfStream = new MemoryStream(pdfAttachment.BinaryData);
var pdfDocument = new Datalogics.PDFL.Document(pdfStream);
Here I get the following exception:
PDF Library Error: File does not begin with '%PDF-'. Error number: 537001985
I cannot find anything on this error anywhere.
Note that the initial stream object above is a *.msg Outlook file and originates from a sharepoint SPFile. Also note that if the stream object SPFile is itself a PDF file (as opposed to an attachment to a *.msg file) I can load it into DataLogics just fine.
I know the error is being thrown by the DataLogics library, but is there something about how I am getting the attachment that could be changed/improved that would prevent this error from occurring?
Any ideas?
So just a few minutes ago I was trying to grab the BinaryData from the attachment and convert it to a string that I could read so I could visually inspect its contents. So I did this.
(new StreamReader(new MemoryStream(curAttachment.BinaryData))).ReadToEnd()
When I did that, it printed this error:
"Evaluation copy of Aspose.Email limits to extract only 3 attachments in the messages. Please contact sales#aspose.com to purchase a valid license."
Kind of strange as I am using my production license, but either way I went ahead and deleted some attachments from the parent *.msg file (it previously had 4) and tried to load it again. Then... poof... it started working.
Seems like it should throw an exception or something instead as that would have made this issue a lot easier to track down.