Issue 14018 - Need to be able to bind to scripts on filesystem
Summary: Need to be able to bind to scripts on filesystem
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: OOo 1.1 Beta
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: duncan.foster
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-02 10:25 UTC by duncan.foster
Modified: 2003-06-13 12:35 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description duncan.foster 2003-05-02 10:25:12 UTC
Scripting framework should allow users to bind to & execute scripts located on
the filesystem. Scripts should not need to have a parcel-descriptor.xml.
Comment 1 duncan.foster 2003-05-02 10:27:20 UTC
Accepting issue. Retargetting to OOo2.0.
Plan to implement looks something like:
Starting from the outside, the UI, and working our way in

The Assign dialogs will probably require a little more thought, but
from a first impression, and discussion with Noel

Assign dialogs
1. Add the location "Filesystem" to the Location list
2. Move the "Detailed View" checkbox up a little
3. Add a button "Browse" just below the checkbox
4. Add a new global list to the ScriptBindingLibrary module
5. Write a StarBasic sub to popup the filepicker (we've got one from
the Developers' Guide), take the chosen filepath, and add it to the
list created in 4, and call the LangLocComboListener sub to repopulate
the dialog.
6. modify the PopulateScriptList sub to deal with
location="FileSystem",   clear the script list, and repopulate using
the list created in 4.

ScriptProtocolHandler
7. When creating a FunctionProvider, need now to check for location
equal to either document or filesystem, if not then pass the extra arg
(no security dialogs). scripthandler.cxx l.345
8. When creating the ScriptStorage need to check for
location=filesystem (ScriptStorage.cxx l. 182), and if so call an
alternative to the usual ScriptStorage::create.
9. This new method needs to create a ScriptInfo object from just the
URL, and add it to the hashmaps.

the ScriptSecurityManager is unchanged. The ScriptStorageManager just
needs a change to do with the disposing of the storage (see below)

Outstanding issues:
I'm unsure as to how best to dispose of the ScriptStorage after
execution?? The method to do this (ScriptStoragemanager::disposing)
only allows passing in an EventObject ( a struct containing an
XInterface). For a document we pass in the XModel of the document, and
use this to get the URL, and hence the ScriptStorage.
Could we simple pass in the scripts XScriptInfo? This would contain
enough info to get or construct the filesystem URL, and hence he key
to the storage. 
Comment 2 duncan.foster 2003-05-08 10:05:31 UTC
Steps 7-9 coded & in testing. Hard coded relationship between file
extension (.eg .bsh) and script language (eg "BeanShell"). This will
need to be read from the registry or similiar if the scripting
framework is to remain extensible.
Comment 3 duncan.foster 2003-05-16 11:16:52 UTC
All steps according to outline above done. 
Outstanding: dispose issue & how to relate runtimes and their file
extensions. Currently hard coded in ScriptStorage.cxx, and in
ScriptBinding.xba
Comment 4 duncan.foster 2003-05-16 14:32:56 UTC
Code tested on Linux & Windows.
Comment 5 duncan.foster 2003-05-16 14:49:54 UTC
Hmm, problems with marking this as started??
Comment 6 duncan.foster 2003-05-16 16:36:15 UTC
Another attempt to mark as started.
Comment 7 duncan.foster 2003-05-21 10:08:32 UTC
Have fiexed disposing of filesys storages. Will open separate bug to
deal with configuration issue (realtionship between runtime and the
file extensions it can deal with).
Comment 8 robert.kinsella 2003-06-13 12:35:23 UTC
tested on OO.org SF0.3 rc4, user can bind to benashell and javascript.
closing issue as verified fixed