How to implement a MultiFileLoader?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to implement a MultiFileLoader?

Peter Nabbefeld

Hello,

I'm missing support for MultiDataObject - current file type tutorials
don't seem to cover this.

I've got 2 XML files (extensions "layoutml" and "eoml") and an
additional XML file (with extension "eoml") in a folder (which has a
fixed name).

I'd like to get all of these as one MultiDataObject (making either the
layoutml or the outer "eoml" file the primary file - the eoml has some
metadata, but there exist different eoml's for different datatypes).

I'd also like to only see the primary file, while the other files and
the extra folder should be invisible to the user.

Kind regards
Peter

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Geertjan Wielenga-3

org.openide.filesystems.FileUtil.findBrother

http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String-

https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother

Gj

On 7-7-2017 14:57, Peter Nabbefeld wrote:

>
> Hello,
>
> I'm missing support for MultiDataObject - current file type tutorials
> don't seem to cover this.
>
> I've got 2 XML files (extensions "layoutml" and "eoml") and an
> additional XML file (with extension "eoml") in a folder (which has a
> fixed name).
>
> I'd like to get all of these as one MultiDataObject (making either the
> layoutml or the outer "eoml" file the primary file - the eoml has some
> metadata, but there exist different eoml's for different datatypes).
>
> I'd also like to only see the primary file, while the other files and
> the extra folder should be invisible to the user.
>
> Kind regards
> Peter
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Peter Nabbefeld
Hello Geertjan,

thank You for Your reply! I've not noticed before, my DataObject is
already a MultiDataObject, so it should have sufficient support.

However, how can I make the "brothers" invisible? And also, how can I
make the subfolder invisible?

When creating my file type, I got a MultiDataObject (without the
necessary methods for working with multiple files), but no
MultiFileLoader (so I guess some default implementation is used).

Kind regards
Peter





Am 07.07.2017 um 15:02 schrieb geertjan wielenga:

>
> org.openide.filesystems.FileUtil.findBrother
>
> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>
>
> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother
>
> Gj
>
> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>
>> Hello,
>>
>> I'm missing support for MultiDataObject - current file type tutorials
>> don't seem to cover this.
>>
>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>> additional XML file (with extension "eoml") in a folder (which has a
>> fixed name).
>>
>> I'd like to get all of these as one MultiDataObject (making either the
>> layoutml or the outer "eoml" file the primary file - the eoml has some
>> metadata, but there exist different eoml's for different datatypes).
>>
>> I'd also like to only see the primary file, while the other files and
>> the extra folder should be invisible to the user.
>>
>> Kind regards
>> Peter
>>
>
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Geertjan Wielenga-3

I'd take a look in the NetBeans sources if I were you, to see how it's
done for '.form' files.

Gj


On 7-7-2017 15:55, Peter Nabbefeld wrote:

> Hello Geertjan,
>
> thank You for Your reply! I've not noticed before, my DataObject is
> already a MultiDataObject, so it should have sufficient support.
>
> However, how can I make the "brothers" invisible? And also, how can I
> make the subfolder invisible?
>
> When creating my file type, I got a MultiDataObject (without the
> necessary methods for working with multiple files), but no
> MultiFileLoader (so I guess some default implementation is used).
>
> Kind regards
> Peter
>
>
>
>
>
> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>
>> org.openide.filesystems.FileUtil.findBrother
>>
>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>
>>
>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>
>>
>> Gj
>>
>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>
>>> Hello,
>>>
>>> I'm missing support for MultiDataObject - current file type
>>> tutorials don't seem to cover this.
>>>
>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>> additional XML file (with extension "eoml") in a folder (which has a
>>> fixed name).
>>>
>>> I'd like to get all of these as one MultiDataObject (making either
>>> the layoutml or the outer "eoml" file the primary file - the eoml
>>> has some metadata, but there exist different eoml's for different
>>> datatypes).
>>>
>>> I'd also like to only see the primary file, while the other files
>>> and the extra folder should be invisible to the user.
>>>
>>> Kind regards
>>> Peter
>>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Peter Nabbefeld
The point here is, that in NB several parts work together - I've not yet
found a solution in the "form" module, I'll take a look into the file
chooser - it needs some hint to ignore files for display, so it should
be more clear.

