Jörn Kottmann wrote:
I think the installation location should be in a temp directory or
at least outside the workspace. If its already there
he PEAR installation is reused.
You are right local changes might be a problem here, maybe the user
can be ask what to do in that case (reinstall or not) and ask him to
backup his changes.
I personally don't like the idea to install PEARs outside of the
project into a temp directory.
Why do you not like it ?
I don't like it if an application has resources in more than one place.
In our case some of the resources are stored in the workspace location
(type system, xcas files ..) and some others are stored somewhere else
(PEAR).
What happens if you install it outside of the workspace and you delete
the workspace or remove the projects, do you also take care of removing
all the additionally installed files outside of the workspace? What
happens if the user move the workspace using the file system, who
deletes the additional resources outside of the workspace?
When installing the PEARs to a temp directory maybe the user deletes the
files accidentally and also deletes his modifications.
What about other eclipse applications, is this something that is
"common" that some resources are stored outside of the workspace?
That are some of my points why I don't like that design. But that is
just my personally view and other people maybe thinks different and like
the idea. Maybe some other committers/users can response also to this
question where to store the resources.
Every PEAR I think has it's own type system, since it should run out
of the box. If there is no type system specified in the PEAR it won't
run. If the two type system can work together can be checked when the
PEAR file is installed. If there is an error that the two type
systems cannot be merged, the PEAR install routine can throw an error
so that the user know what to fix? Does this make sense?
Is it possible to use the merged type system to instantiate a CAS
object of an e.g. xcas file ?
Yes that is possible. The class that you can use is CasCreationUtils
with the createCas method, see an short example below:
CAS myCas = CasCreationUtils.createCas(mergexTypeSystem, typePriorities,
indexDescriptions, additionalProperties, resourceManager);
There are some more method overloads available... please check and take
that method that fits best.
Lets consider a scenario where are more than one PEAR. Is it possible
to create a merged
type system from all of them plus the project type system ?
That's also possible with the CasCreationUtils class. The methods are
called mergeTypeSystem.
These takes a collection of TypeSystems or TypeSystemDescriptions that
should be merged. The tricky thing for this use case is to get all the
type systems from the PEAR files. Maybe some of them does not have a
separate type system file but have included them in the AE descriptor.
So you first have to parse the AE descriptor to get the type system.
-- Michael