SMWP - Page Class
 

Index

Introduction
Differences
Installation I
Installation II
Installation III
Uninstall

Working with SMWP

Parameter
Fragement Class
Page Class
XML Document (Page)



4.12 Create Page Class

Syntax simple (no page references)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
"CREATE PAGE CLASS" className
  "FILENAME ["fileName"]"
[ "GENERATION APPROACH "("
 ("coreSMWP"|"pullOfFragments"|"on theFly" ) ")" ]
"FOUNDATION FRAGMENT CLASS" className "AS" name
["PARAMETER MAP" paramName "AS" paramName
  {"," paramName "AS" paramName }
]
{ "FRAGMENT CLASS" className "AS name
  [ PARAMETER MAP paramName AS paramName
  {, paramName AS paramName} ]
}
[ PUBLISH PAGE AS NAME elementName
IN NAMESPACE nsURI; ] ";"

Creates an page class which is used for XML representation of one or more fragment classes. The page class is defined upon one foundation fragment class which must have the same set of parameters (line 5). If the names of the parameters between page class and foundation fragment class differ they have to be mapped against each other (line 6,7). The page class is a logical construct upon which XML documents are generated. The name of the XML documents is set by using the filename as prefix (line 2) and parameter values as suffix:

systemID = filename { "_" parameterValue }.

The generation approach which is used when database updates occur is specified by line 3,4. coreSMWP uses the incremental updates of the XML documents which are affected by the database modification. puffOfFragements recreates all XML documents of affected page classes while onTheFly is used for regenerating XML documents for all page classes. This prototype implements the generation approach coreSMWP only. The root element of the XML documents uses the element name and namespace provided by line13, 14.

Preconitions

  • parameter count between page class and foundation fragment class must be identical

Syntax complete (including internal and external page references)

1
2
3

4
5
6
7
8
9
 

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

31
32

"CREATE PAGE CLASS" className
  "FILENAME ["fileName"]"
  "GENERATION APPROACH"("coreSMWP"|"pullOfFragments"|"on theFly")

{ ("INTERNAL LINK TO FRAGMENT CLASS" className ["AS" name]
    ["JOIN BY ["joinClause"]"])
  | ("EXTERNAL LINK TO PAGE CLASS" className ["AS" name]
    [ "CONTAINING FRAGMENT CLASS" className ["AS" name]
    [ "JOIN BY ["joinClause"]" ]]
  
)
}

"FOUNDATION FRAGMENT CLASS" className "AS" name
  ["PARAMETER MAP" paramName "AS" paramName
  {"," paramName "AS" paramName }
  ]
  { (("INTERNAL LINK TO FRAGMENT CLASS" className ["AS" name]
      "JOIN BY ["joinClause"]")
    |("EXTERNAL LINK TO PAGE CLASS" className ["AS" name]
      "CONTAINING FRAGMENT CLASS" className ["AS" name]
      "JOIN BY ["joinClause"]")
  )
}
{ "FRAGMENT CLASS" className "AS name
  [ PARAMETER MAP paramName AS paramName
  {, paramName AS paramName} ]
  { ( INTERNAL LINK TO FRAGMENT CLASS className [AS name]
      JOIN BY [joinClause]
    | EXTERNAL LINK TO PAGE CLASS className [AS name]
      CONTAINING FRAGMENT CLASS className [AS name]
      JOIN BY [joinClause] )
  }
}

[ PUBLISH PAGE AS NAME elementName
IN NAMESPACE nsURI; ] ";"

Example 18

CREATE PAGE CLASS wines<region>
FILENAME [wines/wines_region]
FOUNDATION FRAGMENT CLASS wines<region>
FRAGMENT CLASS wineries<region>
PUBLISH PAGE AS NAME wines_region
IN NAMESPACE [http://dke.uni-linz.ac.at/smwp];

Creates the page class wines<region> using the prefix "wines/wines_region" as prefix for all XML documents generated. XML documents are created upon this page class are named wines/wines_region_chia, wines/wines_region_rioja, wines/wines_region_styr. The page class uses the fragment class wines<region> as foundation fragment class which contains the same parameter set as the page class itself. An additional fragment class wineries<region> is mapped to the page class. The root element name is wines_region using the namespace http://dke.uni-linz.ac.at/smwp to create a qualified element.

Example 19

CREATE PAGE CLASS wineries<region>
FILENAME [region]
FOUNDATION FRAGMENT CLASS wineries<region> AS winery
FRAGMENT CLASS regions<id> AS region
PARAMETER MAP id AS region
PUBLISH PAGE AS NAME region
IN NAMESPACE [http://dke.uni-linz.ac.at/smwp];

This example defines a page class containing a foundation fragment class and one mapped fragment class. The mapped fragment class regions<id> uses the parameter id which is an semantically identical to the parameter region used by wineries<region>. In order to use the parameter id a mapping is neccesary which states that the parameter id is equal to the parameter region.

Example 20

CREATE PAGE CLASS wines<region>
FILENAME [wines/wines_region]
GENERATION APPROACH coreSMWP
FOUNDATION FRAGMENT CLASS wines<region> AS wine
INTERNAL LINK TO FRAGMENT CLASS regions<id> AS region
JOIN BY [wine.region=region.id]
EXTERNAL LINK TO PAGE CLASS wineries<region> AS pc_winery
CONTAINING FRAGMENT CLASS wineries<region> AS fc_winery
JOIN BY [region.id=fc_winery.region AND
region.id=pc_winery.region]
FRAGMENT CLASS regions<id> AS region
PARAMETER MAP id AS region
JOIN BY [wine.region=region.id];

 

Text

 

4.13 Edit Page Class

4.13.1 Add Fragment Class to Page Class

Syntax simple (no external and internal links)

"ALTER PAGE CLASS" className
"ADD FRAGMENT CLASS" className "AS" name
["PARAMETER MAP" paramName "AS" paramName
{, paramName "AS" paramName} ]
";"
Syntax complete (including external and internal links)
"ALTER PAGE CLASS" className
["REFFERING TO FRAGMENT CLASS" className "AS" name
{ ; className "AS" name } ]
"ADD FRAGMENT CLASS" className "AS" name
["PARAMETER MAP" paramName "AS" paramName
{, paramName "AS" paramName} ]
{ ("INTERNAL LINK TO FRAGMENT CLASS" className ["AS" name]
"JOIN BY ["joinClause"]"
| "EXTERNAL LINK TO PAGE CLASS" className ["AS" name]
"CONTAINING FRAGMENT CLASS" className ["AS" name]
"JOIN BY" [joinClause]
)
}";"


Text
Example X
ALTER PAGE CLASS
Text

 

4.13.2 Remove Fragment Class from Page Class

Syntax

"ALTER PAGE CLASS" className
"DROP FRAGMENT CLASS" className";"

Removes the fragment class mapping to an page class. All mapped fragment classes can be removed from a page class except its foundation fragment class.
was passiert wenn auf diese fragment class verlinkt wird? soll beim löschen der link ebenfalls entfernt werden? oder soll dann beim verlinken ein 404 aufgezeigt werden?

Preconditions

  • fragment class may not be foundation fragment class for page class

Example X

ALTER PAGE CLASS wines<region>
DROP FRAGMENT CLASS wineries<region>;

Removes the fragment class mapping for wineries<region> to the page class wines<region>. All XML documents for this page class are automatically being regenerated.

4.14 Delete Page Class

Syntax

"DROP PAGE CLASS" className;

Text

Example X

DROP PAGE CLASS wineries<region>;

Text

4.15 Display Page Class

Syntax

"SHOW PAGE CLASS" ( className | * ) ";"

Using this statement works for two options. Either displaying a list of all generated page classes, or displaying information about one specific page class. The list of generated page classes outputs their names. The detail information about one page class contains its name, parameters, foundation fragment class, fragment classes and its publication specification.

Example 24

SHOW PAGE CLASS *;

Displays a list of all generated page classes.

Example 25

SHOW PAGE CLASS wines<region>;

Displays detailed information about the page class wines<region>.


Figure 14 : Console showing page class details