Still just wondering, if there maybye some FAQ or up-to-date tutorial
for MultiDataObject ...

Regards
Peter


Am 07.07.2017 um 15:57 schrieb geertjan wielenga:

>
> I'd take a look in the NetBeans sources if I were you, to see how it's
> done for '.form' files.
>
> Gj
>
>
> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>> Hello Geertjan,
>>
>> thank You for Your reply! I've not noticed before, my DataObject is
>> already a MultiDataObject, so it should have sufficient support.
>>
>> However, how can I make the "brothers" invisible? And also, how can I
>> make the subfolder invisible?
>>
>> When creating my file type, I got a MultiDataObject (without the
>> necessary methods for working with multiple files), but no
>> MultiFileLoader (so I guess some default implementation is used).
>>
>> Kind regards
>> Peter
>>
>>
>>
>>
>>
>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>
>>> org.openide.filesystems.FileUtil.findBrother
>>>
>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>
>>>
>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>
>>>
>>> Gj
>>>
>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'm missing support for MultiDataObject - current file type
>>>> tutorials don't seem to cover this.
>>>>
>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>> additional XML file (with extension "eoml") in a folder (which has a
>>>> fixed name).
>>>>
>>>> I'd like to get all of these as one MultiDataObject (making either
>>>> the layoutml or the outer "eoml" file the primary file - the eoml
>>>> has some metadata, but there exist different eoml's for different
>>>> datatypes).
>>>>
>>>> I'd also like to only see the primary file, while the other files
>>>> and the extra folder should be invisible to the user.
>>>>
>>>> Kind regards
>>>> Peter
>>>>
>>>
>>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Geertjan Wielenga-3

Really, the best place to look is the Form module, that does exactly
what you're discussing here. No, there wouldn't make sense for there to
be a tutorial or a FAQ about this, since this is an extremely specific
scenario, in fact, in NetBeans only the Form module has such a use case.

Gj


On 7-7-2017 16:03, Peter Nabbefeld wrote:

> The point here is, that in NB several parts work together - I've not
> yet found a solution in the "form" module, I'll take a look into the
> file chooser - it needs some hint to ignore files for display, so it
> should be more clear.
>
> Still just wondering, if there maybye some FAQ or up-to-date tutorial
> for MultiDataObject ...
>
> Regards
> Peter
>
>
> Am 07.07.2017 um 15:57 schrieb geertjan wielenga:
>>
>> I'd take a look in the NetBeans sources if I were you, to see how
>> it's done for '.form' files.
>>
>> Gj
>>
>>
>> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>>> Hello Geertjan,
>>>
>>> thank You for Your reply! I've not noticed before, my DataObject is
>>> already a MultiDataObject, so it should have sufficient support.
>>>
>>> However, how can I make the "brothers" invisible? And also, how can
>>> I make the subfolder invisible?
>>>
>>> When creating my file type, I got a MultiDataObject (without the
>>> necessary methods for working with multiple files), but no
>>> MultiFileLoader (so I guess some default implementation is used).
>>>
>>> Kind regards
>>> Peter
>>>
>>>
>>>
>>>
>>>
>>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>>
>>>> org.openide.filesystems.FileUtil.findBrother
>>>>
>>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>>
>>>>
>>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>>
>>>>
>>>> Gj
>>>>
>>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I'm missing support for MultiDataObject - current file type
>>>>> tutorials don't seem to cover this.
>>>>>
>>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>>> additional XML file (with extension "eoml") in a folder (which has
>>>>> a fixed name).
>>>>>
>>>>> I'd like to get all of these as one MultiDataObject (making either
>>>>> the layoutml or the outer "eoml" file the primary file - the eoml
>>>>> has some metadata, but there exist different eoml's for different
>>>>> datatypes).
>>>>>
>>>>> I'd also like to only see the primary file, while the other files
>>>>> and the extra folder should be invisible to the user.
>>>>>
>>>>> Kind regards
>>>>> Peter
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Peter Nabbefeld
Hm, obviously I've been mistaken ... the usual file dialog doesn't hide
the form files, only the file node explorer view does.  :-/

