[xwiki-users] Configuring Open Office server
Hi, I try to configuring Open Office server. I'm not sure of the parameters so I made some changes to test, but I have a very strange "bug". I explain : I changed the data once in xwiki.properties, but since, even if I put some new parameters in xwiki.properties, when I'm connecting in Xwiki on the OfficeImporterAdmin page, the data seems to be the same of the first time... For exemple, I tested by writing this : # openoffice.homePath=E:\Program Files (x86)\OpenOffice.org 3\ # openoffice.profilePath=E:\Users\bet\AppData\Roaming\OpenOffice.org\3 And I still see this : Server path C:Program FilesOpenOffice.org 3 Server profile D:UsersbetAppDataRoamingOpenOffice.org3 and I can see the same problem in the log (it's not a refreshing display problem) (furthermore, sometimes I have the message "Error while connecting / starting openoffice." and sometimes "Inadequate privileges."....) Thanks Regards Ben -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 05/07/2010 10:38 AM, Ben Stuggler wrote:
Hi,
I try to configuring Open Office server. I'm not sure of the parameters so I made some changes to test, but I have a very strange "bug". I explain : I changed the data once in xwiki.properties, but since, even if I put some new parameters in xwiki.properties, when I'm connecting in Xwiki on the OfficeImporterAdmin page, the data seems to be the same of the first time... For exemple, I tested by writing this : # openoffice.homePath=E:\Program Files (x86)\OpenOffice.org 3\ # openoffice.profilePath=E:\Users\bet\AppData\Roaming\OpenOffice.org\3
And I still see this : Server path C:Program FilesOpenOffice.org 3 Server profile D:UsersbetAppDataRoamingOpenOffice.org3
and I can see the same problem in the log (it's not a refreshing display problem)
(furthermore, sometimes I have the message "Error while connecting / starting openoffice." and sometimes "Inadequate privileges."....)
Thanks
Regards
Ben
Did you restart the container? xwiki.properties is not automatically reloaded each time you change it, it's read only once when starting up. -- Sergiu Dumitriu http://purl.org/net/sergiu/
The container ? I stopped and started the xwiki server if it's what you mean. -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
Very strange, because I see on the OfficeImporterAdmin page : Server path C:Program FilesOpenOffice.org 3 Server profile D:UsersbetAppDataRoamingOpenOffice.org3 I copied the Open office file from "C:\Program Files (x86)\OpenOffice.org 3\" to "C:\Program Files\OpenOffice.org 3\" and I successfully start the server (I have access to the "create a page from office document" page, I didn't test it yet). I tried to stop or restart the server, and I had "Inadequate privileges." I just killed the open office Processus and I tried to start again the server and it's don't work anymore, I have "Inadequate privileges.". I really don't understand what's the matter.. -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, On 5/7/2010 12:32 PM, Ben Stuggler wrote:
Very strange, because I see on the OfficeImporterAdmin page : Server path C:Program FilesOpenOffice.org 3 Server profile D:UsersbetAppDataRoamingOpenOffice.org3
I copied the Open office file from "C:\Program Files (x86)\OpenOffice.org 3\" to "C:\Program Files\OpenOffice.org 3\" and I successfully start the server (I have access to the "create a page from office document" page, I didn't test it yet).
I tried to stop or restart the server, and I had "Inadequate privileges."
You need to resave XWiki.OfficeImporterAdmin with a account having programming rights. This is a known issue, the programming rights requirement will be replaced with admin rights in the future. Setting the open office server to auto-start could also avoid this.
I just killed the open office Processus and I tried to start again the server and it's don't work anymore, I have "Inadequate privileges.".
I really don't understand what's the matter..
When you get the second error message, please check your log files(xwiki.log, stdout) and search for a "file is used by another process" message. If you have this error message thrown by office importer then you need to kill the open office process and delete the parent folder of the file specified in the logs. You should be able to connect and successfully import documents after that. Florin Ciubotaru
Ben Stuggler wrote:
Hi,
I try to configuring Open Office server. I'm not sure of the parameters so I made some changes to test, but I have a very strange "bug". I explain : I changed the data once in xwiki.properties, but since, even if I put some new parameters in xwiki.properties, when I'm connecting in Xwiki on the OfficeImporterAdmin page, the data seems to be the same of the first time... For exemple, I tested by writing this :
# openoffice.homePath=E:\Program Files (x86)\OpenOffice.org 3\ # openoffice.profilePath=E:\Users\bet\AppData\Roaming\OpenOffice.org\3
Did you uncomment these two lines (i.e. remove the #)? Hope this helps, Marius
And I still see this : Server path C:Program FilesOpenOffice.org 3 Server profile D:UsersbetAppDataRoamingOpenOffice.org3
and I can see the same problem in the log (it's not a refreshing display problem)
(furthermore, sometimes I have the message "Error while connecting / starting openoffice." and sometimes "Inadequate privileges."....)
Thanks
Regards
Ben
Thanks you two for your help both. So with your advises, I went to "Document Index" and go on "OfficeImporterAdmin" (to play with edit etc...) and suprise, I can start the server without change anything. But I still can't if I go on the page using "Administrate XWiki" and select "OpenOffice Server".. Very strange! But it's "working"... Now, new problem, when I try to import a document using OO, I have this result : "Error while converting document [D:\Users\bet\Desktop\test.doc] into html" :'( -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 5/7/2010 3:29 PM, Ben Stuggler wrote:
Thanks you two for your help both. So with your advises, I went to "Document Index" and go on "OfficeImporterAdmin" (to play with edit etc...) and suprise, I can start the server without change anything. But I still can't if I go on the page using "Administrate XWiki" and select "OpenOffice Server".. Very strange! But it's "working"...
Now, new problem, when I try to import a document using OO, I have this result : "Error while converting document [D:\Users\bet\Desktop\test.doc] into html" :'(
Can you check the logs? This error message is too generic. Florin Ciubotaru
Ok, so I took all the errors I could find : 2010-05-07 14:53:32,921 [http://localhost:8080/xwiki/bin/view/XWiki/OfficeImporter?&parent=XWiki.Offi...] ERROR internal.DefaultVelocityEngine - Left side ($docextras.size()) of '>' operation has null value at <unknown template>[line 66, column 24] 2010-05-07 14:53:32,922 [http://localhost:8080/xwiki/bin/view/XWiki/OfficeImporter?&parent=XWiki.Offi...] ERROR internal.DefaultVelocityEngine - Left side ($docextras.size()) of '>' operation has null value at <unknown template>[line 74, column 24] 2010-05-07 14:53:58,307 [http://localhost:8080/xwiki/bin/view/XWiki/OfficeImporterResults] ERROR rterVelocityContextInitializer - Error while converting document [D:\Users\bet\Desktop\test.doc] into html. org.xwiki.officeimporter.OfficeImporterException: Error while converting document [D:\Users\bet\Desktop\test.doc] into html. [.....] Caused by: org.xwiki.officeimporter.openoffice.OpenOfficeConverterException: Error while performing conversion. at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:119) at org.xwiki.officeimporter.internal.builder.DefaultXHTMLOfficeDocumentBuilder.build(DefaultXHTMLOfficeDocumentBuilder.java:87) ... 115 more Caused by: java.io.FileNotFoundException: C:\Program Files (x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\fcff1e5d-5db9-4c7c-86f3-aa40068177e9\input\D:\Users\bet\Desktop\test.doc (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(Unknown Source) at java.io.FileOutputStream.<init>(Unknown Source) at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:95) ... 116 more 2010-05-07 14:53:58,396 [http://localhost:8080/xwiki/bin/view/XWiki/OfficeImporterResults] ERROR internal.DefaultVelocityEngine - Left side ($docextras.size()) of '>' operation has null value at <unknown template>[line 66, column 24] 2010-05-07 14:53:58,397 [http://localhost:8080/xwiki/bin/view/XWiki/OfficeImporterResults] ERROR internal.DefaultVelocityEngine - Left side ($docextras.size()) of '>' operation has null value at <unknown template>[line 74, column 24] 2010-05-07 14:54:06,309 [Shutdown] INFO ffice.DefaultOpenOfficeManager - Open Office instance stopped. -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, Caused by: java.io.FileNotFoundException: C:\Program Files
(x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\fcff1e5d-5db9-4c7c-86f3-aa40068177e9\input\D:\Users\bet\Desktop\test.doc
This error was reported by one other user too, unfortunately I could not reproduce it. The wired thing is how input path (D:\Users\bet\Desktop\test.doc) got transferred to server side. I suspect that commons file upload (xwiki file upload plugin) have an issue where getFileName() function returns file path instead of file name, however as i said i could not reproduce this. Following is the code i use for extracting the name of the uploaded file (for devs to check): <code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code> "filePath" above refers to the file upload input box's name attribute (html). @Ben: Can you try deleting all the contents of "C:\Program Files(x86)\XWiki\jetty\work\" directory and redo the import? Many thanks for reporting and debugging this issue :) - Asiri
Ben, On 5/7/2010 4:28 PM, Asiri Rathnayake wrote:
Hi,
Caused by: java.io.FileNotFoundException: C:\Program Files
(x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\fcff1e5d-5db9-4c7c-86f3-aa40068177e9\input\D:\Users\bet\Desktop\test.doc
Are you using Internet Explorer? Me and Asiri have seen this before, but we are unable to reproduce the issue.
This error was reported by one other user too, unfortunately I could not reproduce it. The wired thing is how input path (D:\Users\bet\Desktop\test.doc)
The import works fine on my side on IE, but the suggested path is 'C-\fakepath\test' :) Ben, could you try another browser? Florin Ciubotaru
got transferred to server side. I suspect that commons file upload (xwiki file upload plugin) have an issue where getFileName() function returns file path instead of file name, however as i said i could not reproduce this.
Following is the code i use for extracting the name of the uploaded file (for devs to check):
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
"filePath" above refers to the file upload input box's name attribute (html).
@Ben: Can you try deleting all the contents of "C:\Program Files(x86)\XWiki\jetty\work\" directory and redo the import?
Many thanks for reporting and debugging this issue :)
- Asiri _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thanks again for your help I deleted the contents of "C:\Program Files(x86)\XWiki\jetty\work\" It doens't solve the problem. BUT indeed, I was with IE and it's working with Firefox. For the following code, I didn't understand where I can test it... I would like to solve this problem with IE... <code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code> Florin Ciubotaru wrote:
Ben,
On 5/7/2010 4:28 PM, Asiri Rathnayake wrote:
Hi,
Caused by: java.io.FileNotFoundException: C:\Program Files
(x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\fcff1e5d-5db9-4c7c-86f3-aa40068177e9\input\D:\Users\bet\Desktop\test.doc
Are you using Internet Explorer? Me and Asiri have seen this before, but we are unable to reproduce the issue.
This error was reported by one other user too, unfortunately I could not reproduce it. The wired thing is how input path (D:\Users\bet\Desktop\test.doc)
The import works fine on my side on IE, but the suggested path is 'C-\fakepath\test' :) Ben, could you try another browser?
Florin Ciubotaru
- Hide quoted text -
got transferred to server side. I suspect that commons file upload (xwiki file upload plugin) have an issue where getFileName() function returns file path instead of file name, however as i said i could not reproduce this.
Following is the code i use for extracting the name of the uploaded file (for devs to check):
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
"filePath" above refers to the file upload input box's name attribute (html).
@Ben: Can you try deleting all the contents of "C:\Program Files(x86)\XWiki\jetty\work\" directory and redo the import?
Many thanks for reporting and debugging this issue :)
- Asiri _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 5/7/2010 5:26 PM, Ben Stuggler wrote:
Thanks again for your help
I deleted the contents of "C:\Program Files(x86)\XWiki\jetty\work\" It doens't solve the problem.
BUT indeed, I was with IE and it's working with Firefox.
Great. Could you create a issue for this on jira.xwiki.org? If IE is mandatory in your organization, this will allow you to better track the progress. The code below was for the xwiki developers. Florin Ciubotaru
For the following code, I didn't understand where I can test it... I would like to solve this problem with IE...
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
Florin Ciubotaru wrote:
Ben,
On 5/7/2010 4:28 PM, Asiri Rathnayake wrote:
Hi,
Caused by: java.io.FileNotFoundException: C:\Program Files
(x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\fcff1e5d-5db9-4c7c-86f3-aa40068177e9\input\D:\Users\bet\Desktop\test.doc
Are you using Internet Explorer? Me and Asiri have seen this before, but we are unable to reproduce the issue.
This error was reported by one other user too, unfortunately I could not reproduce it. The wired thing is how input path (D:\Users\bet\Desktop\test.doc)
The import works fine on my side on IE, but the suggested path is 'C-\fakepath\test' :) Ben, could you try another browser?
Florin Ciubotaru
- Hide quoted text -
got transferred to server side. I suspect that commons file upload (xwiki file upload plugin) have an issue where getFileName() function returns file path instead of file name, however as i said i could not reproduce this.
Following is the code i use for extracting the name of the uploaded file (for devs to check):
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
"filePath" above refers to the file upload input box's name attribute (html).
@Ben: Can you try deleting all the contents of "C:\Program Files(x86)\XWiki\jetty\work\" directory and redo the import?
Many thanks for reporting and debugging this issue :)
- Asiri _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi Ben, On Fri, May 7, 2010 at 7:56 PM, Ben Stuggler <[email protected]>wrote:
Thanks again for your help
I deleted the contents of "C:\Program Files(x86)\XWiki\jetty\work\" It doens't solve the problem.
BUT indeed, I was with IE and it's working with Firefox.
For the following code, I didn't understand where I can test it... I would like to solve this problem with IE...
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
This code is in XWiki/OfficeImporterResults page. Now, I'm not sure if you are familiar with velocity scripting, but if you are, you can try printing the variable $fileName just after the #set($fileName=...) line. The code should look like: <code> #set($fileUpload=$xwiki. fileupload) #set($fileName=$fileUpload.getFileName("filePath")) File name is: $fileName #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code> After this change, try importing the same document from IE as well as firefox and let us know the value of $fileName variable in both cases (just after officeimport operation you should see the result of above code). Thanks. - Asiri
Florin Ciubotaru wrote:
Ben,
On 5/7/2010 4:28 PM, Asiri Rathnayake wrote:
Hi,
Caused by: java.io.FileNotFoundException: C:\Program Files
(x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\fcff1e5d-5db9-4c7c-86f3-aa40068177e9\input\D:\Users\bet\Desktop\test.doc
Are you using Internet Explorer? Me and Asiri have seen this before, but we are unable to reproduce the issue.
This error was reported by one other user too, unfortunately I could not reproduce it. The wired thing is how input path (D:\Users\bet\Desktop\test.doc)
The import works fine on my side on IE, but the suggested path is 'C-\fakepath\test' :) Ben, could you try another browser?
Florin Ciubotaru
- Hide quoted text -
got transferred to server side. I suspect that commons file upload (xwiki file upload plugin) have an issue where getFileName() function returns file path instead of file name, however as i said i could not reproduce this.
Following is the code i use for extracting the name of the uploaded file (for devs to check):
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
"filePath" above refers to the file upload input box's name attribute (html).
@Ben: Can you try deleting all the contents of "C:\Program Files(x86)\XWiki\jetty\work\" directory and redo the import?
Many thanks for reporting and debugging this issue :)
- Asiri _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi Ben, For the following code, I didn't understand where I can test it... I would
like to solve this problem with IE...
Since you did not respond to my last email, I'll blindly propose a solution that might fix the problem you are experiencing on IE. 1. Open up XWiki/OfficeImporterResults wiki page and go to wiki editing mode, you should see the following code snippet at the top of the page:
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
Now you need add two code lines (wait for it) just under the line: #set($fileName=$fileUpload.getFileName("filePath")) New code lines to be added are: #set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex)) So, at the end your code snippet should look like: #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex)) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end I'm not 100% sure if this will solve the problem (since I did not get a response for my last email). If above code fixes your problem, please let us know. Thanks. - Asiri
Hi Asiri, Thanks a lot for continuing help. I read your messages this morning and I tested it. I tested as you said File name is: $fileName And I obtained : "File name is: D:\Users\bet\Desktop\test.doc" So it's seem alright I deleted the file in Jetty and I inserted the two lines : #set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex)) Same result ? : "File name is: D:\Users\bet\Desktop\test.doc" The creation doesn't work (same message "Error while converting document [D:\Users\bet\Desktop\test.doc] into html.") In xwiki.log, I have this Caused by: org.xwiki.officeimporter.openoffice.OpenOfficeConverterException: Error while performing conversion. at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:119) at org.xwiki.officeimporter.internal.builder.DefaultXHTMLOfficeDocumentBuilder.build(DefaultXHTMLOfficeDocumentBuilder.java:87) ... 115 more Caused by: java.io.FileNotFoundException: C:\Program Files (x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\9831763c-5f81-4242-b113-9b5a7a2b4954\input\D:\Users\xab\Desktop\test.doc (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(Unknown Source) at java.io.FileOutputStream.<init>(Unknown Source) at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:95) Asiri Rathnayake wrote:
Hi Ben,
For the following code, I didn't understand where I can test it... I would
like to solve this problem with IE...
Since you did not respond to my last email, I'll blindly propose a solution that might fix the problem you are experiencing on IE.
1. Open up XWiki/OfficeImporterResults wiki page and go to wiki editing mode, you should see the following code snippet at the top of the page:
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
Now you need add two code lines (wait for it) just under the line:
#set($fileName=$fileUpload.getFileName("filePath"))
New code lines to be added are:
#set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex))
So, at the end your code snippet should look like:
#set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex)) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end
I'm not 100% sure if this will solve the problem (since I did not get a response for my last email). If above code fixes your problem, please let us know.
Thanks.
- Asiri _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Ben, On 5/10/2010 11:52 AM, Ben Stuggler wrote:
Hi Asiri,
Thanks a lot for continuing help. I read your messages this morning and I tested it.
I tested as you said File name is: $fileName
And I obtained : "File name is: D:\Users\bet\Desktop\test.doc" So it's seem alright
Actually this is not right. It should be just "test.doc". You need to use Asiri's last code snipped in order to trim it. Florin Ciubotaru
I deleted the file in Jetty and I inserted the two lines : #set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex))
Same result ? : "File name is: D:\Users\bet\Desktop\test.doc"
The creation doesn't work (same message "Error while converting document [D:\Users\bet\Desktop\test.doc] into html.")
In xwiki.log, I have this
Caused by: org.xwiki.officeimporter.openoffice.OpenOfficeConverterException: Error while performing conversion. at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:119) at org.xwiki.officeimporter.internal.builder.DefaultXHTMLOfficeDocumentBuilder.build(DefaultXHTMLOfficeDocumentBuilder.java:87) ... 115 more Caused by: java.io.FileNotFoundException: C:\Program Files (x86)\XWiki\jetty\work\Jetty_0_0_0_0_8080_xwiki__xwiki__5alevh\9831763c-5f81-4242-b113-9b5a7a2b4954\input\D:\Users\xab\Desktop\test.doc (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(Unknown Source) at java.io.FileOutputStream.<init>(Unknown Source) at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:95)
Asiri Rathnayake wrote:
Hi Ben,
For the following code, I didn't understand where I can test it... I would
like to solve this problem with IE...
Since you did not respond to my last email, I'll blindly propose a solution that might fix the problem you are experiencing on IE.
1. Open up XWiki/OfficeImporterResults wiki page and go to wiki editing mode, you should see the following code snippet at the top of the page:
<code> #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end </code>
Now you need add two code lines (wait for it) just under the line:
#set($fileName=$fileUpload.getFileName("filePath"))
New code lines to be added are:
#set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex))
So, at the end your code snippet should look like:
#set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #set($tempIndex = $fileName.lastIndexOf('/') + 1) #set($fileName=$fileName.substring($tempIndex)) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end
I'm not 100% sure if this will solve the problem (since I did not get a response for my last email). If above code fixes your problem, please let us know.
Thanks.
- Asiri _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Ho, ok! Forgive my lack of experience. I took the Asiri snippet and just modify "/" in "\" (now I have undertand exactly what you're meaning :) ) and it's working for IE and Firefox. Thanks a lot both of you! -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 5/10/2010 12:18 PM, Ben Stuggler wrote:
Ho, ok!
Forgive my lack of experience. I took the Asiri snippet and just modify "/" in "\" (now I have undertand exactly what you're meaning :) ) and it's working for IE and Firefox.
Great! Thanks for helping us to pinpoint the issue.
Thanks a lot both of you!
Just to share a bug (I think it is) linked to OpenOffice server... If I go on the administration page and select "OpenOffice Server" to start the server, I obtain "Inadequate privileges." But if I go to the same page by "Document Index", I can start the server without error message. I think it's maybe some rights problem but I can't figure what it is. -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 5/10/2010 12:34 PM, Ben Stuggler wrote:
Just to share a bug (I think it is) linked to OpenOffice server...
If I go on the administration page and select "OpenOffice Server" to start the server, I obtain "Inadequate privileges." But if I go to the same page by "Document Index", I can start the server without error message. I think it's maybe some rights problem but I can't figure what it is.
Yes, this is known. The issue is caused by the programming rights requirement. This will require only admin rights in the future. Thanks, Florin Ciubotaru
Florin Ciubotaru wrote:
On 5/10/2010 12:34 PM, Ben Stuggler wrote:
Just to share a bug (I think it is) linked to OpenOffice server...
If I go on the administration page and select "OpenOffice Server" to start the server, I obtain "Inadequate privileges." But if I go to the same page by "Document Index", I can start the server without error message. I think it's maybe some rights problem but I can't figure what it is.
Yes, this is known. The issue is caused by the programming rights requirement. This will require only admin rights in the future.
Thanks, Florin Ciubotaru
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Ok, I have added however the PR for the target user, but it does'nt change anything. thanks anyway Ben -- View this message in context: http://xwiki.475771.n2.nabble.com/Configuring-Open-Office-server-tp5018359p5... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 5/10/2010 12:51 PM, Ben Stuggler wrote:
Florin Ciubotaru wrote:
On 5/10/2010 12:34 PM, Ben Stuggler wrote:
Just to share a bug (I think it is) linked to OpenOffice server...
If I go on the administration page and select "OpenOffice Server" to start the server, I obtain "Inadequate privileges." But if I go to the same page by "Document Index", I can start the server without error message. I think it's maybe some rights problem but I can't figure what it is.
Yes, this is known. The issue is caused by the programming rights requirement. This will require only admin rights in the future.
Thanks, Florin Ciubotaru
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Ok, I have added however the PR for the target user, but it does'nt change anything.
Programming rights are actually checked for the current page. Basically a page has programming rights when when it was last saved by a user having PR, certifying the page to run its scripts. This is a bit confusing for the users. In the case of office importer you will need to re-save the script pages and probably the admin page too, but it is know to be inconsistent and you will need to redo the operation if you have the "Inadequate rights" message again. PR are causing some inconveniences which is why we are going to reduce the number of pages that require them.
thanks anyway
Ben
participants (5)
-
Asiri Rathnayake -
Ben Stuggler -
Florin Ciubotaru -
Marius Dumitru Florea -
Sergiu Dumitriu