WanaPlan

API Docs for: 2.7.0
Show:

BaseStructure

Module: Component
Parent Module: Wanaplan

Summary

Base Virtual Class for component's data

Constructor

BaseStructure

Syntax

BaseStructure

(
  • [name]
)

Summary

Parameters:

  • [name] String optional

    A generic name for the data type

Methods

add

Syntax

add

(
  • propertyName
  • value
)
private

Summary

Adds an element to the collection in parameter.

Parameters:

  • propertyName String

    Name of the dictionnary.

  • value Object

    Value to distribute.

Returns:

Returns true if the value is added else returns false.

Deserialize

Syntax

Deserialize

(
  • hybrid
)
Object static

Summary

Deserializes the object (from JSON). This method is the static version of deserialize, it creates an object.

Parameters:

  • hybrid Object

    JSON describing the object, built with the method serialize.

Returns:

Object:

The Structure object built from the deserialization

deserialize

Syntax

deserialize

(
  • hybrid
)
Object

Summary

Deserializes the object (from JSON).

Parameters:

  • hybrid Object

    JSON describing the object, built with the method serialize.

Returns:

Object:

The Structure object built from the deserialization

getElementByName

Syntax

getElementByName

(
  • name
  • collection
)
Object private

Summary

Gets an element of the collection by its name.

Parameters:

  • name String

    The name of the element to search.

  • collection String

    The name of the collection in which we want to search. If this parameter is not defined, the search is done in all the collection of type array.

Returns:

Object:

Returns the needed element if it exists, else returns null.

getFloor

Syntax

getFloor

(
  • collection
)
FloorStructure

Summary

Gets the floor referencing this object

Parameters:

  • collection String

    Collection to search within.

Returns:

FloorStructure:

The floor containing this structure, -1 if the object has not been added to any floor collection.

initialize

Syntax

initialize

() private

Summary

Method called after the loading of the component

serialize

Syntax

serialize

() Object

Summary

Serializes the object (to JSON)

Returns:

Object:

The serialization result, null if nothing is serialized

update

Syntax

update

()

Summary

Generic update method, must be overridden.

updateReferences

Syntax

updateReferences

(
  • structure
)

Summary

Generic method for rebuilding references after the deserialization. For example : restoring the link between a PointStructure and its parent WallStructure

Parameters:

  • structure wnp.Structure

    Floor Structure to work with

Properties

id

Syntax

id

Number

Summary

Unique ID for the structure set up automatically

name

Syntax

name

String

Summary

Structure name