Issue 11245 - security setting 'confirm in case of other document sources' does not work.
Summary: security setting 'confirm in case of other document sources' does not work.
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: 644
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: duncan.foster
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-06 13:56 UTC by robert.kinsella
Modified: 2003-03-13 11:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description robert.kinsella 2003-02-06 13:56:36 UTC
Scripting framework 02.04.2003, tested on StarOffice 644 build 'u'
(OpenOffice.org 644 not yet available for test) on both Windows and Solaris.

Deploy a script to a document, also assign a menu item to execute the deployed
script. For a detailed example on how to do this please Example description below.

After successfully deploying a script to a document, open the document and
select File-HelloNetBeans. 
Select tools, options, staroffice, security. Select Run Macro to According to
Path List. Add the path dir1/dir2 to the path list.Select ok.
Select file- HelloNetBeans, the script should execute and enter the text
"Hello NetBeans" .
 Select tools, options, staroffice, security. Select Run Macro to According to
Path List.Remove  dir1/dir2 from the path list and check the confirm in case of
other document source on. Select ok.
Select File-HelloNetBeans - 

BUG--> A warning dialog should pop up warning the user they are are about to
execute a script, instead nothing happens.






Example description deploying a script to a document:-

1. Create an examples directory e.g. HelloNetBeans.
2. Mount Office API and Scripting API jar files
   Start NetBeans
   Select the File->Mount Filesystem menu item
   In the Choose Filesystem Type window that pops up select Archive Files and
click Next
   Browse to the <Office installation>/program/classes directory
   Select all the jar files in the file selection window and click Finish
   Solairs bugid You also need to mount the unoil.jar file in <Office          
Installation>/user/uno_packages/cache/uno_packages/ooscriptframe.zip.*/skip_registration
3. Mount the examples directories
Select the File->Mount Filesystem menu item
In the Choose Filesystem Type window select Local Directory and click Next
Mount the examples directory you created.
4.Create a new script parcel
Right click on your mounted examples directory.
Select New->Office Scripting->Parcel Recipe
In the New Wizard window that appears, enter the name you wish to call your new
parcel e.g HelloNetBeans.
Select the Initial Script Language - Java.
Click Finish
5.  Click on the Contents-Empty file
-Change the name of 'public class Empty' to 'public class HelloNetBeans'
-Remove the package declaration 'package HelloNetBeans.Contents;' at the top of
the file
-Add the following lines to the top of the script immediately after the first
import statement

      import com.sun.star.uno.UnoRuntime;
      import com.sun.star.frame.XModel;
      import com.sun.star.text.*;
       

6. Add the following lines within the public class HelloNetBeans class.

      XModel model = xSc.getDocument();
       XTextDocument textdoc = (XTextDocument)
                  UnoRuntime.queryInterface(XTextDocument.class, model);
       XText oText = textdoc.getText();
       XTextCursor oCursor = oText.createTextCursor();
       oText.insertString(oCursor, "Hello NetBeans", false);

7. Right click on the HelloNetBeans in the right frame and select save.
8.   Right click on  the HelloNetBeans directory and select compile. You should
note that
the compile completes successfully from the lower right hand frame (output
window) of NetBeans.
9. Right click on the HelloNetBeans  directory and select build,
In the dialog which appears select the HelloNetBeans.doMethod and add to scripts
 select OK.
A HelloNetBeans parcel file should be built.
10. Right click on the Hello NetBeans parcel file and select Deploy to
OpenOffice.org or StarOffice6.1.
11. Check that the files have been successfully deployed to
<office-install>/user/Scripts/java.
12. Assign an event  to execute the script.
-Start OpenOffice.org  writer document.
- Select Tools, Assign Script(java) To, Menu.
-In the popup dialog in the select script function select a script e.g.
HelloNetBeans.doMethod
Select File in the Top Level menu drop down list.
In the New Menu, enter a menu item name e.g. HelloNetBeans.
Select New Script Menu, select ok.
- Select OK when prompted to restart OpenOffice.org. Exit OpenOffice.org.

DEPLOY script to document
Using the same build parcel deploy the parcel to a document e.g. testbind.sxw in
say directory dir1/dir2 as outlined above in step 10.
Delete the HelloNetBeans directory under office-install/user/Scripts/java
Comment 1 Unknown 2003-02-07 08:29:10 UTC
Not yet implemented - this support will be available in next QA build
Comment 2 duncan.foster 2003-02-07 09:44:03 UTC
See also i10516
Comment 3 robert.kinsella 2003-02-12 13:49:25 UTC
changing target milestone to 2.0
Comment 4 duncan.foster 2003-02-14 09:49:51 UTC
Dialogs now appear as per StarBasic security.
Comment 5 robert.kinsella 2003-02-24 18:28:22 UTC
closing issue as verified on SFrameworkINstall.jar.21.02.2003, there
is still an outstanding issue that the warning dialog should launch
when the document is initially opened, this bug is detailed in issue 11779
Comment 6 michael.bemmer 2003-03-13 11:12:23 UTC
As mentioned on the qa dev list on March 5th I will close all resolved
<wontfix/duplicate/worksforme/invalid> issues. Please see this posting for details.