Re: A little help

Stephane Bonhomme (Stephane.Bonhomme@inrialpes.fr)
Fri, 16 Oct 1998 18:15:06 +0200

Hi, Flavia,

Sorry for the late response,

>
> My name is Flavia Peligrinelli. I am a member of the "Project
> HyperPro", which is being developed at the Computer Science
> Department of the Universidade Federal de Minas Gerais (UFMG),
> Brazil, in cooperation with the Pierre Deransart's team
> of the "Projet Prolo" at INRIA, Rocquencourt.
>
> The project HyperPro aims the development of a documentation system
> for Constraints Logic Programs based on Thot technology.
>
> The Brazilian HyperPro team suggested me to contact you in order to get
> help to find a solution for a problem I am facing in the implementation
> of the projection facilities of HyperPro.
>
> The basic idea of the projection mechanism is that given designated
> elements from a document tree, some sub-elements are to be automatically
> retrieved from the document and exhibited in a view.
>
> In order to do it, I need to show several elements in the same
> view. Thot APIs only allow me to show the whole tree or a single
> subtree per view. What I need is the ability to show different
> elements which don't belong to the same subtree, in the same view.
>
> I am using the following Thot's APIs:
> void TtaGiveFirstSelectedElement(...)
> view TtaOpenSubView(...)
> void TtaChangeView Title(...)
> void ttaGiveReferedElement(...)
> ElementType TtaGetElementType(...)
> ElementType TtaGetLastChild(...)
> ElementType TtaSearchReferencedElement(...)
> ElementType TtaGetSuccessor(...)
>
> I succeeded in traversing correctly the document structure and
> in retrieving the selected subtrees, but I cannot produce a
> correct exhibition of the result: the subtrees are always shown
> one on the top of the other in the specified view.
>
> The questions I would like to pose are:
>
> 1. Am I using the appropriate APIs?
>
> 2. How can I solve the problem I described above
>
> 3. Is there another approach to exhibit several subtrees in a sole
> view?
>
>
> I would be grateful if you could give any hint to show me the way out
> of this snag.
>

The TtaOpenSubView function is intented to display ONE subtre in a view. I don't think it can be used for displaying several subtree in a single view. So I don't know what kind of display you have but it is certainely not what you expected.

I think the best way to select a set of elements to be deisplayed is to define a global presentation attribute in the S schema, let's assume it is named visible :

STRUCTURE HyperPro;
DEFPRES HyperProP;

ATTR
visible = integer;
STRUCT
HyperPro = ...

You should give a presentation rule for this attribute that sets the visibility to zero in the P schema HyperProP.P :
PRESENTATION HyperPro;

VIEWS
ResultView {the view in wich subtrees are displayed}
...
DEFAULT
Visibility : Enclosing =;
...
RULES
HyperPro
BEGIN
...
IN ResultView
Visibility = 0; { do not display the whole tree }

...

ATTRIBUTES
visible:
BEGIN
IN ResultView
visibility = 6; {as an example of value}
END
...

Then in your code you assign a visible attribute to the roots of the subtrees you want to be visible and they (and only them) should be displayed in the ResultView (you just need to open once this view).

I'm not sure that I well understand the sense of `the subtrees are always shown
> one on the top of the other in the specified view'. Do you mean they overlap?
In that case you have to check that it is not due to a misformed P schema.

Let me know you results...

Hope this helps.

Stephane.

----------------------------------------------------------------------------
thot@imag.fr is archived at http://opera.inrialpes.fr/thot/messages/