Hi Christophe
WRT opening files. You should look at the
org.apache.isis.viewer.dnd.field.ImageField class as this asks the
viewer to locate a file for it (using FileDialog). As its name
suggests, this is a component for displaying images within the viewer
and is provided for Image objects that are found in your domain code.
If you create a similar class to display your spreadsheet reference, a
Specification class to create it given a specific type of object in your
domain object (see the inner class in ImageField) and add the relevant
property to the isis.properties file, then when you open up your domain
object your view will be used and you'll be able to find a file via the
file chooser.
The configuration property should be something like this
isis.viewer.dnd.specification.view=org.fqp.FileField$Specification
(I'm not running at the moment so can't check immediately, but if you
right alt-right-click on the background of the viewer there are numerous
debug options and the one for viewer should have a tab on it listing all
the view factories. So check here to ensure your new one is listed.)
I hope this help. Please ask for more details if you need them and share
your code so we can more easily help.
Regards
Rob
On 30/09/11 08:39, Christophe Dehlinger wrote:
Hello,
I'm currently evaluating isis for a new application. One of the requirements
is that users should be able to import and export data as spreadsheets.
There doesn't seem to be file choosing views shipped with the dnd viewer, so
I've been trying to roll out my own (the usual pair of a text field and
button that opens a file chooser). Unfortunately, I got overwhelmed by all
the concepts involved (views, view requirements, factories, specifications
and builders, facets and their factories, object adapters, the various
contexts...) and their relations, and ultimately have been unabled to get
anything working so far.
Also, the app will be deployed in client/server mode, and I can't figure out
whether domain object methods are run on the server or on the client. As a
consequence, I don't know whether the argument to the import action should
be a reference to the file (a la java.io.File) or its contents (a wrapper on
byte[]).
I'd be grateful if someone could give me a summary of the classes I have to
implement.
Thanks,
Christophe