insight-topic:create
Index
Main
Spirit
Logicsheet
insight:
operations
insight-topic:
create
rename
fetch
fetch-tree
fetch-list
current
get-id
get-name
get-fqname
insight-publication:
create
make-default
fetch
fetch-list
get-id
get-state
get-format
get-topic
fetch-fragments
get-fragment-path
get-fragment-locator

Description

Namespace : insight-topic="http://shaman.paris5.fr/xsp/insight-topic"

Element name : insight-topic:create

Purpose : Creates a new Topic, with a given parent Topic.

Inner scope

Current Topic node : The newly created Topic is defined inside the creation tag.


Parameters

         Name           Role Mandatory Remarks
parent-id Sets the Id of the parent Topic of the newly created Topic (root Topic has Id '0'). No, if enclosing tag defines a Topic. Exclusive with parent-fqname.
parent-fqname Sets the full-qualified name of the parent Topic of the newly created Topic (root Topic has FQName '/'). No, if enclosing tag defines a Topic. Exclusive with parent-id.
Should be used for tests only. As a matter of fact, a Topic name can change during Topic's life, making its FQName changing. So it is not a reliable information, Topic Id should be preferred instead whenever possible.
name Sets the name of the newly created Topic. Yes.

Examples

Example 1

Create a Topic named "t1" under the root Topic.

<insight:operations>

  <insight-topic:create parent-id="0" name="t1" />

</insight:operations>

Example 2

Create a Topic named "t2" using an enclosing Topic (known as "/t1") and a Java-defined variable as parameter.
Nest effect allows outputting the newly created Topic FQName in a XHTML <p> element.

<insight:operations>
  <insight-topic:fetch with-fqname="/t1" >

    <xsp:logic>
      String name = "t2" ;
    </xsp:logic>

    <insight-topic:create>

      <insight-topic:name>
        <xsp:expr>name</xsp:expr>
      </insight-topic:name>

      <p>
        Topic <insight-topic:get-fqname/> created.
      </p>

    </insight-topic:create>

  </insight-topic:fetch>
</insight:operations>

This produces following XHTML output :

<p>
  Topic /t1/t2 created.
</p>



Copyright 2002 Laurent Caillette and l'Université René Descartes, Paris 5.
All rights reserved.