node.vwf.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
  2. # Secretary of Defense (Personnel & Readiness).
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  5. # in compliance with the License. You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software distributed under the License
  10. # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  11. # or implied. See the License for the specific language governing permissions and limitations under
  12. # the License.
  13. ## The component representation of a node - this is the base unit in VWF.
  14. ##
  15. ## All components in an application extend node.vwf. They can then add their own properties,
  16. ## methods, events, and children.
  17. ##
  18. ## When a property is added to a component, its default value is null.
  19. ## Alternately, it can be given a starting value. Here is an example in yaml:
  20. ##
  21. ## properties:
  22. ## myProperty: "fancy"
  23. ##
  24. ## Setter and getter functions can be added to control access to the property:
  25. ##
  26. ## properties:
  27. ## myProperty:
  28. ## set: |
  29. ## if ( value == "fancy" ) {
  30. ## this.myProperty = value + " coding!";
  31. ## } else {
  32. ## this.myProperty = value;
  33. ## }
  34. ## get: |
  35. ## return this.myProperty;
  36. ## value: "fancy"
  37. ##
  38. ## Note:
  39. ## If an incoming value is "transformed" before being set (as in the case above, where "coding!"
  40. ## might be added to the end of the string), the value that will be sent with the "satProperty"
  41. ## event will be the transformed value "fancy coding!", not the value that came into the setter
  42. ## ("fancy").
  43. ##
  44. ## @name node.vwf
  45. ## @namespace
  46. ## -----!!!!!-----
  47. ## Note: This file is for documentation purposes only - these properties, methods, etc are actually internal VWF
  48. ## kernel operations. Changing this file will not change how node works.
  49. ## -----!!!!!-----
  50. ---
  51. extends: http://vwf.example.com/node.vwf
  52. properties:
  53. ## ID of node
  54. ##
  55. ## @name node.vwf#id
  56. ## @property
  57. id:
  58. ## Name of node
  59. ##
  60. ## @name node.vwf#name
  61. ## @property
  62. name:
  63. ## Parent of node
  64. ##
  65. ## @name node.vwf#parent
  66. ## @property
  67. parent:
  68. ## Children of node
  69. ##
  70. ## @name node.vwf#children
  71. ## @property
  72. children:
  73. methods:
  74. ## (Do stuff)
  75. ##
  76. ## @name node.vwf#methodName
  77. ## @function
  78. ##
  79. ## @param {Type} paramName
  80. ## @param {Type} param2Name
  81. ##
  82. ## @returns undefined (or what it returns)
  83. methodName:
  84. parameters:
  85. - paramName
  86. - param2Name
  87. events:
  88. ## @name node.vwf#eventName
  89. ## @event
  90. ##
  91. ## @param {Type} paramName
  92. ## @param {Type} param2Name
  93. eventName: