Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » add filesystem resources to project without copying?
add filesystem resources to project without copying? [message #336428] Thu, 11 June 2009 06:55 Go to next message
Mohamed Hussein is currently offline Mohamed HusseinFriend
Messages: 76
Registered: July 2009
Member
Hello,

I would like to allow my users to create projects and add filesystem
resources to it (as normal Eclipse projects and import from file system),
but I want to allow the user to add the resources without copying them to
the project directory.

After some looking around it seems that linked resources is the way to go,
so for every file the user adds to the project, I will create a File
linked resource and add that to the project.

The user can select several files from different places, and can select
specific files from folders and leave others.

It seems that if I link to a folder, everything inside that folder is
added to the project, so I am now thinking of adding all the files
directly as children to the project with unique names, and use the
content/label providers to show the folder structure.

Does this look like a correct approach? Is there support already for this
usage model in any of the standard Eclipse importers?

Thanks in advance for your help.

Best Regards,
Mamado.


Best Regards,
Mohamed.
Re: add filesystem resources to project without copying? [message #336457 is a reply to message #336428] Sun, 14 June 2009 08:23 Go to previous messageGo to next message
Mohamed Hussein is currently offline Mohamed HusseinFriend
Messages: 76
Registered: July 2009
Member
Any updates on the best practices in this situation?

I want to allow the user to add files from arbitrary locations without
copying them into the project directory. and I want my project to play
nicely with Eclipse resource model so that integration with other plugins
(like Team plugins) is possible.

I have tried to create file links directly under the project for every
file added, but I had to use a cleaned-up version of the absolute path as
the link file name to avoid conflicts, which caused me to do modifications
everywhere those files are shown to the user to show the correct file
name, instead of the dummy link name.

I don't feel this is the correct approach, Any recommendations on how this
should be done?

Thanks in advance for your help.

Best Regards,
Mamado.

> I would like to allow my users to create projects and add filesystem
> resources to it (as normal Eclipse projects and import from file system),
> but I want to allow the user to add the resources without copying them to
> the project directory.

> After some looking around it seems that linked resources is the way to go,
> so for every file the user adds to the project, I will create a File
> linked resource and add that to the project.

> The user can select several files from different places, and can select
> specific files from folders and leave others.

> It seems that if I link to a folder, everything inside that folder is
> added to the project, so I am now thinking of adding all the files
> directly as children to the project with unique names, and use the
> content/label providers to show the folder structure.

> Does this look like a correct approach? Is there support already for this
> usage model in any of the standard Eclipse importers?


Best Regards,
Mohamed.
Re: add filesystem resources to project without copying? [message #336458 is a reply to message #336457] Sun, 14 June 2009 09:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Mamado,

Comments below.

Mamado wrote:
>
> Any updates on the best practices in this situation?
I'm not sure what folks could say. What you see is what you get.
Imports will generally import things into the workspace, not create links...
>
> I want to allow the user to add files from arbitrary locations without
> copying them into the project directory. and I want my project to play
> nicely with Eclipse resource model so that integration with other
> plugins (like Team plugins) is possible.
I'm not sure how well you can expect team to interact with the link
files. After all, committing something to a team repository involves
copying the contents of the file to the repository. Are you expecting
the links to be preserved? Each user's file system is likely structured
differently and hence the absolute paths of the links will not be
portable. I suppose you could use standard variables, but that doesn't
sound workable.
>
> I have tried to create file links directly under the project for every
> file added, but I had to use a cleaned-up version of the absolute path
> as the link file name to avoid conflicts, which caused me to do
> modifications everywhere those files are shown to the user to show the
> correct file name, instead of the dummy link name.
It's starting to sound worse and worse right? Perhaps your goal is not
a good one. But you've not explained the reasoning behind your goal...
>
> I don't feel this is the correct approach, Any recommendations on how
> this should be done?
You'd need to explain why copying is no good and why links as they work
aren't sufficient. Even with normal copying the person would have to
rename the files if they are all going to be put into one folder and
they might have conflicting names.
>
> Thanks in advance for your help.
>
> Best Regards,
> Mamado.
>
>> I would like to allow my users to create projects and add filesystem
>> resources to it (as normal Eclipse projects and import from file
>> system), but I want to allow the user to add the resources without
>> copying them to the project directory.
>
>> After some looking around it seems that linked resources is the way
>> to go, so for every file the user adds to the project, I will create
>> a File linked resource and add that to the project.
>
>> The user can select several files from different places, and can
>> select specific files from folders and leave others.
>
>> It seems that if I link to a folder, everything inside that folder is
>> added to the project, so I am now thinking of adding all the files
>> directly as children to the project with unique names, and use the
>> content/label providers to show the folder structure.
>
>> Does this look like a correct approach? Is there support already for
>> this usage model in any of the standard Eclipse importers?
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: add filesystem resources to project without copying? [message #336459 is a reply to message #336458] Sun, 14 June 2009 11:24 Go to previous messageGo to next message
Mohamed Hussein is currently offline Mohamed HusseinFriend
Messages: 76
Registered: July 2009
Member
Thanks a lot for your comments.

It seems I haven't described my intentions clearly.

I am working on migrating an existing tool to Eclipse. The tool already
has a project file that contains absolute (or soft) paths to the files
included in the project.

Users expect the tool to point to files available in shared locations and
use them in their projects (as editable sources), also they don't want the
tool to modify their already existing directory structures, as they
operate on it with other (external tools).

I think I can satisfy those needs by ignoring the resource model
completely (is this correct?) but I want to have better integration with
other plugins in Eclipse.

Regarding version control, I want to allow the users to use files already
under version control in the project, modify them, check them in, ...
There are no (current) plans to have the project itself under version
control.

I hope I have made things clearer, I am new to Eclipse (especially the
resources model) so I welcome any comments and changes you think is better.

Thanks again,
Mamado.


>>
>> Any updates on the best practices in this situation?
> I'm not sure what folks could say. What you see is what you get.
> Imports will generally import things into the workspace, not create links...
>>
>> I want to allow the user to add files from arbitrary locations without
>> copying them into the project directory. and I want my project to play
>> nicely with Eclipse resource model so that integration with other
>> plugins (like Team plugins) is possible.
> I'm not sure how well you can expect team to interact with the link
> files. After all, committing something to a team repository involves
> copying the contents of the file to the repository. Are you expecting
> the links to be preserved? Each user's file system is likely structured
> differently and hence the absolute paths of the links will not be
> portable. I suppose you could use standard variables, but that doesn't
> sound workable.
>>
>> I have tried to create file links directly under the project for every
>> file added, but I had to use a cleaned-up version of the absolute path
>> as the link file name to avoid conflicts, which caused me to do
>> modifications everywhere those files are shown to the user to show the
>> correct file name, instead of the dummy link name.
> It's starting to sound worse and worse right? Perhaps your goal is not
> a good one. But you've not explained the reasoning behind your goal...
>>
>> I don't feel this is the correct approach, Any recommendations on how
>> this should be done?
> You'd need to explain why copying is no good and why links as they work
> aren't sufficient. Even with normal copying the person would have to
> rename the files if they are all going to be put into one folder and
> they might have conflicting names.
>>
>> Thanks in advance for your help.
>>
>> Best Regards,
>> Mamado.
>>
>>> I would like to allow my users to create projects and add filesystem
>>> resources to it (as normal Eclipse projects and import from file
>>> system), but I want to allow the user to add the resources without
>>> copying them to the project directory.
>>
>>> After some looking around it seems that linked resources is the way
>>> to go, so for every file the user adds to the project, I will create
>>> a File linked resource and add that to the project.
>>
>>> The user can select several files from different places, and can
>>> select specific files from folders and leave others.
>>
>>> It seems that if I link to a folder, everything inside that folder is
>>> added to the project, so I am now thinking of adding all the files
>>> directly as children to the project with unique names, and use the
>>> content/label providers to show the folder structure.
>>
>>> Does this look like a correct approach? Is there support already for
>>> this usage model in any of the standard Eclipse importers?
>>
>>
>>
>>


Best Regards,
Mohamed.
Re: add filesystem resources to project without copying? [message #336460 is a reply to message #336459] Sun, 14 June 2009 12:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Mamado,

Comments below.

Mamado wrote:
> Thanks a lot for your comments.
>
> It seems I haven't described my intentions clearly.
>
> I am working on migrating an existing tool to Eclipse. The tool
> already has a project file that contains absolute (or soft) paths to
> the files included in the project.
>
> Users expect the tool to point to files available in shared locations
> and use them in their projects (as editable sources), also they don't
> want the tool to modify their already existing directory structures,
> as they operate on it with other (external tools).
>
> I think I can satisfy those needs by ignoring the resource model
> completely (is this correct?) but I want to have better integration
> with other plugins in Eclipse.
If you ignore resources, your users won't have significant integration
with much of anything.
>
> Regarding version control, I want to allow the users to use files
> already under version control in the project, modify them, check them
> in, ... There are no (current) plans to have the project itself under
> version control.
Of course by now you're getting the sense that you're going against the
Eclipse grain and when you do that, problems will keep popping up...
>
> I hope I have made things clearer, I am new to Eclipse (especially the
> resources model) so I welcome any comments and changes you think is
> better.
It seems better to try to make the folders that contain the user's
content be Eclipse projects, but then I'm not sure what's so special
about the locations of the files that they need to be in exactly the
location they are in....
>
>
> Thanks again,
> Mamado.
>
>
>>>
>>> Any updates on the best practices in this situation?
>> I'm not sure what folks could say. What you see is what you get.
>> Imports will generally import things into the workspace, not create
>> links...
>>>
>>> I want to allow the user to add files from arbitrary locations
>>> without copying them into the project directory. and I want my
>>> project to play nicely with Eclipse resource model so that
>>> integration with other plugins (like Team plugins) is possible.
>> I'm not sure how well you can expect team to interact with the link
>> files. After all, committing something to a team repository involves
>> copying the contents of the file to the repository. Are you
>> expecting the links to be preserved? Each user's file system is
>> likely structured differently and hence the absolute paths of the
>> links will not be portable. I suppose you could use standard
>> variables, but that doesn't sound workable.
>>>
>>> I have tried to create file links directly under the project for
>>> every file added, but I had to use a cleaned-up version of the
>>> absolute path as the link file name to avoid conflicts, which caused
>>> me to do modifications everywhere those files are shown to the user
>>> to show the correct file name, instead of the dummy link name.
>> It's starting to sound worse and worse right? Perhaps your goal is
>> not a good one. But you've not explained the reasoning behind your
>> goal...
>>>
>>> I don't feel this is the correct approach, Any recommendations on
>>> how this should be done?
>> You'd need to explain why copying is no good and why links as they
>> work aren't sufficient. Even with normal copying the person would
>> have to rename the files if they are all going to be put into one
>> folder and they might have conflicting names.
>>>
>>> Thanks in advance for your help.
>>>
>>> Best Regards,
>>> Mamado.
>>>
>>>> I would like to allow my users to create projects and add
>>>> filesystem resources to it (as normal Eclipse projects and import
>>>> from file system), but I want to allow the user to add the
>>>> resources without copying them to the project directory.
>>>
>>>> After some looking around it seems that linked resources is the way
>>>> to go, so for every file the user adds to the project, I will
>>>> create a File linked resource and add that to the project.
>>>
>>>> The user can select several files from different places, and can
>>>> select specific files from folders and leave others.
>>>
>>>> It seems that if I link to a folder, everything inside that folder
>>>> is added to the project, so I am now thinking of adding all the
>>>> files directly as children to the project with unique names, and
>>>> use the content/label providers to show the folder structure.
>>>
>>>> Does this look like a correct approach? Is there support already
>>>> for this usage model in any of the standard Eclipse importers?
>>>
>>>
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Update Site] Creating required dependencies
Next Topic:Compare fails synchronization in Galileo RC4 (Linux GTK)
Goto Forum:
  


Current Time: Tue May 14 22:20:17 GMT 2024

Powered by FUDForum. Page generated in 0.03060 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top