However, this doesn't work currently, either, but should work if my
MultiDataObject works. I'll try further ...

Kind regards
Peter


Am 07.07.2017 um 16:13 schrieb geertjan wielenga:

>
> Really, the best place to look is the Form module, that does exactly
> what you're discussing here. No, there wouldn't make sense for there to
> be a tutorial or a FAQ about this, since this is an extremely specific
> scenario, in fact, in NetBeans only the Form module has such a use case.
>
> Gj
>
>
> On 7-7-2017 16:03, Peter Nabbefeld wrote:
>> The point here is, that in NB several parts work together - I've not
>> yet found a solution in the "form" module, I'll take a look into the
>> file chooser - it needs some hint to ignore files for display, so it
>> should be more clear.
>>
>> Still just wondering, if there maybye some FAQ or up-to-date tutorial
>> for MultiDataObject ...
>>
>> Regards
>> Peter
>>
>>
>> Am 07.07.2017 um 15:57 schrieb geertjan wielenga:
>>>
>>> I'd take a look in the NetBeans sources if I were you, to see how
>>> it's done for '.form' files.
>>>
>>> Gj
>>>
>>>
>>> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>>>> Hello Geertjan,
>>>>
>>>> thank You for Your reply! I've not noticed before, my DataObject is
>>>> already a MultiDataObject, so it should have sufficient support.
>>>>
>>>> However, how can I make the "brothers" invisible? And also, how can
>>>> I make the subfolder invisible?
>>>>
>>>> When creating my file type, I got a MultiDataObject (without the
>>>> necessary methods for working with multiple files), but no
>>>> MultiFileLoader (so I guess some default implementation is used).
>>>>
>>>> Kind regards
>>>> Peter
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>>>
>>>>> org.openide.filesystems.FileUtil.findBrother
>>>>>
>>>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>>>
>>>>>
>>>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>>>
>>>>>
>>>>> Gj
>>>>>
>>>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm missing support for MultiDataObject - current file type
>>>>>> tutorials don't seem to cover this.
>>>>>>
>>>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>>>> additional XML file (with extension "eoml") in a folder (which has
>>>>>> a fixed name).
>>>>>>
>>>>>> I'd like to get all of these as one MultiDataObject (making either
>>>>>> the layoutml or the outer "eoml" file the primary file - the eoml
>>>>>> has some metadata, but there exist different eoml's for different
>>>>>> datatypes).
>>>>>>
>>>>>> I'd also like to only see the primary file, while the other files
>>>>>> and the extra folder should be invisible to the user.
>>>>>>
>>>>>> Kind regards
>>>>>> Peter
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Peter Nabbefeld
In reply to this post by Geertjan Wielenga-3
Hm, FormDataLoader and FormDataObject seem to handle things very special
(both extensions registered to one DataLoader), which isn't appropriate
for my case (some files aren't "brothers").

I think my current implementation should work, but obviously I've done
sth. wrong with regeistration, as
"org.openide.loaders.DataLoaderPool$DefaultLoader" is used instead of my
own loader.

I've put the code of my loader and my object into the readme file of the
following public repository:
https://github.com/OldGrumble/nuclos-extensions/tree/master

It looks rather strange, obviously some code obviously has been
interpreted as formatting, so please download it or use "raw" view
before reading.

I'd guess, my problems are caused by annotations, so please, could You
tell me what I'm doing wrong?

Kind regards
Peter


Am 07.07.2017 um 15:57 schrieb geertjan wielenga:

>
> I'd take a look in the NetBeans sources if I were you, to see how it's
> done for '.form' files.
>
> Gj
>
>
> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>> Hello Geertjan,
>>
>> thank You for Your reply! I've not noticed before, my DataObject is
>> already a MultiDataObject, so it should have sufficient support.
>>
>> However, how can I make the "brothers" invisible? And also, how can I
>> make the subfolder invisible?
>>
>> When creating my file type, I got a MultiDataObject (without the
>> necessary methods for working with multiple files), but no
>> MultiFileLoader (so I guess some default implementation is used).
>>
>> Kind regards
>> Peter
>>
>>
>>
>>
>>
>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>
>>> org.openide.filesystems.FileUtil.findBrother
>>>
>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>
>>>
>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>
>>>
>>> Gj
>>>
>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'm missing support for MultiDataObject - current file type
>>>> tutorials don't seem to cover this.
>>>>
>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>> additional XML file (with extension "eoml") in a folder (which has a
>>>> fixed name).
>>>>
>>>> I'd like to get all of these as one MultiDataObject (making either
>>>> the layoutml or the outer "eoml" file the primary file - the eoml
>>>> has some metadata, but there exist different eoml's for different
>>>> datatypes).
>>>>
>>>> I'd also like to only see the primary file, while the other files
>>>> and the extra folder should be invisible to the user.
>>>>
>>>> Kind regards
>>>> Peter
>>>>
>>>
>>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Geertjan Wielenga-3

Maybe you should, in this specific unique and complex case, not use
annotations. Just use the layer file manually, yes, more work, but will
give you more control in this case and the DefaultLoader you get via
annotations won't be automatically used and you'll register your own
loader manually instead. Annotations are useful in 80% or so of the
cases and I believe you may be in the 20% where they're more a hindrance.

Gj


On 13-7-2017 12:44, Peter Nabbefeld wrote:

> Hm, FormDataLoader and FormDataObject seem to handle things very
> special (both extensions registered to one DataLoader), which isn't
> appropriate for my case (some files aren't "brothers").
>
> I think my current implementation should work, but obviously I've done
> sth. wrong with regeistration, as
> "org.openide.loaders.DataLoaderPool$DefaultLoader" is used instead of
> my own loader.
>
> I've put the code of my loader and my object into the readme file of
> the following public repository:
> https://github.com/OldGrumble/nuclos-extensions/tree/master
>
> It looks rather strange, obviously some code obviously has been
> interpreted as formatting, so please download it or use "raw" view
> before reading.
>
> I'd guess, my problems are caused by annotations, so please, could You
> tell me what I'm doing wrong?
>
> Kind regards
> Peter
>
>
> Am 07.07.2017 um 15:57 schrieb geertjan wielenga:
>>
>> I'd take a look in the NetBeans sources if I were you, to see how
>> it's done for '.form' files.
>>
>> Gj
>>
>>
>> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>>> Hello Geertjan,
>>>
>>> thank You for Your reply! I've not noticed before, my DataObject is
>>> already a MultiDataObject, so it should have sufficient support.
>>>
>>> However, how can I make the "brothers" invisible? And also, how can
>>> I make the subfolder invisible?
>>>
>>> When creating my file type, I got a MultiDataObject (without the
>>> necessary methods for working with multiple files), but no
>>> MultiFileLoader (so I guess some default implementation is used).
>>>
>>> Kind regards
>>> Peter
>>>
>>>
>>>
>>>
>>>
>>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>>
>>>> org.openide.filesystems.FileUtil.findBrother
>>>>
>>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>>
>>>>
>>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>>
>>>>
>>>> Gj
>>>>
>>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I'm missing support for MultiDataObject - current file type
>>>>> tutorials don't seem to cover this.
>>>>>
>>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>>> additional XML file (with extension "eoml") in a folder (which has
>>>>> a fixed name).
>>>>>
>>>>> I'd like to get all of these as one MultiDataObject (making either
>>>>> the layoutml or the outer "eoml" file the primary file - the eoml
>>>>> has some metadata, but there exist different eoml's for different
>>>>> datatypes).
>>>>>
>>>>> I'd also like to only see the primary file, while the other files
>>>>> and the extra folder should be invisible to the user.
>>>>>
>>>>> Kind regards
>>>>> Peter
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Peter Nabbefeld
Hm, would be nice if there'd be an option to create a lyer entry from
anotations - even more, as up-to-date tutorials usually use annotations
now ... I'll go looking for some old ones, to find out.

Is there sth. like "@SuppressWarning" for layer files?  ;-)

Kind regards
Peter


Am 13.07.2017 um 12:48 schrieb geertjan wielenga:

>
> Maybe you should, in this specific unique and complex case, not use
> annotations. Just use the layer file manually, yes, more work, but will
> give you more control in this case and the DefaultLoader you get via
> annotations won't be automatically used and you'll register your own
> loader manually instead. Annotations are useful in 80% or so of the
> cases and I believe you may be in the 20% where they're more a hindrance.
>
> Gj
>
>
> On 13-7-2017 12:44, Peter Nabbefeld wrote:
>> Hm, FormDataLoader and FormDataObject seem to handle things very
>> special (both extensions registered to one DataLoader), which isn't
>> appropriate for my case (some files aren't "brothers").
>>
>> I think my current implementation should work, but obviously I've done
>> sth. wrong with regeistration, as
>> "org.openide.loaders.DataLoaderPool$DefaultLoader" is used instead of
>> my own loader.
>>
>> I've put the code of my loader and my object into the readme file of
>> the following public repository:
>> https://github.com/OldGrumble/nuclos-extensions/tree/master
>>
>> It looks rather strange, obviously some code obviously has been
>> interpreted as formatting, so please download it or use "raw" view
>> before reading.
>>
>> I'd guess, my problems are caused by annotations, so please, could You
>> tell me what I'm doing wrong?
>>
>> Kind regards
>> Peter
>>
>>
>> Am 07.07.2017 um 15:57 schrieb geertjan wielenga:
>>>
>>> I'd take a look in the NetBeans sources if I were you, to see how
>>> it's done for '.form' files.
>>>
>>> Gj
>>>
>>>
>>> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>>>> Hello Geertjan,
>>>>
>>>> thank You for Your reply! I've not noticed before, my DataObject is
>>>> already a MultiDataObject, so it should have sufficient support.
>>>>
>>>> However, how can I make the "brothers" invisible? And also, how can
>>>> I make the subfolder invisible?
>>>>
>>>> When creating my file type, I got a MultiDataObject (without the
>>>> necessary methods for working with multiple files), but no
>>>> MultiFileLoader (so I guess some default implementation is used).
>>>>
>>>> Kind regards
>>>> Peter
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>>>
>>>>> org.openide.filesystems.FileUtil.findBrother
>>>>>
>>>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>>>
>>>>>
>>>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>>>
>>>>>
>>>>> Gj
>>>>>
>>>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm missing support for MultiDataObject - current file type
>>>>>> tutorials don't seem to cover this.
>>>>>>
>>>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>>>> additional XML file (with extension "eoml") in a folder (which has
>>>>>> a fixed name).
>>>>>>
>>>>>> I'd like to get all of these as one MultiDataObject (making either
>>>>>> the layoutml or the outer "eoml" file the primary file - the eoml
>>>>>> has some metadata, but there exist different eoml's for different
>>>>>> datatypes).
>>>>>>
>>>>>> I'd also like to only see the primary file, while the other files
>>>>>> and the extra folder should be invisible to the user.
>>>>>>
>>>>>> Kind regards
>>>>>> Peter
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Geertjan Wielenga-3

Well, what I'm suggesting is that you first get it working manually,
without annotations. After that, you can investigate about using
annotations instead.

It's not a question of looking at tutorials, but a looking at the code
in the Form module.

Gj


On 13-7-2017 12:53, Peter Nabbefeld wrote:

> Hm, would be nice if there'd be an option to create a lyer entry from
> anotations - even more, as up-to-date tutorials usually use
> annotations now ... I'll go looking for some old ones, to find out.
>
> Is there sth. like "@SuppressWarning" for layer files?  ;-)
>
> Kind regards
> Peter
>
>
> Am 13.07.2017 um 12:48 schrieb geertjan wielenga:
>>
>> Maybe you should, in this specific unique and complex case, not use
>> annotations. Just use the layer file manually, yes, more work, but
>> will give you more control in this case and the DefaultLoader you get
>> via annotations won't be automatically used and you'll register your
>> own loader manually instead. Annotations are useful in 80% or so of
>> the cases and I believe you may be in the 20% where they're more a
>> hindrance.
>>
>> Gj
>>
>>
>> On 13-7-2017 12:44, Peter Nabbefeld wrote:
>>> Hm, FormDataLoader and FormDataObject seem to handle things very
>>> special (both extensions registered to one DataLoader), which isn't
>>> appropriate for my case (some files aren't "brothers").
>>>
>>> I think my current implementation should work, but obviously I've
>>> done sth. wrong with regeistration, as
>>> "org.openide.loaders.DataLoaderPool$DefaultLoader" is used instead
>>> of my own loader.
>>>
>>> I've put the code of my loader and my object into the readme file of
>>> the following public repository:
>>> https://github.com/OldGrumble/nuclos-extensions/tree/master
>>>
>>> It looks rather strange, obviously some code obviously has been
>>> interpreted as formatting, so please download it or use "raw" view
>>> before reading.
>>>
>>> I'd guess, my problems are caused by annotations, so please, could
>>> You tell me what I'm doing wrong?
>>>
>>> Kind regards
>>> Peter
>>>
>>>
>>> Am 07.07.2017 um 15:57 schrieb geertjan wielenga:
>>>>
>>>> I'd take a look in the NetBeans sources if I were you, to see how
>>>> it's done for '.form' files.
>>>>
>>>> Gj
>>>>
>>>>
>>>> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>>>>> Hello Geertjan,
>>>>>
>>>>> thank You for Your reply! I've not noticed before, my DataObject
>>>>> is already a MultiDataObject, so it should have sufficient support.
>>>>>
>>>>> However, how can I make the "brothers" invisible? And also, how
>>>>> can I make the subfolder invisible?
>>>>>
>>>>> When creating my file type, I got a MultiDataObject (without the
>>>>> necessary methods for working with multiple files), but no
>>>>> MultiFileLoader (so I guess some default implementation is used).
>>>>>
>>>>> Kind regards
>>>>> Peter
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>>>>
>>>>>> org.openide.filesystems.FileUtil.findBrother
>>>>>>
>>>>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>>>>
>>>>>>
>>>>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>>>>
>>>>>>
>>>>>> Gj
>>>>>>
>>>>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I'm missing support for MultiDataObject - current file type
>>>>>>> tutorials don't seem to cover this.
>>>>>>>
>>>>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>>>>> additional XML file (with extension "eoml") in a folder (which
>>>>>>> has a fixed name).
>>>>>>>
>>>>>>> I'd like to get all of these as one MultiDataObject (making
>>>>>>> either the layoutml or the outer "eoml" file the primary file -
>>>>>>> the eoml has some metadata, but there exist different eoml's for
>>>>>>> different datatypes).
>>>>>>>
>>>>>>> I'd also like to only see the primary file, while the other
>>>>>>> files and the extra folder should be invisible to the user.
>>>>>>>
>>>>>>> Kind regards
>>>>>>> Peter
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to implement a MultiFileLoader?

Peter Nabbefeld
As I've pointed out before, the form module isn't useful as an example
for my use case, MVDDataObject in vmd.midp.converter is probably more
useful.

However, I've only made the layer declaration active again, which I
created before and which has been converted automatically did change
behaviour. Probably it isn't always reliable - I'll have to check that
later.

I've to look, why my icon is missing now, and why DataFolder does not
ignore the secondary entries.

Kind regards
Peter


Am 13.07.2017 um 12:57 schrieb geertjan wielenga:

>
> Well, what I'm suggesting is that you first get it working manually,
> without annotations. After that, you can investigate about using
> annotations instead.
>
> It's not a question of looking at tutorials, but a looking at the code
> in the Form module.
>
> Gj
>
>
> On 13-7-2017 12:53, Peter Nabbefeld wrote:
>> Hm, would be nice if there'd be an option to create a lyer entry from
>> anotations - even more, as up-to-date tutorials usually use
>> annotations now ... I'll go looking for some old ones, to find out.
>>
>> Is there sth. like "@SuppressWarning" for layer files?  ;-)
>>
>> Kind regards
>> Peter
>>
>>
>> Am 13.07.2017 um 12:48 schrieb geertjan wielenga:
>>>
>>> Maybe you should, in this specific unique and complex case, not use
>>> annotations. Just use the layer file manually, yes, more work, but
>>> will give you more control in this case and the DefaultLoader you get
>>> via annotations won't be automatically used and you'll register your
>>> own loader manually instead. Annotations are useful in 80% or so of
>>> the cases and I believe you may be in the 20% where they're more a
>>> hindrance.
>>>
>>> Gj
>>>
>>>
>>> On 13-7-2017 12:44, Peter Nabbefeld wrote:
>>>> Hm, FormDataLoader and FormDataObject seem to handle things very
>>>> special (both extensions registered to one DataLoader), which isn't
>>>> appropriate for my case (some files aren't "brothers").
>>>>
>>>> I think my current implementation should work, but obviously I've
>>>> done sth. wrong with regeistration, as
>>>> "org.openide.loaders.DataLoaderPool$DefaultLoader" is used instead
>>>> of my own loader.
>>>>
>>>> I've put the code of my loader and my object into the readme file of
>>>> the following public repository:
>>>> https://github.com/OldGrumble/nuclos-extensions/tree/master
>>>>
>>>> It looks rather strange, obviously some code obviously has been
>>>> interpreted as formatting, so please download it or use "raw" view
>>>> before reading.
>>>>
>>>> I'd guess, my problems are caused by annotations, so please, could
>>>> You tell me what I'm doing wrong?
>>>>
>>>> Kind regards
>>>> Peter
>>>>
>>>>
>>>> Am 07.07.2017 um 15:57 schrieb geertjan wielenga:
>>>>>
>>>>> I'd take a look in the NetBeans sources if I were you, to see how
>>>>> it's done for '.form' files.
>>>>>
>>>>> Gj
>>>>>
>>>>>
>>>>> On 7-7-2017 15:55, Peter Nabbefeld wrote:
>>>>>> Hello Geertjan,
>>>>>>
>>>>>> thank You for Your reply! I've not noticed before, my DataObject
>>>>>> is already a MultiDataObject, so it should have sufficient support.
>>>>>>
>>>>>> However, how can I make the "brothers" invisible? And also, how
>>>>>> can I make the subfolder invisible?
>>>>>>
>>>>>> When creating my file type, I got a MultiDataObject (without the
>>>>>> necessary methods for working with multiple files), but no
>>>>>> MultiFileLoader (so I guess some default implementation is used).
>>>>>>
>>>>>> Kind regards
>>>>>> Peter
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 07.07.2017 um 15:02 schrieb geertjan wielenga:
>>>>>>>
>>>>>>> org.openide.filesystems.FileUtil.findBrother
>>>>>>>
>>>>>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#findBrother-org.openide.filesystems.FileObject-java.lang.String- 
>>>>>>>
>>>>>>>
>>>>>>> https://blogs.oracle.com/geertjan/orgopenidefilesystemsfileutilfindbrother 
>>>>>>>
>>>>>>>
>>>>>>> Gj
>>>>>>>
>>>>>>> On 7-7-2017 14:57, Peter Nabbefeld wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I'm missing support for MultiDataObject - current file type
>>>>>>>> tutorials don't seem to cover this.
>>>>>>>>
>>>>>>>> I've got 2 XML files (extensions "layoutml" and "eoml") and an
>>>>>>>> additional XML file (with extension "eoml") in a folder (which
>>>>>>>> has a fixed name).
>>>>>>>>
>>>>>>>> I'd like to get all of these as one MultiDataObject (making
>>>>>>>> either the layoutml or the outer "eoml" file the primary file -
>>>>>>>> the eoml has some metadata, but there exist different eoml's for
>>>>>>>> different datatypes).
>>>>>>>>
>>>>>>>> I'd also like to only see the primary file, while the other
>>>>>>>> files and the extra folder should be invisible to the user.
>>>>>>>>
>>>>>>>> Kind regards
>>>>>>>> Peter
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Loading...