@sitevision/api 1.0.20 → 1.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/hidden/javax/jcr/Binary/index.d.ts +86 -0
  2. package/hidden/javax/jcr/Credentials/index.d.ts +11 -0
  3. package/hidden/javax/jcr/ImportUUIDBehavior/index.d.ts +11 -0
  4. package/hidden/javax/jcr/Item/index.d.ts +353 -0
  5. package/hidden/javax/jcr/ItemVisitor/index.d.ts +41 -0
  6. package/hidden/javax/jcr/NamespaceRegistry/index.d.ts +100 -0
  7. package/hidden/javax/jcr/Node/index.d.ts +2808 -0
  8. package/hidden/javax/jcr/NodeIterator/index.d.ts +18 -0
  9. package/hidden/javax/jcr/Property/index.d.ts +801 -0
  10. package/hidden/javax/jcr/PropertyIterator/index.d.ts +17 -0
  11. package/hidden/javax/jcr/RangeIterator/index.d.ts +75 -0
  12. package/hidden/javax/jcr/Repository/index.d.ts +318 -0
  13. package/hidden/javax/jcr/RepositoryFactory/index.d.ts +90 -0
  14. package/hidden/javax/jcr/Value/index.d.ts +190 -0
  15. package/hidden/javax/jcr/ValueFactory/index.d.ts +179 -0
  16. package/hidden/javax/jcr/Workspace/index.d.ts +1061 -0
  17. package/hidden/javax/jcr/lock/Lock/index.d.ts +142 -0
  18. package/hidden/javax/jcr/lock/LockManager/index.d.ts +217 -0
  19. package/hidden/javax/jcr/nodetype/ItemDefinition/index.d.ts +219 -0
  20. package/hidden/javax/jcr/nodetype/NodeDefinition/index.d.ts +158 -0
  21. package/hidden/javax/jcr/nodetype/NodeDefinitionTemplate/index.d.ts +74 -0
  22. package/hidden/javax/jcr/nodetype/NodeType/index.d.ts +349 -0
  23. package/hidden/javax/jcr/nodetype/NodeTypeDefinition/index.d.ts +248 -0
  24. package/hidden/javax/jcr/nodetype/NodeTypeIterator/index.d.ts +16 -0
  25. package/hidden/javax/jcr/nodetype/NodeTypeManager/index.d.ts +218 -0
  26. package/hidden/javax/jcr/nodetype/NodeTypeTemplate/index.d.ts +98 -0
  27. package/hidden/javax/jcr/nodetype/PropertyDefinition/index.d.ts +536 -0
  28. package/hidden/javax/jcr/nodetype/PropertyDefinitionTemplate/index.d.ts +97 -0
  29. package/hidden/javax/jcr/observation/Event/index.d.ts +133 -0
  30. package/hidden/javax/jcr/observation/EventIterator/index.d.ts +20 -0
  31. package/hidden/javax/jcr/observation/EventJournal/index.d.ts +22 -0
  32. package/hidden/javax/jcr/observation/EventListener/index.d.ts +23 -0
  33. package/hidden/javax/jcr/observation/EventListenerIterator/index.d.ts +20 -0
  34. package/hidden/javax/jcr/observation/ObservationManager/index.d.ts +227 -0
  35. package/hidden/javax/jcr/query/Query/index.d.ts +201 -0
  36. package/hidden/javax/jcr/query/QueryManager/index.d.ts +73 -0
  37. package/hidden/javax/jcr/query/QueryResult/index.d.ts +51 -0
  38. package/hidden/javax/jcr/query/Row/index.d.ts +159 -0
  39. package/hidden/javax/jcr/query/RowIterator/index.d.ts +20 -0
  40. package/hidden/javax/jcr/query/qom/And/index.d.ts +26 -0
  41. package/hidden/javax/jcr/query/qom/BindVariableValue/index.d.ts +15 -0
  42. package/hidden/javax/jcr/query/qom/ChildNode/index.d.ts +27 -0
  43. package/hidden/javax/jcr/query/qom/ChildNodeJoinCondition/index.d.ts +27 -0
  44. package/hidden/javax/jcr/query/qom/Column/index.d.ts +39 -0
  45. package/hidden/javax/jcr/query/qom/Comparison/index.d.ts +82 -0
  46. package/hidden/javax/jcr/query/qom/Constraint/index.d.ts +13 -0
  47. package/hidden/javax/jcr/query/qom/DescendantNode/index.d.ts +31 -0
  48. package/hidden/javax/jcr/query/qom/DescendantNodeJoinCondition/index.d.ts +29 -0
  49. package/hidden/javax/jcr/query/qom/DynamicOperand/index.d.ts +9 -0
  50. package/hidden/javax/jcr/query/qom/EquiJoinCondition/index.d.ts +41 -0
  51. package/hidden/javax/jcr/query/qom/FullTextSearch/index.d.ts +89 -0
  52. package/hidden/javax/jcr/query/qom/FullTextSearchScore/index.d.ts +24 -0
  53. package/hidden/javax/jcr/query/qom/Join/index.d.ts +36 -0
  54. package/hidden/javax/jcr/query/qom/JoinCondition/index.d.ts +9 -0
  55. package/hidden/javax/jcr/query/qom/Length/index.d.ts +24 -0
  56. package/hidden/javax/jcr/query/qom/Literal/index.d.ts +18 -0
  57. package/hidden/javax/jcr/query/qom/LowerCase/index.d.ts +26 -0
  58. package/hidden/javax/jcr/query/qom/NodeLocalName/index.d.ts +16 -0
  59. package/hidden/javax/jcr/query/qom/NodeName/index.d.ts +16 -0
  60. package/hidden/javax/jcr/query/qom/Not/index.d.ts +20 -0
  61. package/hidden/javax/jcr/query/qom/Operand/index.d.ts +9 -0
  62. package/hidden/javax/jcr/query/qom/Or/index.d.ts +30 -0
  63. package/hidden/javax/jcr/query/qom/Ordering/index.d.ts +53 -0
  64. package/hidden/javax/jcr/query/qom/PropertyExistence/index.d.ts +24 -0
  65. package/hidden/javax/jcr/query/qom/PropertyValue/index.d.ts +25 -0
  66. package/hidden/javax/jcr/query/qom/QueryObjectModel/index.d.ts +64 -0
  67. package/hidden/javax/jcr/query/qom/QueryObjectModelConstants/index.d.ts +9 -0
  68. package/hidden/javax/jcr/query/qom/QueryObjectModelFactory/index.d.ts +638 -0
  69. package/hidden/javax/jcr/query/qom/SameNode/index.d.ts +27 -0
  70. package/hidden/javax/jcr/query/qom/SameNodeJoinCondition/index.d.ts +36 -0
  71. package/hidden/javax/jcr/query/qom/Selector/index.d.ts +35 -0
  72. package/hidden/javax/jcr/query/qom/Source/index.d.ts +9 -0
  73. package/hidden/javax/jcr/query/qom/StaticOperand/index.d.ts +10 -0
  74. package/hidden/javax/jcr/query/qom/UpperCase/index.d.ts +26 -0
  75. package/hidden/javax/jcr/retention/Hold/index.d.ts +34 -0
  76. package/hidden/javax/jcr/retention/RetentionManager/index.d.ts +189 -0
  77. package/hidden/javax/jcr/retention/RetentionPolicy/index.d.ts +21 -0
  78. package/hidden/javax/jcr/security/AccessControlEntry/index.d.ts +24 -0
  79. package/hidden/javax/jcr/security/AccessControlList/index.d.ts +91 -0
  80. package/hidden/javax/jcr/security/AccessControlManager/index.d.ts +297 -0
  81. package/hidden/javax/jcr/security/AccessControlPolicy/index.d.ts +11 -0
  82. package/hidden/javax/jcr/security/AccessControlPolicyIterator/index.d.ts +20 -0
  83. package/hidden/javax/jcr/security/NamedAccessControlPolicy/index.d.ts +22 -0
  84. package/hidden/javax/jcr/security/Privilege/index.d.ts +117 -0
  85. package/hidden/javax/jcr/version/Version/index.d.ts +121 -0
  86. package/hidden/javax/jcr/version/VersionHistory/index.d.ts +307 -0
  87. package/hidden/javax/jcr/version/VersionIterator/index.d.ts +20 -0
  88. package/hidden/javax/jcr/version/VersionManager/index.d.ts +1082 -0
  89. package/hidden/senselogic/sitevision/api/base/Builder/index.d.ts +102 -0
  90. package/hidden/senselogic/sitevision/api/base/Filter/index.d.ts +25 -0
  91. package/hidden/senselogic/sitevision/api/base/FilterSplit/index.d.ts +50 -0
  92. package/hidden/senselogic/sitevision/api/base/Loadable/index.d.ts +15 -0
  93. package/hidden/senselogic/sitevision/api/base/Resolver/index.d.ts +31 -0
  94. package/hidden/senselogic/sitevision/api/base/Wrapper/index.d.ts +24 -0
  95. package/hidden/senselogic/sitevision/api/collaboration/CollaborationGroupWrapper/index.d.ts +417 -0
  96. package/hidden/senselogic/sitevision/api/format/NumericFormatter/index.d.ts +80 -0
  97. package/hidden/senselogic/sitevision/api/format/NumericFormatterBuilder/index.d.ts +100 -0
  98. package/hidden/senselogic/sitevision/api/i18n/Currency/index.d.ts +120 -0
  99. package/hidden/senselogic/sitevision/api/link/CustomLinkProcessor/index.d.ts +45 -0
  100. package/hidden/senselogic/sitevision/api/link/CustomLinkRenderData/index.d.ts +65 -0
  101. package/hidden/senselogic/sitevision/api/mail/Mail/index.d.ts +32 -0
  102. package/hidden/senselogic/sitevision/api/message/MessageTextLinker/index.d.ts +15 -0
  103. package/hidden/senselogic/sitevision/api/metadata/value/LinkValue/index.d.ts +23 -0
  104. package/hidden/senselogic/sitevision/api/metadata/value/RelatedValue/index.d.ts +23 -0
  105. package/hidden/senselogic/sitevision/api/property/VersionedPropertyUtil/index.d.ts +642 -0
  106. package/hidden/senselogic/sitevision/api/render/BuddyIconRenderer/BuddyIconInfo/index.d.ts +51 -0
  107. package/hidden/senselogic/sitevision/api/render/ImageScaler/index.d.ts +58 -0
  108. package/hidden/senselogic/sitevision/api/render/TextModuleRenderer/index.d.ts +301 -0
  109. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/ArticleUtilConstants/index.d.ts +85 -0
  110. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/ExceptionSuppressingProxyConstants/index.d.ts +31 -0
  111. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/IndexingUtilConstants/index.d.ts +31 -0
  112. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/LinkPageUtilConstants/index.d.ts +67 -0
  113. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/MathInstanceConstants/index.d.ts +25 -0
  114. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/MimeTypeUtilConstants/index.d.ts +19 -0
  115. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/NodeTypeUtilConstants/index.d.ts +1243 -0
  116. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/OutputUtilConstants/index.d.ts +31 -0
  117. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/PageUtilConstants/index.d.ts +91 -0
  118. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/PortletContextUtilConstants/index.d.ts +27 -0
  119. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/PortletUtilConstants/index.d.ts +19 -0
  120. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/QueryStringUtilConstants/index.d.ts +19 -0
  121. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/SearchHitConstants/index.d.ts +25 -0
  122. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/SearchResultConstants/index.d.ts +37 -0
  123. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/VersionUtilConstants/index.d.ts +25 -0
  124. package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/index.d.ts +8 -0
  125. package/hidden/senselogic/sitevision/api/render/velocity/VelocityContext/index.d.ts +50 -0
  126. package/hidden/senselogic/sitevision/api/render/velocity/VelocityEvaluator/index.d.ts +89 -0
  127. package/hidden/senselogic/sitevision/api/script/RequesterChainable/index.d.ts +119 -0
  128. package/hidden/senselogic/sitevision/api/script/app/RestAppInvoker/index.d.ts +272 -0
  129. package/hidden/senselogic/sitevision/api/script/factory/TypedArgument/index.d.ts +43 -0
  130. package/hidden/senselogic/sitevision/api/script/proxy/ExceptionSuppressingCollection/index.d.ts +94 -0
  131. package/hidden/senselogic/sitevision/api/script/proxy/ExceptionSuppressingIterator/index.d.ts +117 -0
  132. package/hidden/senselogic/sitevision/api/script/proxy/ExceptionSuppressingProxy/index.d.ts +90 -0
  133. package/hidden/senselogic/sitevision/api/search/SearchFieldUtil/index.d.ts +89 -0
  134. package/hidden/senselogic/sitevision/api/search/SearchHighlighter/index.d.ts +45 -0
  135. package/hidden/senselogic/sitevision/api/search/SearchHit/index.d.ts +1176 -0
  136. package/hidden/senselogic/sitevision/api/search/SearchResult/index.d.ts +414 -0
  137. package/hidden/senselogic/sitevision/api/search/facet/SearchFacetField/index.d.ts +27 -0
  138. package/hidden/senselogic/sitevision/api/search/facet/SearchFacetValue/index.d.ts +61 -0
  139. package/hidden/senselogic/sitevision/api/search/searcher/Searcher/index.d.ts +277 -0
  140. package/hidden/senselogic/sitevision/api/search/searcher/component/Filter/index.d.ts +25 -0
  141. package/hidden/senselogic/sitevision/api/search/searcher/component/Highlight/index.d.ts +29 -0
  142. package/hidden/senselogic/sitevision/api/search/searcher/component/Monitor/index.d.ts +25 -0
  143. package/hidden/senselogic/sitevision/api/search/searcher/component/Parser/index.d.ts +35 -0
  144. package/hidden/senselogic/sitevision/api/search/searcher/component/Sort/index.d.ts +25 -0
  145. package/hidden/senselogic/sitevision/api/search/searcher/component/SpellCheck/index.d.ts +29 -0
  146. package/hidden/senselogic/sitevision/api/search/sort/CustomSort/index.d.ts +82 -0
  147. package/hidden/senselogic/sitevision/api/search/suggestion/SearchSuggestion/index.d.ts +21 -0
  148. package/hidden/senselogic/sitevision/api/security/DirectoryAttributes/index.d.ts +70 -0
  149. package/hidden/senselogic/sitevision/api/security/MessageDigester/index.d.ts +50 -0
  150. package/hidden/senselogic/sitevision/api/security/RoleAssignment/index.d.ts +72 -0
  151. package/hidden/senselogic/sitevision/api/security/RoleMatcher/index.d.ts +29 -0
  152. package/hidden/senselogic/sitevision/api/security/SecretStore/index.d.ts +55 -0
  153. package/hidden/senselogic/sitevision/api/security/UserUtil/index.d.ts +80 -0
  154. package/hidden/senselogic/sitevision/api/security/jaas/filter/AuthenticationFilter/index.d.ts +36 -0
  155. package/hidden/senselogic/sitevision/api/security/jaas/filter/AuthenticationFilterChain/index.d.ts +32 -0
  156. package/hidden/senselogic/sitevision/api/user/UserIdentityWrapper/index.d.ts +599 -0
  157. package/hidden/senselogic/sitevision/api/webresource/LinkTarget/index.d.ts +20 -0
  158. package/hidden/senselogic/sitevision/api/xml/XmlElement/index.d.ts +55 -0
  159. package/hidden/senselogic/sitevision/api/xml/XmlElementHandler/index.d.ts +17 -0
  160. package/package.json +2 -4
  161. package/server/AliasUtil/index.d.ts +25 -0
  162. package/server/AliasUtil/index.js +10 -0
  163. package/server/ArchiveUtil/index.d.ts +65 -11
  164. package/server/ArraysInstance/index.d.ts +1846 -0
  165. package/server/ArticleUtil/index.d.ts +381 -69
  166. package/server/AuthenticationUtil/index.d.ts +106 -0
  167. package/server/BookmarkUtil/index.d.ts +36 -28
  168. package/server/BuddyIconRenderer/index.d.ts +240 -0
  169. package/server/ClientUtil/index.d.ts +18 -4
  170. package/server/CollaborationFactory/index.d.ts +42 -25
  171. package/server/CollaborationGroupFolderUtil/index.d.ts +40 -29
  172. package/server/CollaborationGroupTemplateUtil/index.d.ts +71 -39
  173. package/server/CollaborationGroupUtil/index.d.ts +128 -55
  174. package/server/CollectionsInstance/index.d.ts +738 -0
  175. package/server/ColorUtil/index.d.ts +22 -17
  176. package/server/CompoundAndFilterBuilder/index.d.ts +60 -0
  177. package/server/CompoundComparatorBuilder/index.d.ts +63 -0
  178. package/server/CompoundOrFilterBuilder/index.d.ts +59 -0
  179. package/server/ContentNodeUtil/index.d.ts +76 -0
  180. package/server/CurrencyFactory/index.d.ts +135 -0
  181. package/server/DateUtil/index.d.ts +154 -77
  182. package/server/DecorationUtil/index.d.ts +23 -0
  183. package/server/DeviceUtil/index.d.ts +36 -0
  184. package/server/DirectoryUtil/index.d.ts +107 -47
  185. package/server/DocTypeUtil/index.d.ts +149 -0
  186. package/server/EndecUtil/index.d.ts +537 -91
  187. package/server/ExtendedDismaxParserBuilder/index.d.ts +311 -0
  188. package/server/FileIconRenderer/index.d.ts +346 -0
  189. package/server/FileUtil/index.d.ts +462 -0
  190. package/server/FilterBuilder/index.d.ts +120 -0
  191. package/server/FolderUtil/index.d.ts +161 -0
  192. package/server/FontUtil/index.d.ts +49 -0
  193. package/server/FormatterBuilderFactory/index.d.ts +129 -0
  194. package/server/HighlightBuilder/index.d.ts +194 -0
  195. package/server/IconUtil/index.d.ts +37 -0
  196. package/server/ImageLinkRenderer/index.d.ts +134 -0
  197. package/server/ImageRenderer/index.d.ts +613 -231
  198. package/server/ImageUtil/index.d.ts +430 -0
  199. package/server/IndexUtil/index.d.ts +71 -0
  200. package/server/IndexingUtil/index.d.ts +92 -0
  201. package/server/InstanceCreatorUtil/index.d.ts +661 -0
  202. package/server/InstanceTypeUtil/index.d.ts +202 -0
  203. package/server/JwtUtil/index.d.ts +217 -0
  204. package/server/LandingPageUtil/index.d.ts +67 -50
  205. package/server/LinkPageUtil/index.d.ts +468 -0
  206. package/server/LinkRenderer/index.d.ts +1157 -0
  207. package/server/LinkTargetBuilder/index.d.ts +146 -0
  208. package/server/LinkValueBuilder/index.d.ts +129 -52
  209. package/server/ListWrapper/index.d.ts +172 -0
  210. package/server/LocaleUtil/index.d.ts +695 -61
  211. package/server/LogUtil/index.d.ts +118 -77
  212. package/server/MailBuilder/index.d.ts +238 -0
  213. package/server/MailUtil/index.d.ts +98 -0
  214. package/server/MathInstance/index.d.ts +681 -0
  215. package/server/MessageDigesterFactory/index.d.ts +49 -0
  216. package/server/MetadataDefinitionUtil/index.d.ts +118 -0
  217. package/server/MetadataUtil/index.d.ts +524 -79
  218. package/server/MimeTypeUtil/index.d.ts +316 -0
  219. package/server/MonitorBuilder/index.d.ts +51 -0
  220. package/server/NodeComparatorUtil/index.d.ts +397 -0
  221. package/server/NodeFactoryUtil/index.d.ts +32 -0
  222. package/server/NodeFilterUtil/index.d.ts +924 -0
  223. package/server/NodeIteratorUtil/index.d.ts +322 -72
  224. package/server/NodeResolverUtil/index.d.ts +767 -0
  225. package/server/NodeTreeUtil/index.d.ts +339 -63
  226. package/server/NodeTypeUtil/index.d.ts +391 -197
  227. package/server/OfflineVersionPropertyUtil/index.d.ts +30 -0
  228. package/server/OnlineVersionPropertyUtil/index.d.ts +30 -0
  229. package/server/OutputUtil/index.d.ts +641 -0
  230. package/server/PageUtil/index.d.ts +330 -0
  231. package/server/PermissionUtil/index.d.ts +650 -0
  232. package/server/PortletContextUtil/index.d.ts +118 -37
  233. package/server/PortletContextUtil/index.js +1 -0
  234. package/server/PortletUtil/index.d.ts +40 -0
  235. package/server/PrincipalUtil/index.d.ts +51 -0
  236. package/server/Properties/index.d.ts +185 -38
  237. package/server/PropertyUtil/index.d.ts +2330 -406
  238. package/server/PublishingUtil/index.d.ts +385 -49
  239. package/server/QueryStringUtil/index.d.ts +737 -0
  240. package/server/RedirectUtil/index.d.ts +98 -0
  241. package/server/RelatedValueBuilder/index.d.ts +81 -39
  242. package/server/Requester/index.d.ts +441 -65
  243. package/server/ResourceLocatorUtil/index.d.ts +483 -227
  244. package/server/RestApi/index.d.ts +208 -23
  245. package/server/RestAppInvokerFactory/index.d.ts +73 -0
  246. package/server/RoleAssignmentBuilder/index.d.ts +60 -0
  247. package/server/RoleMatcherBuilder/index.d.ts +59 -0
  248. package/server/RoleUtil/index.d.ts +57 -0
  249. package/server/ScriptUtil/index.d.ts +625 -143
  250. package/server/SearchFactory/index.d.ts +133 -0
  251. package/server/SearchUtil/index.d.ts +164 -0
  252. package/server/SearcherBuilder/index.d.ts +260 -0
  253. package/server/Session/index.d.ts +1758 -0
  254. package/server/SimpleUserUtil/index.d.ts +39 -30
  255. package/server/SiteCookieUtil/index.d.ts +78 -53
  256. package/server/SortBuilder/index.d.ts +111 -0
  257. package/server/SpellCheckBuilder/index.d.ts +68 -0
  258. package/server/StandardParserBuilder/index.d.ts +112 -0
  259. package/server/StructureUtil/index.d.ts +167 -0
  260. package/server/SubscriberUtil/index.d.ts +122 -0
  261. package/server/SubscriptionUtil/index.d.ts +197 -0
  262. package/server/SystemUserUtil/index.d.ts +201 -98
  263. package/server/TagUtil/index.d.ts +193 -0
  264. package/server/TemplateUtil/index.d.ts +217 -0
  265. package/server/TemporaryFileNodeBuilder/index.d.ts +63 -0
  266. package/server/TemporaryNodeBuilder/index.d.ts +241 -0
  267. package/server/TextModuleRendererBuilder/index.d.ts +68 -0
  268. package/server/TimestampUtil/index.d.ts +98 -82
  269. package/server/TranslationUtil/index.d.ts +175 -0
  270. package/server/TrashcanUtil/index.d.ts +193 -24
  271. package/server/UserDataUtil/index.d.ts +167 -85
  272. package/server/UserFactory/index.d.ts +45 -30
  273. package/server/UserFieldRenderer/index.d.ts +258 -0
  274. package/server/UserIdentityUtil/index.d.ts +61 -29
  275. package/server/UserUtil/index.d.ts +69 -28
  276. package/server/Utils/index.d.ts +870 -12
  277. package/server/VelocityRenderer/index.d.ts +248 -0
  278. package/server/VersionUtil/index.d.ts +15 -12
  279. package/server/WebContentUtil/index.d.ts +644 -0
  280. package/server/WebResourceFactory/index.d.ts +66 -0
  281. package/server/XSLTUtil/index.d.ts +49 -10
  282. package/server/XmlParserUtil/index.d.ts +82 -81
  283. package/builtins/Binary/index.d.ts +0 -3
  284. package/builtins/Calendar/index.d.ts +0 -3
  285. package/builtins/Collection/index.d.ts +0 -3
  286. package/builtins/Date/index.d.ts +0 -3
  287. package/builtins/InputStream/index.d.ts +0 -3
  288. package/builtins/Instant/index.d.ts +0 -3
  289. package/builtins/List/index.d.ts +0 -3
  290. package/builtins/LocalDateTime/index.d.ts +0 -3
  291. package/builtins/Locale/index.d.ts +0 -3
  292. package/builtins/Node/index.d.ts +0 -3
  293. package/builtins/NodeIterator/index.d.ts +0 -27
  294. package/builtins/Property/index.d.ts +0 -3
  295. package/builtins/Serializable/index.d.ts +0 -3
  296. package/builtins/Set/index.d.ts +0 -3
  297. package/builtins/Throwable/index.d.ts +0 -3
  298. package/builtins/byte/index.d.ts +0 -3
@@ -1,458 +1,2382 @@
1
- import Binary from '../../builtins/Binary';
2
- import Calendar from '../../builtins/Calendar';
3
- import List from '../../builtins/List';
4
- import Node from '../../builtins/Node';
1
+ import Node from "../../hidden/javax/jcr/Node";
2
+ import Binary from "../../hidden/javax/jcr/Binary";
5
3
 
6
4
  /**
7
- * Gets a Binary property from a Node.
8
- * @returns {Binary} the value for aPropertyName as Binary. If no property exists, null is returned.
9
- * @param {Node} aNode - the Node that has a property
10
- * @param {string} aPropertyName - the name of the property
11
- */
5
+ * Gets a String property from a "nested" Node's property.
6
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code> has a
7
+ * <code>String</code> property).
8
+ *
9
+ * <p>
10
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
11
+ * Illegal characters in node names and property names must always be escaped, typically via
12
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
13
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
14
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
15
+ * (e.g. metadata properties) might contain illegal characters.
16
+ * </p>
17
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
18
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
19
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
20
+ * @return the value for aPropertyName as <code>String</code>. If no property exists, <code>null</code> is returned.
21
+ * @see #getNestedStringEscaped(javax.jcr.Node, String, String)
22
+ */
23
+ export function getNestedString(
24
+ aNode: Node,
25
+ aNodePropertyName: string,
26
+ aPropertyName: string
27
+ ): string;
28
+
29
+ /**
30
+ * Gets a String property from a "nested" Node's property and returns it XML escaped.
31
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code> has a
32
+ * <code>String</code> property).
33
+ *
34
+ * <p>
35
+ * This is a convenience method for getting a "nested" String property that also should be XML escaped. A String that should be included
36
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
37
+ * </p>
38
+ * <p>
39
+ * This Velocity code:
40
+ * </p>
41
+ * <pre><code>
42
+ * #set ($endecUtil = ...)
43
+ * #set ($propertyUtil = ...)
44
+ * ...
45
+ * &lt;p&gt;
46
+ * $endecUtil.escapeXML($propertyUtil.getNestedString($myNode, 'aNodeProperty', 'aProperty'))
47
+ * &lt;/p&gt;
48
+ * </code></pre>
49
+ * would typically be replaced with this:
50
+ * <pre><code>
51
+ * #set ($propertyUtil = ...)
52
+ * ...
53
+ * &lt;p&gt;
54
+ * $!propertyUtil.getNestedStringEscaped($myNode, 'aNodeProperty', 'aProperty')
55
+ * &lt;/p&gt;
56
+ * </code></pre>
57
+ *
58
+ * <p>
59
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
60
+ * Illegal characters in node names and property names must always be escaped, typically via
61
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
62
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
63
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
64
+ * (e.g. metadata properties) might contain illegal characters.
65
+ * </p>
66
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
67
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
68
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
69
+ * @return the value for aPropertyName as an XML escaped <code>String</code>. If no property exists, <code>null</code> is returned.
70
+ * @see #getNestedString(javax.jcr.Node, String, String)
71
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
72
+ * @since Sitevision 3.5
73
+ */
74
+ export function getNestedStringEscaped(
75
+ aNode: Node,
76
+ aNodePropertyName: string,
77
+ aPropertyName: string
78
+ ): string;
79
+
80
+ /**
81
+ * Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist.
82
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code> has a
83
+ * <code>String</code> property).
84
+ *
85
+ * <p>
86
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
87
+ * Illegal characters in node names and property names must always be escaped, typically via
88
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
89
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
90
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
91
+ * (e.g. metadata properties) might contain illegal characters.
92
+ * </p>
93
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
94
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
95
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
96
+ * @param aDefaultValue fallback value if no value exists
97
+ * @return the value for aPropertyName as <code>String</code>. If no property exists, aDefaultValue is returned.
98
+ * @see #getNestedStringEscaped(javax.jcr.Node, String, String, String)
99
+ */
100
+ export function getNestedString(
101
+ aNode: Node,
102
+ aNodePropertyName: string,
103
+ aPropertyName: string,
104
+ aDefaultValue: string
105
+ ): string;
106
+
107
+ /**
108
+ * Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist, and returns it XML escaped.
109
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
110
+ * has a <code>String</code> property).
111
+ *
112
+ * <p>
113
+ * This is a convenience method for getting a "nested" String property that also should be XML escaped. A String that should be included
114
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
115
+ * </p>
116
+ * <p>
117
+ * This Velocity code:
118
+ * </p>
119
+ * <pre><code>
120
+ * #set ($endecUtil = ...)
121
+ * #set ($propertyUtil = ...)
122
+ * ...
123
+ * &lt;p&gt;
124
+ * $endecUtil.escapeXML($propertyUtil.getNestedString($myNode, 'aNodeProperty', 'aProperty', 'a default value'))
125
+ * &lt;/p&gt;
126
+ * </code></pre>
127
+ * would typically be replaced with this:
128
+ * <pre><code>
129
+ * #set ($propertyUtil = ...)
130
+ * ...
131
+ * &lt;p&gt;
132
+ * $propertyUtil.getNestedStringEscaped($myNode, 'aNodeProperty', 'aProperty', 'a default value')
133
+ * &lt;/p&gt;
134
+ * </code></pre>
135
+ *
136
+ * <p>
137
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
138
+ * Illegal characters in node names and property names must always be escaped, typically via
139
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
140
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
141
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
142
+ * (e.g. metadata properties) might contain illegal characters.
143
+ * </p>
144
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
145
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
146
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
147
+ * @param aDefaultValue a (non XML escaped) fallback value if no value exists
148
+ * @return the value for aPropertyName as an XML escaped <code>String</code>. If no property exists, aDefaultValue is XML escaped and returned.
149
+ * @see #getNestedString(javax.jcr.Node, String, String, String)
150
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
151
+ * @since Sitevision 3.5
152
+ */
153
+ export function getNestedStringEscaped(
154
+ aNode: Node,
155
+ aNodePropertyName: string,
156
+ aPropertyName: string,
157
+ aDefaultValue: string
158
+ ): string;
159
+
160
+ /**
161
+ * Gets an int property from a "nested" Node's property.
162
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
163
+ * has an <code>int/Integer</code> property).
164
+ *
165
+ * <p>
166
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
167
+ * Illegal characters in node names and property names must always be escaped, typically via
168
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
169
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
170
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
171
+ * (e.g. metadata properties) might contain illegal characters.
172
+ * </p>
173
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
174
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
175
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
176
+ * @return the value for aPropertyName as <code>int</code>. If no property exists or it isn't compatible with an <code>int</code>, 0 is returned.
177
+ */
178
+ export function getNestedInt(
179
+ aNode: Node,
180
+ aNodePropertyName: string,
181
+ aPropertyName: string
182
+ ): number;
183
+
184
+ /**
185
+ * Gets an int property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible with the int type.
186
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
187
+ * has an <code>int/Integer</code> property).
188
+ *
189
+ * <p>
190
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
191
+ * Illegal characters in node names and property names must always be escaped, typically via
192
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
193
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
194
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
195
+ * (e.g. metadata properties) might contain illegal characters.
196
+ * </p>
197
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
198
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
199
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
200
+ * @param aDefaultValue fallback value if no value exists
201
+ * @return the value for aPropertyName as <code>int</code>. If no property exists or it isn't compatible with an <code>int</code>, aDefaultValue is returned.
202
+ */
203
+ export function getNestedInt(
204
+ aNode: Node,
205
+ aNodePropertyName: string,
206
+ aPropertyName: string,
207
+ aDefaultValue: number
208
+ ): number;
209
+
210
+ /**
211
+ * Gets a double property from a "nested" Node's property.
212
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
213
+ * has a <code>double/Double</code> property).
214
+ *
215
+ * <p>
216
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
217
+ * Illegal characters in node names and property names must always be escaped, typically via
218
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
219
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
220
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
221
+ * (e.g. metadata properties) might contain illegal characters.
222
+ * </p>
223
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
224
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
225
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
226
+ * @return the value for aPropertyName as <code>double</code>. If no property exists or it isn't compatible with a <code>double</code>, 0.0 is returned.
227
+ * @since Sitevision 2.6.1_09
228
+ */
229
+ export function getNestedDouble(
230
+ aNode: Node,
231
+ aNodePropertyName: string,
232
+ aPropertyName: string
233
+ ): number;
234
+
235
+ /**
236
+ * Gets a double property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
237
+ * with the double type.
238
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
239
+ * has a <code>double/Double</code> property).
240
+ *
241
+ * <p>
242
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
243
+ * Illegal characters in node names and property names must always be escaped, typically via
244
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
245
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
246
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
247
+ * (e.g. metadata properties) might contain illegal characters.
248
+ * </p>
249
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
250
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
251
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
252
+ * @param aDefaultValue fallback value if no value exists
253
+ * @return the value for aPropertyName as <code>double</code>. If no property exists or it isn't compatible with a <code>double</code>, aDefaultValue is returned.
254
+ * @since Sitevision 2.6.1_09
255
+ */
256
+ export function getNestedDouble(
257
+ aNode: Node,
258
+ aNodePropertyName: string,
259
+ aPropertyName: string,
260
+ aDefaultValue: number
261
+ ): number;
262
+
263
+ /**
264
+ * Gets a boolean property from a "nested" Node's property.
265
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
266
+ * has a <code>Boolean</code> property).
267
+ *
268
+ * <p>
269
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
270
+ * Illegal characters in node names and property names must always be escaped, typically via
271
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
272
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
273
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
274
+ * (e.g. metadata properties) might contain illegal characters.
275
+ * </p>
276
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
277
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
278
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
279
+ * @return the value for aPropertyName as <code>boolean</code>. If no property exists or it isn't compatible with a <code>boolean</code>, <code>false</code> is returned.
280
+ */
281
+ export function getNestedBoolean(
282
+ aNode: Node,
283
+ aNodePropertyName: string,
284
+ aPropertyName: string
285
+ ): boolean;
286
+
287
+ /**
288
+ * Gets a boolean property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
289
+ * with the boolean type.
290
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
291
+ * has a <code>Boolean</code> property).
292
+ *
293
+ * <p>
294
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
295
+ * Illegal characters in node names and property names must always be escaped, typically via
296
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
297
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
298
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
299
+ * (e.g. metadata properties) might contain illegal characters.
300
+ * </p>
301
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
302
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
303
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
304
+ * @param aDefaultValue fallback value if no value exists
305
+ * @return the value for aPropertyName as <code>boolean</code>. If no property exists or it isn't compatible with a <code>boolean</code>, aDefaultValue is returned.
306
+ */
307
+ export function getNestedBoolean(
308
+ aNode: Node,
309
+ aNodePropertyName: string,
310
+ aPropertyName: string,
311
+ aDefaultValue: boolean
312
+ ): boolean;
313
+
314
+ /**
315
+ * Gets a Node property from a "nested" Node's property.
316
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
317
+ * has a <code>Node</code> property).
318
+ *
319
+ * <p>
320
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
321
+ * Illegal characters in node names and property names must always be escaped, typically via
322
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
323
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
324
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
325
+ * (e.g. metadata properties) might contain illegal characters.
326
+ * </p>
327
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
328
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
329
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
330
+ * @return the value for aPropertyName as <code>Node</code>. If no property exists or it isn't a <code>Node</code>, <code>null</code> is returned.
331
+ */
332
+ export function getNestedNode(
333
+ aNode: Node,
334
+ aNodePropertyName: string,
335
+ aPropertyName: string
336
+ ): Node;
337
+
338
+ /**
339
+ * Gets a Node property from a "nested" Node's property with a fallback value if the property doesn't exist.
340
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
341
+ * has a <code>Node</code> property).
342
+ *
343
+ * <p>
344
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
345
+ * Illegal characters in node names and property names must always be escaped, typically via
346
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
347
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
348
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
349
+ * (e.g. metadata properties) might contain illegal characters.
350
+ * </p>
351
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
352
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
353
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
354
+ * @param aDefaultValue fallback value if no value exists
355
+ * @return the value for aPropertyName as <code>Node</code>. If no property exists or it isn't a <code>Node</code>, aDefaultValue is returned.
356
+ */
357
+ export function getNestedNode(
358
+ aNode: Node,
359
+ aNodePropertyName: string,
360
+ aPropertyName: string,
361
+ aDefaultValue: Node
362
+ ): Node;
363
+
364
+ /**
365
+ * Gets a Binary property from a Node.
366
+ *
367
+ * <p>
368
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
369
+ * you must also <code>close</code> the stream when you are done.
370
+ * </p>
371
+ *
372
+ * <p>
373
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
374
+ * </p>
375
+ *
376
+ * <p>
377
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
378
+ * Illegal characters in node names and property names must always be escaped, typically via
379
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
380
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
381
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
382
+ * (e.g. metadata properties) might contain illegal characters.
383
+ * </p>
384
+ * @param aNode the <code>Node</code> that has a property
385
+ * @param aPropertyName the name of the property
386
+ * @return the value for aPropertyName as <code>Binary</code>. If no property exists, <code>null</code> is returned.
387
+ * @since Sitevision 3.5
388
+ */
12
389
  export function getBinary(aNode: Node, aPropertyName: string): Binary;
13
390
 
14
391
  /**
15
- * Gets a Binary property from a node with a fallback value if the property doesn't exist.
16
- * @returns {Binary} the value for aPropertyName as Binary. If no property exists, aDefaultValue is returned.
17
- * @param {Node} aNode - the Node that has a property
18
- * @param {string} aPropertyName - the name of the property
19
- * @param {Binary} aDefaultValue - fallback value if no value exists
20
- */
21
- export function getBinary(aNode: Node, aPropertyName: string, aDefaultValue: Binary): Binary;
392
+ * Gets a Binary property from a node with a fallback value if the property doesn't exist.
393
+ *
394
+ * <p>
395
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
396
+ * you must also <code>close</code> the stream when you are done.
397
+ * </p>
398
+ *
399
+ * <p>
400
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
401
+ * </p>
402
+ *
403
+ * <p>
404
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
405
+ * Illegal characters in node names and property names must always be escaped, typically via
406
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
407
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
408
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
409
+ * (e.g. metadata properties) might contain illegal characters.
410
+ * </p>
411
+ * @param aNode the <code>Node</code> that has a property
412
+ * @param aPropertyName the name of the property
413
+ * @param aDefaultValue fallback value if no value exists
414
+ * @return the value for aPropertyName as <code>Binary</code>. If no property exists, aDefaultValue is returned.
415
+ * @since Sitevision 3.5
416
+ */
417
+ export function getBinary(
418
+ aNode: Node,
419
+ aPropertyName: string,
420
+ aDefaultValue: Binary
421
+ ): Binary;
22
422
 
23
423
  /**
24
- * Gets a boolean property from a Node.
25
- * @returns {boolean} the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean,false is returned.
26
- * @param {Node} aNode - the Node that has a property
27
- * @param {string} aPropertyName - the name of the property
28
- */
29
- export function getBoolean(aNode: Node, aPropertyName: string): boolean;
424
+ * Gets a Binary property from a "nested" Node's property.
425
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
426
+ * has a <code>Binary</code> property).
427
+ *
428
+ * <p>
429
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
430
+ * you must also <code>close</code> the stream when you are done.
431
+ * </p>
432
+ *
433
+ * <p>
434
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
435
+ * </p>
436
+ *
437
+ * <p>
438
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
439
+ * Illegal characters in node names and property names must always be escaped, typically via
440
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
441
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
442
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
443
+ * (e.g. metadata properties) might contain illegal characters.
444
+ * </p>
445
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
446
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on <code>aNode</code>
447
+ * @param aPropertyName the name of the Binary property for the "inner/nested" <code>Node</code>
448
+ * @return the value for aPropertyName as <code>Binary</code>. If no property exists or it isn't a <code>Binary</code>, <code>null</code> is returned.
449
+ * @since Sitevision 3.5
450
+ */
451
+ export function getNestedBinary(
452
+ aNode: Node,
453
+ aNodePropertyName: string,
454
+ aPropertyName: string
455
+ ): Binary;
456
+
457
+ /**
458
+ * Gets a Binary property from a "nested" Node's property with a fallback value if the property doesn't exist.
459
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
460
+ * has a <code>Binary</code> property).
461
+ *
462
+ * <p>
463
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
464
+ * you must also <code>close</code> the stream when you are done.
465
+ * </p>
466
+ *
467
+ * <p>
468
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
469
+ * </p>
470
+ *
471
+ * <p>
472
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
473
+ * Illegal characters in node names and property names must always be escaped, typically via
474
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
475
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
476
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
477
+ * (e.g. metadata properties) might contain illegal characters.
478
+ * </p>
479
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
480
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on <code>aNode</code>
481
+ * @param aPropertyName the name of the Binary property for the "inner/nested" <code>Node</code>
482
+ * @param aDefaultValue fallback value if no value exists
483
+ * @return the value for aPropertyName as <code>Binary</code>. If no property exists or it isn't a <code>Binary</code>, aDefaultValue is returned.
484
+ * @since Sitevision 3.5
485
+ */
486
+ export function getNestedBinary(
487
+ aNode: Node,
488
+ aNodePropertyName: string,
489
+ aPropertyName: string,
490
+ aDefaultValue: Binary
491
+ ): Binary;
30
492
 
31
493
  /**
32
- * Gets a boolean property from a Node with a fallback value if the property doesn't exist or is incompatible with the boolean type.
33
- * @returns {boolean} the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean,aDefaultValue is returned.
34
- * @param {Node} aNode - the Node that has a property
35
- * @param {string} aPropertyName - the name of the property
36
- * @param {boolean} aDefaultValue - fallback value if no value exists
37
- */
38
- export function getBoolean(aNode: Node, aPropertyName: string, aDefaultValue: boolean): boolean;
494
+ * Gets a String property from a Node.
495
+ *
496
+ * <p>
497
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
498
+ * Illegal characters in node names and property names must always be escaped, typically via
499
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
500
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
501
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
502
+ * (e.g. metadata properties) might contain illegal characters.
503
+ * </p>
504
+ * @param aNode the <code>Node</code> that has a property
505
+ * @param aPropertyName the name of the property
506
+ * @return the value for aPropertyName as <code>String</code>. If no property exists, <code>null</code> is returned.
507
+ * @see #getStringEscaped(javax.jcr.Node, String)
508
+ */
509
+ export function getString(aNode: Node, aPropertyName: string): string;
39
510
 
40
511
  /**
41
- * Gets a Calendar property from a Node.
42
- * @returns {Calendar} the value for aPropertyName as Calendar. If no property exists or it isn't a Calendar,null is returned.
43
- * @param {Node} aNode - the Node that has a property
44
- * @param {string} aPropertyName - the name of the property
45
- */
46
- export function getCalendar(aNode: Node, aPropertyName: string): Calendar;
512
+ * Gets a String property from a Node and returns it XML escaped.
513
+ *
514
+ * <p>
515
+ * This is a convenience method for getting a String property that also should be XML escaped. A String that should be included
516
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
517
+ * </p>
518
+ * <p>
519
+ * This Velocity code:
520
+ * </p>
521
+ * <pre><code>
522
+ * #set ($endecUtil = ...)
523
+ * #set ($propertyUtil = ...)
524
+ * ...
525
+ * &lt;p&gt;
526
+ * $endecUtil.escapeXML($propertyUtil.getString($myNode, 'aProperty'))
527
+ * &lt;/p&gt;
528
+ * </code></pre>
529
+ * would typically be replaced with this:
530
+ * <pre><code>
531
+ * #set ($propertyUtil = ...)
532
+ * ...
533
+ * &lt;p&gt;
534
+ * $!propertyUtil.getStringEscaped($myNode, 'aProperty')
535
+ * &lt;/p&gt;
536
+ * </code></pre>
537
+ *
538
+ * <p>
539
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
540
+ * Illegal characters in node names and property names must always be escaped, typically via
541
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
542
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
543
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
544
+ * (e.g. metadata properties) might contain illegal characters.
545
+ * </p>
546
+ * @param aNode the <code>Node</code> that has a property
547
+ * @param aPropertyName the name of the property
548
+ * @return the value for aPropertyName as an XML escaped <code>String</code>. If no property exists, <code>null</code> is returned.
549
+ * @see #getString(javax.jcr.Node, String)
550
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
551
+ * @since Sitevision 3.5
552
+ */
553
+ export function getStringEscaped(aNode: Node, aPropertyName: string): string;
47
554
 
48
555
  /**
49
- * Gets a Calendar property from a Node with a fallback value if the property doesn't exist or is incompatible with the Calendar type.
50
- * @returns {Calendar} the value for aPropertyName as Calendar. If no property exists or it isn't compatible with a Calendar,aDefaultValue is returned.
51
- * @param {Node} aNode - the Node that has a property
52
- * @param {string} aPropertyName - the name of the property
53
- * @param {Calendar} aDefaultValue - fallback value if no value exists
54
- */
55
- export function getCalendar(aNode: Node, aPropertyName: string, aDefaultValue: Calendar): Calendar;
556
+ * Gets a String property from a node with a fallback value if the property doesn't exist.
557
+ *
558
+ * <p>
559
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
560
+ * Illegal characters in node names and property names must always be escaped, typically via
561
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
562
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
563
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
564
+ * (e.g. metadata properties) might contain illegal characters.
565
+ * </p>
566
+ * @param aNode the <code>Node</code> that has a property
567
+ * @param aPropertyName the name of the property
568
+ * @param aDefaultValue fallback value if no value exists
569
+ * @return the value for aPropertyName as <code>String</code>. If no property exists, aDefaultValue is returned.
570
+ * @see #getStringEscaped(javax.jcr.Node, String, String)
571
+ */
572
+ export function getString(
573
+ aNode: Node,
574
+ aPropertyName: string,
575
+ aDefaultValue: string
576
+ ): string;
56
577
 
57
578
  /**
58
- * Gets a double property from a Node.
59
- * @returns {number} the double value for aPropertyName. If no property exists or it isn't compatible with a double,0.0 is returned.
60
- * @param {Node} aNode - the Node that has a property
61
- * @param {string} aPropertyName - the name of the property
62
- */
63
- export function getDouble(aNode: Node, aPropertyName: string): number;
579
+ * Gets a String property from a Node, with a fallback value, and returns it XML escaped.
580
+ *
581
+ * <p>
582
+ * This is a convenience method for getting a String property that also should be XML escaped. A String that should be included
583
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
584
+ * </p>
585
+ * <p>
586
+ * This Velocity code:
587
+ * </p>
588
+ * <pre><code>
589
+ * #set ($endecUtil = ...)
590
+ * #set ($propertyUtil = ...)
591
+ * ...
592
+ * &lt;p&gt;
593
+ * $endecUtil.escapeXML($propertyUtil.getString($myNode, 'aProperty', 'a default value'))
594
+ * &lt;/p&gt;
595
+ * </code></pre>
596
+ * would typically be replaced with this:
597
+ * <pre><code>
598
+ * #set ($propertyUtil = ...)
599
+ * ...
600
+ * &lt;p&gt;
601
+ * $propertyUtil.getStringEscaped($myNode, 'aProperty', 'a default value')
602
+ * &lt;/p&gt;
603
+ * </code></pre>
604
+ *
605
+ * <p>
606
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
607
+ * Illegal characters in node names and property names must always be escaped, typically via
608
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
609
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
610
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
611
+ * (e.g. metadata properties) might contain illegal characters.
612
+ * </p>
613
+ * @param aNode the <code>Node</code> that has a property
614
+ * @param aPropertyName the name of the property
615
+ * @param aDefaultValue a (non XML escaped) fallback value if no value exists
616
+ * @return the value for aPropertyName as an XML escaped <code>String</code>. If no property exists, aDefaultValue is XML escaped and returned.
617
+ * @see #getString(javax.jcr.Node, String, String)
618
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
619
+ * @since Sitevision 3.5
620
+ */
621
+ export function getStringEscaped(
622
+ aNode: Node,
623
+ aPropertyName: string,
624
+ aDefaultValue: string
625
+ ): string;
64
626
 
65
627
  /**
66
- * Gets a double property from a node with a fallback value if the property doesn't exist or is incompatible with the double type.
67
- * @returns {number} the double value for aPropertyName. If no property exists or it isn't compatible with a double,aDefaultValue is returned.
68
- * @param {Node} aNode - the Node that has a property
69
- * @param {string} aPropertyName - the name of the property
70
- * @param {number} aDefaultValue - fallback value if no value exists
71
- */
72
- export function getDouble(aNode: Node, aPropertyName: string, aDefaultValue: number): number;
73
-
74
- /**
75
- * Gets a Node property from a Node if an enabling property allows it.
76
- * @returns {Node} the value for aNodePropertyName as Node. If no property exists or it isn't a Node,null is returned.A Node will never be returned if aEnablingPropertyName doesn't exist, isn't compatible with aboolean or isn't true.
77
- * @param {Node} aNode - the Node that has the properties
78
- * @param {string} aEnablingPropertyName - the name of the boolean property that enables the Node denoted by aPropertyName
79
- * @param {string} aNodePropertyName - the name of the property
80
- */
81
- export function getEnabledNode(aNode: Node, aEnablingPropertyName: string, aNodePropertyName: string): Node;
82
-
83
- /**
84
- * Gets a Node property from a Node if an enabling property allows it, with a fallback Node value.
85
- * @returns {Node} the value for aNodePropertyName as Node. If no property exists or it isn't a Node,aDefaultValue is returned.If aEnablingPropertyName doesn't exist, isn't compatible with a boolean or isn't true,aDefaultValue is returned.
86
- * @param {Node} aNode - the Node that has the properties
87
- * @param {string} aEnablingPropertyName - the name of the boolean property that enables the Node denoted by aPropertyName
88
- * @param {string} aNodePropertyName - the name of the property
89
- * @param {Node} aDefaultValue - fallback value if no value exists
90
- */
91
- export function getEnabledNode(aNode: Node, aEnablingPropertyName: string, aNodePropertyName: string, aDefaultValue: Node): Node;
92
-
93
- /**
94
- * Gets a String property from a Node if an enabling boolean property allows it.
95
- * @returns {string} the value for aStringPropertyName as String. If no property exists, null is returned.Null will always be returned if aEnablingPropertyName doesn't exist, isn't compatible with a booleanor isn't true.
96
- * @param {Node} aNode - the Node that has the properties
97
- * @param {string} aEnablingPropertyName - the name of the boolean property that enables the String denoted by aStringPropertyName
98
- * @param {string} aStringPropertyName - the name of the String property
99
- */
100
- export function getEnabledString(aNode: Node, aEnablingPropertyName: string, aStringPropertyName: string): string;
101
-
102
- /**
103
- * Gets a String property from a Node if an enabling boolean property allows it, with a fallback value.
104
- * @returns {string} the value for aStringPropertyName as String. If no property exists, aDefaultValue is returned. aDefaultValue will always be returned if aEnablingPropertyName doesn't exist, isn't compatible with a boolean or isn't true.
105
- * @param {Node} aNode - the Node that has the properties
106
- * @param {string} aEnablingPropertyName - the name of the boolean property that enables the String denoted by aStringPropertyName
107
- * @param {string} aStringPropertyName - the name of the String property
108
- * @param {string} aDefaultValue - fallback value to return if no value exist
109
- */
110
- export function getEnabledString(aNode: Node, aEnablingPropertyName: string, aStringPropertyName: string, aDefaultValue: string): string;
111
-
112
- /**
113
- * Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped.
114
- * @returns {string} the value for aStringPropertyName as a XML escaped String. If no property exists, null is returned. Null will always be returned if aEnablingPropertyName doesn't exist, isn't compatible with a boolean or isn't true.
115
- * @param {Node} aNode - the Node that has the properties
116
- * @param {string} aEnablingPropertyName - the name of the boolean property that enables the String denoted by aStringPropertyName
117
- * @param {string} aStringPropertyName - the name of the String property
118
- */
119
- export function getEnabledStringEscaped(aNode: Node, aEnablingPropertyName: string, aStringPropertyName: string): string;
120
-
121
- /**
122
- * Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped with a fallback value.
123
- * @returns {string} the value for aStringPropertyName as a XML escaped String. If no property exists, aDefaultValue isXML escaped and returned.aDefaultValue will always be XML escaped and returned if aEnablingPropertyName doesn't exist,isn't compatible with a boolean or isn't true.
124
- * @param {Node} aNode - the Node that has the properties
125
- * @param {string} aEnablingPropertyName - the name of the boolean property that enables the String denoted by aStringPropertyName
126
- * @param {string} aStringPropertyName - the name of the String property
127
- * @param {string} aDefaultValue - the (non XML escaped) fallback value to return if no value exist
128
- */
129
- export function getEnabledStringEscaped(aNode: Node, aEnablingPropertyName: string, aStringPropertyName: string, aDefaultValue: string): string;
130
-
131
- /**
132
- * Gets an int property from a Node.
133
- * @returns {number} the int value for aPropertyName. If no property exists or it isn't compatible with an int, 0 is returned.
134
- * @param {Node} aNode - the Node that has a property
135
- * @param {string} aPropertyName - the name of the property
136
- */
628
+ * Gets an int property from a Node.
629
+ *
630
+ * <p>
631
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
632
+ * Illegal characters in node names and property names must always be escaped, typically via
633
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
634
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
635
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
636
+ * (e.g. metadata properties) might contain illegal characters.
637
+ * </p>
638
+ * @param aNode the <code>Node</code> that has a property
639
+ * @param aPropertyName the name of the property
640
+ * @return the <code>int</code> value for aPropertyName. If no property exists or it isn't compatible with an <code>int</code>, 0 is returned.
641
+ */
137
642
  export function getInt(aNode: Node, aPropertyName: string): number;
138
643
 
139
644
  /**
140
- * Gets an int property from a node with a fallback value if the property doesn't exist or is incompatible with the int type.
141
- * @returns {number} the int value for aPropertyName. If no property exists or it isn't compatible with an int,aDefaultValue is returned.
142
- * @param {Node} aNode - the Node that has a property
143
- * @param {string} aPropertyName - the name of the property
144
- * @param {number} aDefaultValue - fallback value if no value exists
145
- */
146
- export function getInt(aNode: Node, aPropertyName: string, aDefaultValue: number): number;
147
-
148
- /**
149
- * Gets a Binary property from a "nested" Node's property.
150
- * @returns {Binary} the value for aPropertyName as Binary. If no property exists or it isn't a Binary,null is returned.
151
- * @param {Node} aNode - the base Node that has a property that is a Node
152
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
153
- * @param {string} aPropertyName - the name of the Binary property for the "inner/nested" Node
154
- */
155
- export function getNestedBinary(aNode: Node, aNodePropertyName: string, aPropertyName: string): Binary;
156
-
157
- /**
158
- * Gets a Binary property from a "nested" Node's property with a fallback value if the property doesn't exist.
159
- * @returns {Binary} the value for aPropertyName as Binary. If no property exists or it isn't a Binary, aDefaultValue is returned.
160
- * @param {Node} aNode - the base Node that has a property that is a Node
161
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
162
- * @param {string} aPropertyName - the name of the Binary property for the "inner/nested" Node
163
- * @param {Binary} aDefaultValue - fallback value if no value exists
164
- */
165
- export function getNestedBinary(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: Binary): Binary;
166
-
167
- /**
168
- * Gets a boolean property from a "nested" Node's property.
169
- * @returns {boolean} the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean,false is returned.
170
- * @param {Node} aNode - the base Node that has a property that is a Node
171
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
172
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
173
- */
174
- export function getNestedBoolean(aNode: Node, aNodePropertyName: string, aPropertyName: string): boolean;
175
-
176
- /**
177
- * Gets a boolean property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
178
- with the boolean type.
179
- * @returns {boolean} the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean, aDefaultValue is returned.
180
- * @param {Node} aNode - the base Node that has a property that is a Node
181
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
182
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
183
- * @param {boolean} aDefaultValue - fallback value if no value exists
184
- */
185
- export function getNestedBoolean(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: boolean): boolean;
186
-
187
- /**
188
- * Gets a Calendar property from a "nested" Node's property.
189
- * @returns {Calendar} the value for aPropertyName as Calendar. If no property exists or it isn't a Calendar,null is returned.
190
- * @param {Node} aNode - the base Node that has a property that is a Node
191
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
192
- * @param {string} aPropertyName - the name of the Calendar property for the "inner/nested" Node
193
- */
194
- export function getNestedCalendar(aNode: Node, aNodePropertyName: string, aPropertyName: string): Calendar;
195
-
196
- /**
197
- * Gets a Calendar property from a "nested" Node's property with a fallback value if the property doesn't exist.
198
- * @returns {Calendar} the value for aPropertyName as Calendar. If no property exists or it isn't a Calendar,aDefaultValue is returned.
199
- * @param {Node} aNode - the base Node that has a property that is a Node
200
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
201
- * @param {string} aPropertyName - the name of the Calendar property for the "inner/nested" Node
202
- * @param {Calendar} aDefaultValue - fallback value if no value exists
203
- */
204
- export function getNestedCalendar(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: Calendar): Calendar;
205
-
206
- /**
207
- * Gets a double property from a "nested" Node's property.
208
- * @returns {number} the value for aPropertyName as double. If no property exists or it isn't compatible with a double,0.0 is returned.
209
- * @param {Node} aNode - the base Node that has a property that is a Node
210
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
211
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
212
- */
213
- export function getNestedDouble(aNode: Node, aNodePropertyName: string, aPropertyName: string): number;
214
-
215
- /**
216
- * Gets a double property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
217
- with the double type.
218
- * @returns {number} the value for aPropertyName as double. If no property exists or it isn't compatible with a double, aDefaultValue is returned.
219
- * @param {Node} aNode - the base Node that has a property that is a Node
220
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
221
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
222
- * @param {number} aDefaultValue - fallback value if no value exists
223
- */
224
- export function getNestedDouble(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: number): number;
225
-
226
- /**
227
- * Gets an int property from a "nested" Node's property.
228
- * @returns {number} the value for aPropertyName as int. If no property exists or it isn't compatible with an int, 0 is returned.
229
- * @param {Node} aNode - the base Node that has a property that is a Node
230
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
231
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
232
- */
233
- export function getNestedInt(aNode: Node, aNodePropertyName: string, aPropertyName: string): number;
234
-
235
- /**
236
- * Gets an int property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible with the int type.
237
- * @returns {number} the value for aPropertyName as int. If no property exists or it isn't compatible with an int,aDefaultValue is returned.
238
- * @param {Node} aNode - the base Node that has a property that is a Node
239
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
240
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
241
- * @param {number} aDefaultValue - fallback value if no value exists
242
- */
243
- export function getNestedInt(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: number): number;
244
-
245
- /**
246
- * Gets a Node property from a "nested" Node's property.
247
- * @returns {Node} the value for aPropertyName as Node. If no property exists or it isn't a Node, null is returned.
248
- * @param {Node} aNode - the base Node that has a property that is a Node
249
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
250
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
251
- */
252
- export function getNestedNode(aNode: Node, aNodePropertyName: string, aPropertyName: string): Node;
253
-
254
- /**
255
- * Gets a Node property from a "nested" Node's property with a fallback value if the property doesn't exist.
256
- * @returns {Node} the value for aPropertyName as Node. If no property exists or it isn't a Node, aDefaultValue is returned.
257
- * @param {Node} aNode - the base Node that has a property that is a Node
258
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
259
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
260
- * @param {Node} aDefaultValue - fallback value if no value exists
261
- */
262
- export function getNestedNode(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: Node): Node;
263
-
264
- /**
265
- * Gets a String property from a "nested" Node's property.
266
- * @returns {string} the value for aPropertyName as String. If no property exists, null is returned.
267
- * @param {Node} aNode - the base Node that has a property that is a Node
268
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
269
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
270
- */
271
- export function getNestedString(aNode: Node, aNodePropertyName: string, aPropertyName: string): string;
272
-
273
- /**
274
- * Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist.
275
- * @returns {string} the value for aPropertyName as String. If no property exists, aDefaultValue is returned.
276
- * @param {Node} aNode - the base Node that has a property that is a Node
277
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
278
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
279
- * @param {string} aDefaultValue - fallback value if no value exists
280
- */
281
- export function getNestedString(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: string): string;
282
-
283
- /**
284
- * Gets a String property from a "nested" Node's property and returns it XML escaped.
285
- * @returns {string} the value for aPropertyName as an XML escaped String. If no property exists, null is returned.
286
- * @param {Node} aNode - the base Node that has a property that is a Node
287
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
288
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
289
- */
290
- export function getNestedStringEscaped(aNode: Node, aNodePropertyName: string, aPropertyName: string): string;
291
-
292
- /**
293
- * Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist, and returns it XML escaped.
294
- * @returns {string} the value for aPropertyName as an XML escaped String. If no property exists, aDefaultValue is XML escaped and returned.
295
- * @param {Node} aNode - the base Node that has a property that is a Node
296
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
297
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
298
- * @param {string} aDefaultValue - a (non XML escaped) fallback value if no value exists
299
- */
300
- export function getNestedStringEscaped(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: string): string;
301
-
302
- /**
303
- * Gets a List of property values from a "nested" Node's property.
304
- * @returns {List<string>} the string value(s) for aPropertyName as a List. If no property exists, null is returned.
305
- * @param {Node} aNode - the base Node that has a property that is a Node
306
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
307
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
308
- */
309
- export function getNestedStrings(aNode: Node, aNodePropertyName: string, aPropertyName: string): List<string>;
310
-
311
- /**
312
- * Gets a List of property values from a "nested" Node's property with a fallback value if the property doesn't exist.
313
- * @returns {List<string>} the string value(s) for aPropertyName as a List. If no property exists, aDefaultValue is returned.
314
- * @param {Node} aNode - the base Node that has a property that is a Node
315
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
316
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
317
- * @param {List<string>} aDefaultValue - fallback value if no value exists
318
- */
319
- export function getNestedStrings(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: List<string>): List<string>;
320
-
321
- /**
322
- * Gets a List of XML escaped property values from a "nested" Node's property.
323
- * @returns {List<string>} the string value(s) for aPropertyName as a List. If no property exists, null is returned.
324
- * @param {Node} aNode - the base Node that has a property that is a Node
325
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
326
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
327
- */
328
- export function getNestedStringsEscaped(aNode: Node, aNodePropertyName: string, aPropertyName: string): List<string>;
329
-
330
- /**
331
- * Gets a List of property values from a "nested" Node's property with a fallback value if the property doesn't exist,
332
- and returns it XML escaped.
333
- * @returns {List<string>} the string value(s) for aPropertyName as a List. If no property exists, aDefaultValueis XML escaped and returned.
334
- * @param {Node} aNode - the base Node that has a property that is a Node
335
- * @param {string} aNodePropertyName - the name of the "inner/nested" Node that is a property on aNode
336
- * @param {string} aPropertyName - the name of the property for the "inner/nested" Node
337
- * @param {List<string>} aDefaultValue - fallback list if no value exists. Note! The actual fallback list is never returned,
338
- * but it's values might be used. If the fallback list are about to be returned, a copy of it will be created and all values from the fallback list will
339
- * be XML escaped and added to the new list before it is returned.
340
- */
341
- export function getNestedStringsEscaped(aNode: Node, aNodePropertyName: string, aPropertyName: string, aDefaultValue: List<string>): List<string>;
342
-
343
- /**
344
- * Gets a Node property from a Node.
345
- * @returns {Node} the value for aPropertyName as Node. If no property exists or it isn't a Node, null is returned.
346
- * @param {Node} aNode - the Node that has a property
347
- * @param {string} aPropertyName - the name of the property
348
- */
645
+ * Gets an int property from a node with a fallback value if the property doesn't exist or is incompatible with the int type.
646
+ *
647
+ * <p>
648
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
649
+ * Illegal characters in node names and property names must always be escaped, typically via
650
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
651
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
652
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
653
+ * (e.g. metadata properties) might contain illegal characters.
654
+ * </p>
655
+ * @param aNode the <code>Node</code> that has a property
656
+ * @param aPropertyName the name of the property
657
+ * @param aDefaultValue fallback value if no value exists
658
+ * @return the <code>int</code> value for aPropertyName. If no property exists or it isn't compatible with an <code>int</code>, aDefaultValue is returned.
659
+ */
660
+ export function getInt(
661
+ aNode: Node,
662
+ aPropertyName: string,
663
+ aDefaultValue: number
664
+ ): number;
665
+
666
+ /**
667
+ * Gets a double property from a Node.
668
+ *
669
+ * <p>
670
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
671
+ * Illegal characters in node names and property names must always be escaped, typically via
672
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
673
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
674
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
675
+ * (e.g. metadata properties) might contain illegal characters.
676
+ * </p>
677
+ * @param aNode the <code>Node</code> that has a property
678
+ * @param aPropertyName the name of the property
679
+ * @return the <code>double</code> value for aPropertyName. If no property exists or it isn't compatible with a <code>double</code>, 0.0 is returned.
680
+ * @since Sitevision 2.6.1_09
681
+ */
682
+ export function getDouble(aNode: Node, aPropertyName: string): number;
683
+
684
+ /**
685
+ * Gets a double property from a node with a fallback value if the property doesn't exist or is incompatible with the double type.
686
+ *
687
+ * <p>
688
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
689
+ * Illegal characters in node names and property names must always be escaped, typically via
690
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
691
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
692
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
693
+ * (e.g. metadata properties) might contain illegal characters.
694
+ * </p>
695
+ * @param aNode the <code>Node</code> that has a property
696
+ * @param aPropertyName the name of the property
697
+ * @param aDefaultValue fallback value if no value exists
698
+ * @return the <code>double</code> value for aPropertyName. If no property exists or it isn't compatible with a <code>double</code>, aDefaultValue is returned.
699
+ * @since Sitevision 2.6.1_09
700
+ */
701
+ export function getDouble(
702
+ aNode: Node,
703
+ aPropertyName: string,
704
+ aDefaultValue: number
705
+ ): number;
706
+
707
+ /**
708
+ * Gets a boolean property from a Node.
709
+ *
710
+ * <p>
711
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
712
+ * Illegal characters in node names and property names must always be escaped, typically via
713
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
714
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
715
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
716
+ * (e.g. metadata properties) might contain illegal characters.
717
+ * </p>
718
+ * @param aNode the <code>Node</code> that has a property
719
+ * @param aPropertyName the name of the property
720
+ * @return the value for aPropertyName as <code>boolean</code>. If no property exists or it isn't compatible with a <code>boolean</code>, <code>false</code> is returned.
721
+ */
722
+ export function getBoolean(aNode: Node, aPropertyName: string): boolean;
723
+
724
+ /**
725
+ * Gets a boolean property from a Node with a fallback value if the property doesn't exist or is incompatible with the boolean type.
726
+ *
727
+ * <p>
728
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
729
+ * Illegal characters in node names and property names must always be escaped, typically via
730
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
731
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
732
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
733
+ * (e.g. metadata properties) might contain illegal characters.
734
+ * </p>
735
+ * @param aNode the <code>Node</code> that has a property
736
+ * @param aPropertyName the name of the property
737
+ * @param aDefaultValue fallback value if no value exists
738
+ * @return the value for aPropertyName as <code>boolean</code>. If no property exists or it isn't compatible with a <code>boolean</code>, aDefaultValue is returned.
739
+ */
740
+ export function getBoolean(
741
+ aNode: Node,
742
+ aPropertyName: string,
743
+ aDefaultValue: boolean
744
+ ): boolean;
745
+
746
+ /**
747
+ * Gets a Node property from a Node.
748
+ *
749
+ * <p>
750
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
751
+ * Illegal characters in node names and property names must always be escaped, typically via
752
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
753
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
754
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
755
+ * (e.g. metadata properties) might contain illegal characters.
756
+ * </p>
757
+ * @param aNode the <code>Node</code> that has a property
758
+ * @param aPropertyName the name of the property
759
+ * @return the value for aPropertyName as <code>Node</code>. If no property exists or it isn't a <code>Node</code>, <code>null</code> is returned.
760
+ */
349
761
  export function getNode(aNode: Node, aPropertyName: string): Node;
350
762
 
351
763
  /**
352
- * Gets a Node property from a Node with a fallback value if the property doesn't exist.
353
- * @returns {Node} the value for aPropertyName as Node. If no property exists or it isn't a Node, aDefaultValue is returned.
354
- * @param {Node} aNode - the Node that has a property
355
- * @param {string} aPropertyName - the name of the property
356
- * @param {Node} aDefaultValue - fallback value if no value exists
357
- */
358
- export function getNode(aNode: Node, aPropertyName: string, aDefaultValue: Node): Node;
764
+ * Gets a Node property from a Node if an enabling property allows it.
765
+ *
766
+ * <p>
767
+ * In some Sitevision portlet configs there are a "boolean" property that enables a "Node" property and the "Node" might be <code>null</code>.
768
+ * This is a convenience method for such cases. In Velocity, code like this:
769
+ * </p>
770
+ * <pre><code>
771
+ * #set ($startPage = ...) <em>## Ensure start page value...</em>
772
+ * #if ($propertyUtil.getBoolean($portlet, 'useCustomStartPage'))
773
+ * #set ($customStartPage = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customStartPage')}))
774
+ * #if ($customStartPage)
775
+ * #set ($startPage = $customStartPage)
776
+ * #end
777
+ * #end
778
+ * </code></pre>
779
+ * would typically be replaced with this:
780
+ * <pre><code>
781
+ * #set ($startPage = $scriptUtil.getNonNull(${propertyUtil.getEnabledNode($portlet, 'useCustomStartPage', 'customStartPage')}))
782
+ * #if (!$startPage)
783
+ * #set ($startPage = ...) <em>## Set default start page value if no custom start page was set...</em>
784
+ * #end
785
+ * </code></pre>
786
+ *
787
+ * <p>
788
+ * <strong>Note!</strong> This method does <em>not</em> escape names
789
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aNodePropertyName</code>).
790
+ * Illegal characters in node names and property names must always be escaped, typically via
791
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
792
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
793
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
794
+ * (e.g. metadata properties) might contain illegal characters.
795
+ * </p>
796
+ * @param aNode the <code>Node</code> that has the properties
797
+ * @param aEnablingPropertyName the name of the boolean property that enables the Node denoted by <code>aPropertyName</code>
798
+ * @param aNodePropertyName the name of the property
799
+ * @return the value for aNodePropertyName as <code>Node</code>. If no property exists or it isn't a <code>Node</code>, <code>null</code> is returned. A <code>Node</code> will never be returned if <code>aEnablingPropertyName</code> doesn't exist, isn't compatible with a <code>boolean</code> or isn't <code>true</code>.
800
+ * @see #getEnabledNode(javax.jcr.Node, String, String, javax.jcr.Node)
801
+ * @since Sitevision 3.0
802
+ */
803
+ export function getEnabledNode(
804
+ aNode: Node,
805
+ aEnablingPropertyName: string,
806
+ aNodePropertyName: string
807
+ ): Node;
359
808
 
360
809
  /**
361
- * Gets a String property from a Node.
362
- * @returns {string} the value for aPropertyName as String. If no property exists, null is returned.
363
- * @param {Node} aNode - the Node that has a property
364
- * @param {string} aPropertyName - the name of the property
365
- */
366
- export function getString(aNode: Node, aPropertyName: string): string;
810
+ * Gets a Node property from a Node if an enabling property allows it, with a fallback Node value.
811
+ *
812
+ * <p>
813
+ * <strong>Note!</strong> This method does <em>not</em> escape names
814
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aNodePropertyName</code>).
815
+ * Illegal characters in node names and property names must always be escaped, typically via
816
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
817
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
818
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
819
+ * (e.g. metadata properties) might contain illegal characters.
820
+ * </p>
821
+ * @param aNode the <code>Node</code> that has the properties
822
+ * @param aEnablingPropertyName the name of the boolean property that enables the Node denoted by <code>aPropertyName</code>
823
+ * @param aNodePropertyName the name of the property
824
+ * @param aDefaultValue fallback value if no value exists
825
+ * @return the value for aNodePropertyName as <code>Node</code>. If no property exists or it isn't a <code>Node</code>, <code>aDefaultValue</code> is returned. If <code>aEnablingPropertyName</code> doesn't exist, isn't compatible with a <code>boolean</code> or isn't <code>true</code>, <code>aDefaultValue</code> is returned.
826
+ * @see #getEnabledNode(javax.jcr.Node, String, String)
827
+ * @since Sitevision 3.0
828
+ */
829
+ export function getEnabledNode(
830
+ aNode: Node,
831
+ aEnablingPropertyName: string,
832
+ aNodePropertyName: string,
833
+ aDefaultValue: Node
834
+ ): Node;
367
835
 
368
836
  /**
369
- * Gets a String property from a node with a fallback value if the property doesn't exist.
370
- * @returns {string} the value for aPropertyName as String. If no property exists, aDefaultValue is returned.
371
- * @param {Node} aNode - the Node that has a property
372
- * @param {string} aPropertyName - the name of the property
373
- * @param {string} aDefaultValue - fallback value if no value exists
374
- */
375
- export function getString(aNode: Node, aPropertyName: string, aDefaultValue: string): string;
837
+ * Gets a String property from a Node if an enabling boolean property allows it.
838
+ *
839
+ * <p>
840
+ * In some Sitevision portlet configs there are a "boolean" property that enables a "String" property and the "String" might
841
+ * be <code>null</code>. This is a convenience method for such cases. In Velocity, code like this:
842
+ * </p>
843
+ * <pre><code>
844
+ * #set ($name = ...) <em>## Set default name...</em>
845
+ * #if ($propertyUtil.getBoolean($portlet, 'useCustomName'))
846
+ * #set ($customName = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customName')}))
847
+ * #if ($customName)
848
+ * #set ($name = $customName)
849
+ * #end
850
+ * #end
851
+ * </code></pre>
852
+ * would typically be replaced with this:
853
+ * <pre><code>
854
+ * #set ($name = $scriptUtil.getNonNull(${propertyUtil.getEnabledString($portlet, 'useCustomName', 'customName')}))
855
+ * #if (!$name)
856
+ * #set ($name = ...) <em>## Set default name if no custom name was set...</em>
857
+ * #end
858
+ * </code></pre>
859
+ *
860
+ * <p>
861
+ * <strong>Note!</strong> This method does <em>not</em> escape names
862
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
863
+ * Illegal characters in node names and property names must always be escaped, typically via
864
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
865
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
866
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
867
+ * (e.g. metadata properties) might contain illegal characters.
868
+ * </p>
869
+ * @param aNode the <code>Node</code> that has the properties
870
+ * @param aEnablingPropertyName the name of the boolean property that enables the String denoted by <code>aStringPropertyName</code>
871
+ * @param aStringPropertyName the name of the String property
872
+ * @return the value for aStringPropertyName as <code>String</code>. If no property exists, <code>null</code> is returned. Null will always be returned if <code>aEnablingPropertyName</code> doesn't exist, isn't compatible with a <code>boolean</code> or isn't <code>true</code>.
873
+ * @see #getEnabledString(javax.jcr.Node, String, String, String)
874
+ * @since Sitevision 4.0
875
+ */
876
+ export function getEnabledString(
877
+ aNode: Node,
878
+ aEnablingPropertyName: string,
879
+ aStringPropertyName: string
880
+ ): string;
376
881
 
377
882
  /**
378
- * Gets a String property from a Node and returns it XML escaped.
379
- * @returns {string} the value for aPropertyName as an XML escaped String. If no property exists, null is returned.
380
- * @param {Node} aNode - the Node that has a property
381
- * @param {string} aPropertyName - the name of the property
382
- */
383
- export function getStringEscaped(aNode: Node, aPropertyName: string): string;
883
+ * Gets a String property from a Node if an enabling boolean property allows it, with a fallback value.
884
+ *
885
+ * <p>
886
+ * <strong>Note!</strong> This method does <em>not</em> escape names
887
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
888
+ * Illegal characters in node names and property names must always be escaped, typically via
889
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
890
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
891
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
892
+ * (e.g. metadata properties) might contain illegal characters.
893
+ * </p>
894
+ * @param aNode the <code>Node</code> that has the properties
895
+ * @param aEnablingPropertyName the name of the boolean property that enables the String denoted by <code>aStringPropertyName</code>
896
+ * @param aStringPropertyName the name of the String property
897
+ * @param aDefaultValue fallback value to return if no value exist
898
+ * @return the value for aStringPropertyName as <code>String</code>. If no property exists, <code>aDefaultValue</code> is returned. <code>aDefaultValue</code> will always be returned if <code>aEnablingPropertyName</code> doesn't exist, isn't compatible with a <code>boolean</code> or isn't <code>true</code>.
899
+ * @see #getEnabledString(javax.jcr.Node, String, String)
900
+ * @since Sitevision 4.0
901
+ */
902
+ export function getEnabledString(
903
+ aNode: Node,
904
+ aEnablingPropertyName: string,
905
+ aStringPropertyName: string,
906
+ aDefaultValue: string
907
+ ): string;
908
+
909
+ /**
910
+ * Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped.
911
+ *
912
+ * <p>
913
+ * In some Sitevision portlet configs there are a "boolean" property that enables a "String" property and the "String"
914
+ * might be <code>null</code>. This is a convenience method for such cases where you want the value XML escaped. In Velocity, code like this:
915
+ * </p>
916
+ * <pre><code>
917
+ * #set ($endecUtil = ...)
918
+ * #set ($escapedName = ...) <em>## Set default escaped name...</em>
919
+ * #if ($propertyUtil.getBoolean($portlet, 'useCustomName'))
920
+ * #set ($customName = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customName')}))
921
+ * #if ($customName)
922
+ * #set ($escapedName = $endecUtil.escapeXML($customName))
923
+ * #end
924
+ * #end
925
+ * </code></pre>
926
+ * would typically be replaced with this:
927
+ * <pre><code>
928
+ * #set ($escapedName = $scriptUtil.getNonNull(${propertyUtil.getEnabledStringEscaped($portlet, 'useCustomName', 'customName')}))
929
+ * #if (!$escapedName)
930
+ * #set ($escapedName = ...) <em>## Set default escaped name if no custom name was set...</em>
931
+ * #end
932
+ * </code></pre>
933
+ *
934
+ * <p>
935
+ * <strong>Note!</strong> This method does <em>not</em> escape names
936
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
937
+ * Illegal characters in node names and property names must always be escaped, typically via
938
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
939
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
940
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
941
+ * (e.g. metadata properties) might contain illegal characters.
942
+ * </p>
943
+ * @param aNode the <code>Node</code> that has the properties
944
+ * @param aEnablingPropertyName the name of the boolean property that enables the String denoted by <code>aStringPropertyName</code>
945
+ * @param aStringPropertyName the name of the String property
946
+ * @return the value for aStringPropertyName as a XML escaped <code>String</code>. If no property exists, <code>null</code> is returned. Null will always be returned if <code>aEnablingPropertyName</code> doesn't exist, isn't compatible with a <code>boolean</code> or isn't <code>true</code>.
947
+ * @see #getEnabledStringEscaped(javax.jcr.Node, String, String, String)
948
+ * @since Sitevision 4.0
949
+ */
950
+ export function getEnabledStringEscaped(
951
+ aNode: Node,
952
+ aEnablingPropertyName: string,
953
+ aStringPropertyName: string
954
+ ): string;
955
+
956
+ /**
957
+ * Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped with a fallback value.
958
+ *
959
+ * <p>
960
+ * <strong>Note!</strong> This method does <em>not</em> escape names
961
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
962
+ * Illegal characters in node names and property names must always be escaped, typically via
963
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
964
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
965
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
966
+ * (e.g. metadata properties) might contain illegal characters.
967
+ * </p>
968
+ * @param aNode the <code>Node</code> that has the properties
969
+ * @param aEnablingPropertyName the name of the boolean property that enables the String denoted by <code>aStringPropertyName</code>
970
+ * @param aStringPropertyName the name of the String property
971
+ * @param aDefaultValue the (non XML escaped) fallback value to return if no value exist
972
+ * @return the value for aStringPropertyName as a XML escaped <code>String</code>. If no property exists, <code>aDefaultValue</code> is XML escaped and returned. <code>aDefaultValue</code> will always be XML escaped and returned if <code>aEnablingPropertyName</code> doesn't exist, isn't compatible with a <code>boolean</code> or isn't <code>true</code>.
973
+ * @see #getEnabledStringEscaped(javax.jcr.Node, String, String)
974
+ * @since Sitevision 4.0
975
+ */
976
+ export function getEnabledStringEscaped(
977
+ aNode: Node,
978
+ aEnablingPropertyName: string,
979
+ aStringPropertyName: string,
980
+ aDefaultValue: string
981
+ ): string;
384
982
 
385
983
  /**
386
- * Gets a String property from a Node, with a fallback value, and returns it XML escaped.
387
- * @returns {string} the value for aPropertyName as an XML escaped String. If no property exists, aDefaultValue is XML escaped and returned.
388
- * @param {Node} aNode - the Node that has a property
389
- * @param {string} aPropertyName - the name of the property
390
- * @param {string} aDefaultValue - a (non XML escaped) fallback value if no value exists
391
- */
392
- export function getStringEscaped(aNode: Node, aPropertyName: string, aDefaultValue: string): string;
984
+ * Gets a Calendar property from a Node.
985
+ *
986
+ * <p>
987
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
988
+ * Illegal characters in node names and property names must always be escaped, typically via
989
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
990
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
991
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
992
+ * (e.g. metadata properties) might contain illegal characters.
993
+ * </p>
994
+ * @param aNode the <code>Node</code> that has a property
995
+ * @param aPropertyName the name of the property
996
+ * @return the value for aPropertyName as <code>Calendar</code>. If no property exists or it isn't a <code>Calendar</code>, <code>null</code> is returned.
997
+ * @since Sitevision 2.6.1_02
998
+ */
999
+ export function getCalendar(aNode: Node, aPropertyName: string): unknown;
393
1000
 
394
1001
  /**
395
- * Gets a List of property values from a Node.
396
- * @returns {List<string>} the string value(s) for aPropertyName as a List. If no property exists, null is returned.
397
- * @param {Node} aNode - the Node that has a property
398
- * @param {string} aPropertyName - the name of the property
399
- */
400
- export function getStrings(aNode: Node, aPropertyName: string): List<string>;
1002
+ * Gets a Calendar property from a Node with a fallback value if the property doesn't exist or is incompatible with the Calendar type.
1003
+ *
1004
+ * <p>
1005
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1006
+ * Illegal characters in node names and property names must always be escaped, typically via
1007
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1008
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1009
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1010
+ * (e.g. metadata properties) might contain illegal characters.
1011
+ * </p>
1012
+ * @param aNode the <code>Node</code> that has a property
1013
+ * @param aPropertyName the name of the property
1014
+ * @param aDefaultValue fallback value if no value exists
1015
+ * @return the value for aPropertyName as <code>Calendar</code>. If no property exists or it isn't compatible with a <code>Calendar</code>, aDefaultValue is returned.
1016
+ * @since Sitevision 2.6.1_02
1017
+ */
1018
+ export function getCalendar(
1019
+ aNode: Node,
1020
+ aPropertyName: string,
1021
+ aDefaultValue: unknown
1022
+ ): unknown;
401
1023
 
402
1024
  /**
403
- * Gets a List of property values from a Node with a fallback value if the property doesn't exist.
404
- * @returns {List<string>} the string value(s) for aPropertyName as a List. If no property exists, aDefaultValue is returned.
405
- * @param {Node} aNode - the Node that has a property
406
- * @param {string} aPropertyName - the name of the property
407
- * @param {List<string>} aDefaultValue - fallback value if no value exists
408
- */
409
- export function getStrings(aNode: Node, aPropertyName: string, aDefaultValue: List<string>): List<string>;
1025
+ * Gets a Calendar property from a "nested" Node's property.
1026
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1027
+ * has a <code>Calendar/Date</code> property).
1028
+ * <p>
1029
+ * Note! The name of this method might seem awkward since a <code>Calendar</code> is returned, but this is to resemble the pattern of a
1030
+ * <code>javax.jcr.Node</code> that has the method <code>getDate()</code> that returns a <code>Calendar</code>.
1031
+ * </p>
1032
+ *
1033
+ * <p>
1034
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1035
+ * Illegal characters in node names and property names must always be escaped, typically via
1036
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1037
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1038
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1039
+ * (e.g. metadata properties) might contain illegal characters.
1040
+ * </p>
1041
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
1042
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on <code>aNode</code>
1043
+ * @param aPropertyName the name of the Calendar property for the "inner/nested" <code>Node</code>
1044
+ * @return the value for aPropertyName as <code>Calendar</code>. If no property exists or it isn't a <code>Calendar</code>, <code>null</code> is returned.
1045
+ * @since Sitevision 2.6.1_02
1046
+ */
1047
+ export function getNestedCalendar(
1048
+ aNode: Node,
1049
+ aNodePropertyName: string,
1050
+ aPropertyName: string
1051
+ ): unknown;
410
1052
 
411
1053
  /**
412
- * Gets a List of XML escaped property values from a Node.
413
- * @returns {List<string>} the string value(s) for aPropertyName, XML escaped and embedded in a List.If no property exists, null is returned.
414
- * @param {Node} aNode - the Node that has a property
415
- * @param {string} aPropertyName - the name of the property
416
- */
417
- export function getStringsEscaped(aNode: Node, aPropertyName: string): List<string>;
1054
+ * Gets a Calendar property from a "nested" Node's property with a fallback value if the property doesn't exist.
1055
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1056
+ * has a <code>Calendar/Date</code> property).
1057
+ *
1058
+ * <p>
1059
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1060
+ * Illegal characters in node names and property names must always be escaped, typically via
1061
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1062
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1063
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1064
+ * (e.g. metadata properties) might contain illegal characters.
1065
+ * </p>
1066
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
1067
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on <code>aNode</code>
1068
+ * @param aPropertyName the name of the Calendar property for the "inner/nested" <code>Node</code>
1069
+ * @param aDefaultValue fallback value if no value exists
1070
+ * @return the value for aPropertyName as <code>Calendar</code>. If no property exists or it isn't a <code>Calendar</code>, aDefaultValue is returned.
1071
+ * @since Sitevision 2.6.1_02
1072
+ */
1073
+ export function getNestedCalendar(
1074
+ aNode: Node,
1075
+ aNodePropertyName: string,
1076
+ aPropertyName: string,
1077
+ aDefaultValue: unknown
1078
+ ): unknown;
418
1079
 
419
1080
  /**
420
- * Gets a List of XML escaped property values from a Node with a fallback value if the property doesn't exist.
421
- * @returns {List<string>} the string value(s) for aPropertyName, XML escaped and embedded in a List.If no property exists, aDefaultValue is returned.
422
- * @param {Node} aNode - the Node that has a property
423
- * @param {string} aPropertyName - the name of the property
424
- * @param {List<string>} aDefaultValue - fallback list if no value exists. Note! The actual fallback list is never returned
425
- * but it's values might be used. If the fallback list are about to be returned, a copy of it will be created and
426
- * all values from the fallback list will be XML escaped and added to the new list before it is returned.
427
- */
428
- export function getStringsEscaped(aNode: Node, aPropertyName: string, aDefaultValue: List<string>): List<string>;
1081
+ * Gets a Node property from a Node with a fallback value if the property doesn't exist.
1082
+ *
1083
+ * <p>
1084
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1085
+ * Illegal characters in node names and property names must always be escaped, typically via
1086
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1087
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1088
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1089
+ * (e.g. metadata properties) might contain illegal characters.
1090
+ * </p>
1091
+ * @param aNode the <code>Node</code> that has a property
1092
+ * @param aPropertyName the name of the property
1093
+ * @param aDefaultValue fallback value if no value exists
1094
+ * @return the value for aPropertyName as <code>Node</code>. If no property exists or it isn't a <code>Node</code>, aDefaultValue is returned.
1095
+ */
1096
+ export function getNode(
1097
+ aNode: Node,
1098
+ aPropertyName: string,
1099
+ aDefaultValue: Node
1100
+ ): Node;
429
1101
 
430
- declare namespace propertyUtil {
1102
+ /**
1103
+ * Gets a <code>List</code> of property values from a Node.
1104
+ *
1105
+ * <p>
1106
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1107
+ * Illegal characters in node names and property names must always be escaped, typically via
1108
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1109
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1110
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1111
+ * (e.g. metadata properties) might contain illegal characters.
1112
+ * </p>
1113
+ * @param aNode the <code>Node</code> that has a property
1114
+ * @param aPropertyName the name of the property
1115
+ * @return the string value(s) for aPropertyName as a <code>List</code>. If no property exists, <code>null</code> is returned.
1116
+ * @see #getStringsEscaped(javax.jcr.Node, String)
1117
+ * @since Sitevision 2.6_06
1118
+ */
1119
+ export function getStrings(aNode: Node, aPropertyName: string): unknown[];
1120
+
1121
+ /**
1122
+ * Gets a <code>List</code> of XML escaped property values from a Node.
1123
+ *
1124
+ * <p>
1125
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
1126
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1127
+ * </p>
1128
+ * <p>
1129
+ * This Velocity code:
1130
+ * </p>
1131
+ * <pre><code>
1132
+ * #set ($endecUtil = ...)
1133
+ * #set ($propertyUtil = ...)
1134
+ * ...
1135
+ * #set ($valueList = $propertyUtil.getStrings($myNode, 'aProperty'))
1136
+ * &lt;ul&gt;
1137
+ * #foreach ($value in $valueList)
1138
+ * &lt;li&gt;
1139
+ * $endecUtil.escapeXML($value)
1140
+ * &lt;/li&gt;
1141
+ * #end
1142
+ * &lt;/ul&gt;
1143
+ * </code></pre>
1144
+ * would typically be replaced with this:
1145
+ * <pre><code>
1146
+ * #set ($propertyUtil = ...)
1147
+ * ...
1148
+ * #set ($escapedValueList = $propertyUtil.getStringsEscaped($myNode, 'aProperty'))
1149
+ * &lt;ul&gt;
1150
+ * #foreach ($escapedValue in $escapedValueList)
1151
+ * &lt;li&gt;
1152
+ * $escapedValue
1153
+ * &lt;/li&gt;
1154
+ * #end
1155
+ * &lt;/ul&gt;
1156
+ * </code></pre>
1157
+ *
1158
+ * <p>
1159
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1160
+ * Illegal characters in node names and property names must always be escaped, typically via
1161
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1162
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1163
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1164
+ * (e.g. metadata properties) might contain illegal characters.
1165
+ * </p>
1166
+ * @param aNode the <code>Node</code> that has a property
1167
+ * @param aPropertyName the name of the property
1168
+ * @return the string value(s) for aPropertyName, XML escaped and embedded in a <code>List</code>. If no property exists, <code>null</code> is returned.
1169
+ * @see #getString(javax.jcr.Node, String)
1170
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
1171
+ * @since Sitevision 3.5
1172
+ */
1173
+ export function getStringsEscaped(
1174
+ aNode: Node,
1175
+ aPropertyName: string
1176
+ ): unknown[];
1177
+
1178
+ /**
1179
+ * Gets a <code>List</code> of property values from a Node with a fallback value if the property doesn't exist.
1180
+ *
1181
+ * <p>
1182
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1183
+ * Illegal characters in node names and property names must always be escaped, typically via
1184
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1185
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1186
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1187
+ * (e.g. metadata properties) might contain illegal characters.
1188
+ * </p>
1189
+ * @param aNode the <code>Node</code> that has a property
1190
+ * @param aPropertyName the name of the property
1191
+ * @return the string value(s) for aPropertyName as a <code>List</code>. If no property exists, <code>aDefaultValue</code> is returned.
1192
+ * @param aDefaultValue fallback value if no value exists
1193
+ * @see #getStringsEscaped(javax.jcr.Node, String, java.util.List)
1194
+ * @since Sitevision 3.0
1195
+ */
1196
+ export function getStrings(
1197
+ aNode: Node,
1198
+ aPropertyName: string,
1199
+ aDefaultValue: unknown[]
1200
+ ): unknown[];
1201
+
1202
+ /**
1203
+ * Gets a <code>List</code> of XML escaped property values from a Node with a fallback value if the property doesn't exist.
1204
+ *
1205
+ * <p>
1206
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
1207
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1208
+ * </p>
1209
+ * <p>
1210
+ * This Velocity code:
1211
+ * </p>
1212
+ * <pre><code>
1213
+ * #set ($endecUtil = ...)
1214
+ * #set ($propertyUtil = ...)
1215
+ * #set ($myDefaultList = ...)
1216
+ * ...
1217
+ * #set ($valueList = $propertyUtil.getStrings($myNode, 'aProperty', $myDefaultList))
1218
+ * &lt;ul&gt;
1219
+ * #foreach ($value in $valueList)
1220
+ * &lt;li&gt;
1221
+ * $endecUtil.escapeXML($value)
1222
+ * &lt;/li&gt;
1223
+ * #end
1224
+ * &lt;/ul&gt;
1225
+ * </code></pre>
1226
+ * would typically be replaced with this:
1227
+ * <pre><code>
1228
+ * #set ($propertyUtil = ...)
1229
+ * #set ($myDefaultList = ...)
1230
+ * ...
1231
+ * #set ($escapedValueList = $propertyUtil.getStringsEscaped($myNode, 'aProperty', $myDefaultList))
1232
+ * &lt;ul&gt;
1233
+ * #foreach ($escapedValue in $escapedValueList)
1234
+ * &lt;li&gt;
1235
+ * $escapedValue
1236
+ * &lt;/li&gt;
1237
+ * #end
1238
+ * &lt;/ul&gt;
1239
+ * </code></pre>
1240
+ *
1241
+ * <p>
1242
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1243
+ * Illegal characters in node names and property names must always be escaped, typically via
1244
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1245
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1246
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1247
+ * (e.g. metadata properties) might contain illegal characters.
1248
+ * </p>
1249
+ * @param aNode the <code>Node</code> that has a property
1250
+ * @param aPropertyName the name of the property
1251
+ * @return the string value(s) for aPropertyName, XML escaped and embedded in a <code>List</code>. If no property exists, <code>aDefaultValue</code> is returned.
1252
+ * @param aDefaultValue fallback list if no value exists. <strong>Note!</strong> The actual fallback list is <em>never</em> returned but it's values might be used. If the fallback list are about to be returned, a copy of it will be created and all values from the fallback list will be XML escaped and added to the new list before it is returned.
1253
+ * @see #getString(javax.jcr.Node, String, String)
1254
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
1255
+ * @since Sitevision 3.5
1256
+ */
1257
+ export function getStringsEscaped(
1258
+ aNode: Node,
1259
+ aPropertyName: string,
1260
+ aDefaultValue: unknown[]
1261
+ ): unknown[];
1262
+
1263
+ /**
1264
+ * Gets a <code>List</code> of property values from a "nested" Node's property.
1265
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1266
+ * has a <code>String</code> property).
1267
+ *
1268
+ * <p>
1269
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1270
+ * Illegal characters in node names and property names must always be escaped, typically via
1271
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1272
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1273
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1274
+ * (e.g. metadata properties) might contain illegal characters.
1275
+ * </p>
1276
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
1277
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
1278
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
1279
+ * @return the string value(s) for aPropertyName as a <code>List</code>. If no property exists, <code>null</code> is returned.
1280
+ * @since Sitevision 2.6_06
1281
+ */
1282
+ export function getNestedStrings(
1283
+ aNode: Node,
1284
+ aNodePropertyName: string,
1285
+ aPropertyName: string
1286
+ ): unknown[];
1287
+
1288
+ /**
1289
+ * Gets a <code>List</code> of XML escaped property values from a "nested" Node's property.
1290
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1291
+ * has a <code>String</code> property).
1292
+ *
1293
+ * <p>
1294
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
1295
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1296
+ * </p>
1297
+ * <p>
1298
+ * This Velocity code:
1299
+ * </p>
1300
+ * <pre><code>
1301
+ * #set ($endecUtil = ...)
1302
+ * #set ($propertyUtil = ...)
1303
+ * ...
1304
+ * #set ($valueList = $propertyUtil.getNestedStrings($myNode, 'aNodeProperty', 'aProperty'))
1305
+ * &lt;ul&gt;
1306
+ * #foreach ($value in $valueList)
1307
+ * &lt;li&gt;
1308
+ * $endecUtil.escapeXML($value)
1309
+ * &lt;/li&gt;
1310
+ * #end
1311
+ * &lt;/ul&gt;
1312
+ * </code></pre>
1313
+ * would typically be replaced with this:
1314
+ * <pre><code>
1315
+ * #set ($propertyUtil = ...)
1316
+ * ...
1317
+ * #set ($escapedValueList = $propertyUtil.getNestedStringsEscaped($myNode, 'aNodeProperty', 'aProperty'))
1318
+ * &lt;ul&gt;
1319
+ * #foreach ($escapedValue in $escapedValueList)
1320
+ * &lt;li&gt;
1321
+ * $escapedValue
1322
+ * &lt;/li&gt;
1323
+ * #end
1324
+ * &lt;/ul&gt;
1325
+ * </code></pre>
1326
+ *
1327
+ * <p>
1328
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1329
+ * Illegal characters in node names and property names must always be escaped, typically via
1330
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1331
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1332
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1333
+ * (e.g. metadata properties) might contain illegal characters.
1334
+ * </p>
1335
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
1336
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
1337
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
1338
+ * @return the string value(s) for aPropertyName as a <code>List</code>. If no property exists, <code>null</code> is returned.
1339
+ * @see #getNestedStrings(javax.jcr.Node, String, String)
1340
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
1341
+ * @since Sitevision 3.5
1342
+ */
1343
+ export function getNestedStringsEscaped(
1344
+ aNode: Node,
1345
+ aNodePropertyName: string,
1346
+ aPropertyName: string
1347
+ ): unknown[];
1348
+
1349
+ /**
1350
+ * Gets a <code>List</code> of property values from a "nested" Node's property with a fallback value if the property doesn't exist.
1351
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1352
+ * has a <code>String</code> property).
1353
+ *
1354
+ * <p>
1355
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1356
+ * Illegal characters in node names and property names must always be escaped, typically via
1357
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1358
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1359
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1360
+ * (e.g. metadata properties) might contain illegal characters.
1361
+ * </p>
1362
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
1363
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
1364
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
1365
+ * @param aDefaultValue fallback value if no value exists
1366
+ * @return the string value(s) for aPropertyName as a <code>List</code>. If no property exists, <code>aDefaultValue</code> is returned.
1367
+ * @since Sitevision 3.0
1368
+ */
1369
+ export function getNestedStrings(
1370
+ aNode: Node,
1371
+ aNodePropertyName: string,
1372
+ aPropertyName: string,
1373
+ aDefaultValue: unknown[]
1374
+ ): unknown[];
1375
+
1376
+ /**
1377
+ * Gets a <code>List</code> of property values from a "nested" Node's property with a fallback value if the property doesn't exist,
1378
+ * and returns it XML escaped.
1379
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1380
+ * has a <code>String</code> property).
1381
+ *
1382
+ * <p>
1383
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
1384
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1385
+ * </p>
1386
+ * <p>
1387
+ * This Velocity code:
1388
+ * </p>
1389
+ * <pre><code>
1390
+ * #set ($endecUtil = ...)
1391
+ * #set ($propertyUtil = ...)
1392
+ * #set ($myDefaultList = ...)
1393
+ * ...
1394
+ * #set ($valueList = $propertyUtil.getNestedStrings($myNode, 'aNodeProperty', 'aProperty', $myDefaultList))
1395
+ * &lt;ul&gt;
1396
+ * #foreach ($value in $valueList)
1397
+ * &lt;li&gt;
1398
+ * $endecUtil.escapeXML($value)
1399
+ * &lt;/li&gt;
1400
+ * #end
1401
+ * &lt;/ul&gt;
1402
+ * </code></pre>
1403
+ * would typically be replaced with this:
1404
+ * <pre><code>
1405
+ * #set ($propertyUtil = ...)
1406
+ * #set ($myDefaultList = ...)
1407
+ * ...
1408
+ * #set ($escapedValueList = $propertyUtil.getNestedStringsEscaped($myNode, 'aNodeProperty', 'aProperty', $myDefaultList))
1409
+ * &lt;ul&gt;
1410
+ * #foreach ($escapedValue in $escapedValueList)
1411
+ * &lt;li&gt;
1412
+ * $escapedValue
1413
+ * &lt;/li&gt;
1414
+ * #end
1415
+ * &lt;/ul&gt;
1416
+ * </code></pre>
1417
+ *
1418
+ * <p>
1419
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1420
+ * Illegal characters in node names and property names must always be escaped, typically via
1421
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1422
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1423
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1424
+ * (e.g. metadata properties) might contain illegal characters.
1425
+ * </p>
1426
+ * @param aNode the base <code>Node</code> that has a property that is a <code>Node</code>
1427
+ * @param aNodePropertyName the name of the "inner/nested" <code>Node</code> that is a property on aNode
1428
+ * @param aPropertyName the name of the property for the "inner/nested" <code>Node</code>
1429
+ * @param aDefaultValue fallback list if no value exists. <strong>Note!</strong> The actual fallback list is <em>never</em> returned, but it's values might be used. If the fallback list are about to be returned, a copy of it will be created and all values from the fallback list will be XML escaped and added to the new list before it is returned.
1430
+ * @return the string value(s) for aPropertyName as a <code>List</code>. If no property exists, <code>aDefaultValue</code> is XML escaped and returned.
1431
+ * @see #getNestedStrings(javax.jcr.Node, String, String, java.util.List)
1432
+ * @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
1433
+ * @since Sitevision 3.5
1434
+ */
1435
+ export function getNestedStringsEscaped(
1436
+ aNode: Node,
1437
+ aNodePropertyName: string,
1438
+ aPropertyName: string,
1439
+ aDefaultValue: unknown[]
1440
+ ): unknown[];
1441
+
1442
+ /**
1443
+ * Utility interface for getting Node property values.
1444
+ *
1445
+ * <p>
1446
+ * An instance of the Sitevision class implementing this interface can be obtained via
1447
+ * {@link senselogic.sitevision.api.Utils#getPropertyUtil()}.
1448
+ * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
1449
+ * </p>
1450
+ *
1451
+ * <p>
1452
+ * The advantage of using these methods instead of explicitly use the "get property" methods as defined in JCR is that none of the
1453
+ * methods defined here throw Exceptions. (Exception handling can of course be handled properly if you implements your own JSR 286
1454
+ * portlet in Java, but when rendering in Velocity you can't catch Exceptions.)
1455
+ * </p>
1456
+ * --------------------------------------------------------- <br>
1457
+ * <strong>Example 1:</strong> You use Velocity and strongly suspect that a <code>Node</code> have a
1458
+ * <code>boolean</code> property called "isInUse"<br>
1459
+ * ---------------------------------------------------------
1460
+ * <p>
1461
+ * <strong>1. The JCR way:</strong>
1462
+ * </p>
1463
+ * <p>
1464
+ * a) This can return <code>true</code>, <code>false</code> or throw an <code>Exception</code>:
1465
+ * </p>
1466
+ * <pre><code>
1467
+ * #if ($aNode.getProperty('isInUse').boolean)
1468
+ * ...
1469
+ * #end</code></pre>
1470
+ * <p>
1471
+ * b) Even if you ensure there actually are a property called "isInUse" it can still throw an <code>Exception</code> if the property isn't a
1472
+ * <code>boolean</code>:
1473
+ * </p>
1474
+ * <pre><code>
1475
+ * #if ($aNode.hasProperty('isInUse') &amp;&amp; $aNode.getProperty('isInUse').boolean)
1476
+ * ...
1477
+ * #end</code></pre>
1478
+ * <p>
1479
+ * c) Your best possible effort to avoid Exceptions is to ensure that there are a property and that it actually is of <code>boolean</code>
1480
+ * type before you check its value:<br>
1481
+ * (Note! Property types are defined in <code>javax.jcr.PropertyType</code> and the <code>BOOLEAN</code> type is represented by the
1482
+ * <code>int</code> value 6):
1483
+ * </p>
1484
+ * <pre><code>
1485
+ * #if ($aNode.hasProperty('isInUse') &amp;&amp; $aNode.getProperty('isInUse').type == 6 &amp;&amp; $aNode.getProperty('isInUse').boolean)
1486
+ * ...
1487
+ * #end</code></pre>
1488
+ * <p>
1489
+ * &nbsp;&nbsp;&nbsp;<em>The drawback with this alternative is that you miss boolean properties that isn't registered as the
1490
+ * <code>BOOLEAN</code> type (e.g. a <code>String</code> property with the value "true" or "false")</em>
1491
+ * </p>
1492
+ *
1493
+ * <p>
1494
+ * <strong>2. The PropertyUtil way:</strong>
1495
+ * </p>
1496
+ * <p>
1497
+ * This always returns <code>true</code> or <code>false</code>:
1498
+ * </p>
1499
+ * <pre><code>
1500
+ * #set ($propertyUtil = $sitevisionUtils.propertyUtil)
1501
+ * ...
1502
+ * #if ($propertyUtil.getBoolean($aNode, 'isInUse')
1503
+ * ...
1504
+ * #end</code></pre>
1505
+ *
1506
+ * --------------------------------------------------------- <br>
1507
+ * <strong>Example 2:</strong> You use Velocity and want to do an integer addition of a fixed <code>int</code> value and a <code>int</code>
1508
+ * property "myNumber".<br>
1509
+ * (Note! An addition in Velocity must be executed in a <code>#set</code> statement)<br>
1510
+ * ---------------------------------------------------------
1511
+ * <p>
1512
+ * <strong>1. The JCR way:</strong>
1513
+ * </p>
1514
+ * <p>
1515
+ * This can't be achieved in Velocity! You can only fetch the value as a long (<code>$aNode.getProperty('myNumber').long</code>)
1516
+ * but Velocity needs an <code>int</code> or an <code>Integer</code> to perform addition.
1517
+ * </p>
1518
+ * <p>
1519
+ * <strong>2. The PropertyUtil way:</strong>
1520
+ * </p>
1521
+ * <p>
1522
+ * This will work in Velocity (i.e. use <code>PropertyUtil</code> to get the <code>int</code>):
1523
+ * </p>
1524
+ * <pre><code>
1525
+ * #set ($propertyUtil = $sitevisionUtils.propertyUtil)
1526
+ * ...
1527
+ * #set ($result = $propertyUtil.getInt($aNode, 'myNumber') + 45)</code></pre>
1528
+ * --------------------------------------------------------- <br>
1529
+ * <strong>Example 3:</strong> You use Velocity and want to get two int property values from a node and one of the property names contains
1530
+ * illegal characters.<br>
1531
+ * (Note! Illegal characters in node names and property names must always be escaped)<br>
1532
+ * ---------------------------------------------------------
1533
+ * <p>
1534
+ * Since the property name "<code>anIllegal[./]name</code>" contains illegal characters it must be escaped.
1535
+ * To do this you typically use the {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String) escapeJcrName(String)}
1536
+ * method in {@link senselogic.sitevision.api.text.EndecUtil}.
1537
+ * Note that the property name "<code>aLegalName</code>" is <em>not</em> escaped since it doesn't contain any illegal characters.
1538
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1539
+ * </p>
1540
+ * <pre><code>
1541
+ * #set ($propertyUtil = $sitevisionUtils.propertyUtil)
1542
+ * #set ($endecUtil = $sitevisionUtils.endecUtil)
1543
+ * ...
1544
+ * #set ($escapedName = $endecUtil.escapeJcrName('anIllegal[./]name'))
1545
+ * #set ($firstValue = $propertyUtil.getInt($aNode, $escapedName)
1546
+ *
1547
+ * #set ($secondValue = $propertyUtil.getInt($aNode, 'aLegalName')
1548
+ * </code></pre>Gets a String property from a "nested" Node's property.
1549
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code> has a
1550
+ * <code>String</code> property).
1551
+ *
1552
+ * <p>
1553
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1554
+ * Illegal characters in node names and property names must always be escaped, typically via
1555
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1556
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1557
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1558
+ * (e.g. metadata properties) might contain illegal characters.
1559
+ * </p>Gets a String property from a "nested" Node's property and returns it XML escaped.
1560
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code> has a
1561
+ * <code>String</code> property).
1562
+ *
1563
+ * <p>
1564
+ * This is a convenience method for getting a "nested" String property that also should be XML escaped. A String that should be included
1565
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1566
+ * </p>
1567
+ * <p>
1568
+ * This Velocity code:
1569
+ * </p>
1570
+ * <pre><code>
1571
+ * #set ($endecUtil = ...)
1572
+ * #set ($propertyUtil = ...)
1573
+ * ...
1574
+ * &lt;p&gt;
1575
+ * $endecUtil.escapeXML($propertyUtil.getNestedString($myNode, 'aNodeProperty', 'aProperty'))
1576
+ * &lt;/p&gt;
1577
+ * </code></pre>
1578
+ * would typically be replaced with this:
1579
+ * <pre><code>
1580
+ * #set ($propertyUtil = ...)
1581
+ * ...
1582
+ * &lt;p&gt;
1583
+ * $!propertyUtil.getNestedStringEscaped($myNode, 'aNodeProperty', 'aProperty')
1584
+ * &lt;/p&gt;
1585
+ * </code></pre>
1586
+ *
1587
+ * <p>
1588
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1589
+ * Illegal characters in node names and property names must always be escaped, typically via
1590
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1591
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1592
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1593
+ * (e.g. metadata properties) might contain illegal characters.
1594
+ * </p>Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist.
1595
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code> has a
1596
+ * <code>String</code> property).
1597
+ *
1598
+ * <p>
1599
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1600
+ * Illegal characters in node names and property names must always be escaped, typically via
1601
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1602
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1603
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1604
+ * (e.g. metadata properties) might contain illegal characters.
1605
+ * </p>Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist, and returns it XML escaped.
1606
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1607
+ * has a <code>String</code> property).
1608
+ *
1609
+ * <p>
1610
+ * This is a convenience method for getting a "nested" String property that also should be XML escaped. A String that should be included
1611
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1612
+ * </p>
1613
+ * <p>
1614
+ * This Velocity code:
1615
+ * </p>
1616
+ * <pre><code>
1617
+ * #set ($endecUtil = ...)
1618
+ * #set ($propertyUtil = ...)
1619
+ * ...
1620
+ * &lt;p&gt;
1621
+ * $endecUtil.escapeXML($propertyUtil.getNestedString($myNode, 'aNodeProperty', 'aProperty', 'a default value'))
1622
+ * &lt;/p&gt;
1623
+ * </code></pre>
1624
+ * would typically be replaced with this:
1625
+ * <pre><code>
1626
+ * #set ($propertyUtil = ...)
1627
+ * ...
1628
+ * &lt;p&gt;
1629
+ * $propertyUtil.getNestedStringEscaped($myNode, 'aNodeProperty', 'aProperty', 'a default value')
1630
+ * &lt;/p&gt;
1631
+ * </code></pre>
1632
+ *
1633
+ * <p>
1634
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1635
+ * Illegal characters in node names and property names must always be escaped, typically via
1636
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1637
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1638
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1639
+ * (e.g. metadata properties) might contain illegal characters.
1640
+ * </p>Gets an int property from a "nested" Node's property.
1641
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1642
+ * has an <code>int/Integer</code> property).
1643
+ *
1644
+ * <p>
1645
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1646
+ * Illegal characters in node names and property names must always be escaped, typically via
1647
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1648
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1649
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1650
+ * (e.g. metadata properties) might contain illegal characters.
1651
+ * </p>Gets an int property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible with the int type.
1652
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1653
+ * has an <code>int/Integer</code> property).
1654
+ *
1655
+ * <p>
1656
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1657
+ * Illegal characters in node names and property names must always be escaped, typically via
1658
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1659
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1660
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1661
+ * (e.g. metadata properties) might contain illegal characters.
1662
+ * </p>Gets a double property from a "nested" Node's property.
1663
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1664
+ * has a <code>double/Double</code> property).
1665
+ *
1666
+ * <p>
1667
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1668
+ * Illegal characters in node names and property names must always be escaped, typically via
1669
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1670
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1671
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1672
+ * (e.g. metadata properties) might contain illegal characters.
1673
+ * </p>Gets a double property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
1674
+ * with the double type.
1675
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1676
+ * has a <code>double/Double</code> property).
1677
+ *
1678
+ * <p>
1679
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1680
+ * Illegal characters in node names and property names must always be escaped, typically via
1681
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1682
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1683
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1684
+ * (e.g. metadata properties) might contain illegal characters.
1685
+ * </p>Gets a boolean property from a "nested" Node's property.
1686
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1687
+ * has a <code>Boolean</code> property).
1688
+ *
1689
+ * <p>
1690
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1691
+ * Illegal characters in node names and property names must always be escaped, typically via
1692
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1693
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1694
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1695
+ * (e.g. metadata properties) might contain illegal characters.
1696
+ * </p>Gets a boolean property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
1697
+ * with the boolean type.
1698
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1699
+ * has a <code>Boolean</code> property).
1700
+ *
1701
+ * <p>
1702
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1703
+ * Illegal characters in node names and property names must always be escaped, typically via
1704
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1705
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1706
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1707
+ * (e.g. metadata properties) might contain illegal characters.
1708
+ * </p>Gets a Node property from a "nested" Node's property.
1709
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1710
+ * has a <code>Node</code> property).
1711
+ *
1712
+ * <p>
1713
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1714
+ * Illegal characters in node names and property names must always be escaped, typically via
1715
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1716
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1717
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1718
+ * (e.g. metadata properties) might contain illegal characters.
1719
+ * </p>Gets a Node property from a "nested" Node's property with a fallback value if the property doesn't exist.
1720
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1721
+ * has a <code>Node</code> property).
1722
+ *
1723
+ * <p>
1724
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1725
+ * Illegal characters in node names and property names must always be escaped, typically via
1726
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1727
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1728
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1729
+ * (e.g. metadata properties) might contain illegal characters.
1730
+ * </p>Gets a Binary property from a Node.
1731
+ *
1732
+ * <p>
1733
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
1734
+ * you must also <code>close</code> the stream when you are done.
1735
+ * </p>
1736
+ *
1737
+ * <p>
1738
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
1739
+ * </p>
1740
+ *
1741
+ * <p>
1742
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1743
+ * Illegal characters in node names and property names must always be escaped, typically via
1744
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1745
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1746
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1747
+ * (e.g. metadata properties) might contain illegal characters.
1748
+ * </p>Gets a Binary property from a node with a fallback value if the property doesn't exist.
1749
+ *
1750
+ * <p>
1751
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
1752
+ * you must also <code>close</code> the stream when you are done.
1753
+ * </p>
1754
+ *
1755
+ * <p>
1756
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
1757
+ * </p>
1758
+ *
1759
+ * <p>
1760
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1761
+ * Illegal characters in node names and property names must always be escaped, typically via
1762
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1763
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1764
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1765
+ * (e.g. metadata properties) might contain illegal characters.
1766
+ * </p>Gets a Binary property from a "nested" Node's property.
1767
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1768
+ * has a <code>Binary</code> property).
1769
+ *
1770
+ * <p>
1771
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
1772
+ * you must also <code>close</code> the stream when you are done.
1773
+ * </p>
1774
+ *
1775
+ * <p>
1776
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
1777
+ * </p>
1778
+ *
1779
+ * <p>
1780
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1781
+ * Illegal characters in node names and property names must always be escaped, typically via
1782
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1783
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1784
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1785
+ * (e.g. metadata properties) might contain illegal characters.
1786
+ * </p>Gets a Binary property from a "nested" Node's property with a fallback value if the property doesn't exist.
1787
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
1788
+ * has a <code>Binary</code> property).
1789
+ *
1790
+ * <p>
1791
+ * Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
1792
+ * you must also <code>close</code> the stream when you are done.
1793
+ * </p>
1794
+ *
1795
+ * <p>
1796
+ * <strong>Note!</strong> The <code>Binary</code> support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
1797
+ * </p>
1798
+ *
1799
+ * <p>
1800
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
1801
+ * Illegal characters in node names and property names must always be escaped, typically via
1802
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1803
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1804
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1805
+ * (e.g. metadata properties) might contain illegal characters.
1806
+ * </p>Gets a String property from a Node.
1807
+ *
1808
+ * <p>
1809
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1810
+ * Illegal characters in node names and property names must always be escaped, typically via
1811
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1812
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1813
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1814
+ * (e.g. metadata properties) might contain illegal characters.
1815
+ * </p>Gets a String property from a Node and returns it XML escaped.
1816
+ *
1817
+ * <p>
1818
+ * This is a convenience method for getting a String property that also should be XML escaped. A String that should be included
1819
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1820
+ * </p>
1821
+ * <p>
1822
+ * This Velocity code:
1823
+ * </p>
1824
+ * <pre><code>
1825
+ * #set ($endecUtil = ...)
1826
+ * #set ($propertyUtil = ...)
1827
+ * ...
1828
+ * &lt;p&gt;
1829
+ * $endecUtil.escapeXML($propertyUtil.getString($myNode, 'aProperty'))
1830
+ * &lt;/p&gt;
1831
+ * </code></pre>
1832
+ * would typically be replaced with this:
1833
+ * <pre><code>
1834
+ * #set ($propertyUtil = ...)
1835
+ * ...
1836
+ * &lt;p&gt;
1837
+ * $!propertyUtil.getStringEscaped($myNode, 'aProperty')
1838
+ * &lt;/p&gt;
1839
+ * </code></pre>
1840
+ *
1841
+ * <p>
1842
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1843
+ * Illegal characters in node names and property names must always be escaped, typically via
1844
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1845
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1846
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1847
+ * (e.g. metadata properties) might contain illegal characters.
1848
+ * </p>Gets a String property from a node with a fallback value if the property doesn't exist.
1849
+ *
1850
+ * <p>
1851
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1852
+ * Illegal characters in node names and property names must always be escaped, typically via
1853
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1854
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1855
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1856
+ * (e.g. metadata properties) might contain illegal characters.
1857
+ * </p>Gets a String property from a Node, with a fallback value, and returns it XML escaped.
1858
+ *
1859
+ * <p>
1860
+ * This is a convenience method for getting a String property that also should be XML escaped. A String that should be included
1861
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
1862
+ * </p>
1863
+ * <p>
1864
+ * This Velocity code:
1865
+ * </p>
1866
+ * <pre><code>
1867
+ * #set ($endecUtil = ...)
1868
+ * #set ($propertyUtil = ...)
1869
+ * ...
1870
+ * &lt;p&gt;
1871
+ * $endecUtil.escapeXML($propertyUtil.getString($myNode, 'aProperty', 'a default value'))
1872
+ * &lt;/p&gt;
1873
+ * </code></pre>
1874
+ * would typically be replaced with this:
1875
+ * <pre><code>
1876
+ * #set ($propertyUtil = ...)
1877
+ * ...
1878
+ * &lt;p&gt;
1879
+ * $propertyUtil.getStringEscaped($myNode, 'aProperty', 'a default value')
1880
+ * &lt;/p&gt;
1881
+ * </code></pre>
1882
+ *
1883
+ * <p>
1884
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1885
+ * Illegal characters in node names and property names must always be escaped, typically via
1886
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1887
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1888
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1889
+ * (e.g. metadata properties) might contain illegal characters.
1890
+ * </p>Gets an int property from a Node.
1891
+ *
1892
+ * <p>
1893
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1894
+ * Illegal characters in node names and property names must always be escaped, typically via
1895
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1896
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1897
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1898
+ * (e.g. metadata properties) might contain illegal characters.
1899
+ * </p>Gets an int property from a node with a fallback value if the property doesn't exist or is incompatible with the int type.
1900
+ *
1901
+ * <p>
1902
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1903
+ * Illegal characters in node names and property names must always be escaped, typically via
1904
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1905
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1906
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1907
+ * (e.g. metadata properties) might contain illegal characters.
1908
+ * </p>Gets a double property from a Node.
1909
+ *
1910
+ * <p>
1911
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1912
+ * Illegal characters in node names and property names must always be escaped, typically via
1913
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1914
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1915
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1916
+ * (e.g. metadata properties) might contain illegal characters.
1917
+ * </p>Gets a double property from a node with a fallback value if the property doesn't exist or is incompatible with the double type.
1918
+ *
1919
+ * <p>
1920
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1921
+ * Illegal characters in node names and property names must always be escaped, typically via
1922
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1923
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1924
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1925
+ * (e.g. metadata properties) might contain illegal characters.
1926
+ * </p>Gets a boolean property from a Node.
1927
+ *
1928
+ * <p>
1929
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1930
+ * Illegal characters in node names and property names must always be escaped, typically via
1931
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1932
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1933
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1934
+ * (e.g. metadata properties) might contain illegal characters.
1935
+ * </p>Gets a boolean property from a Node with a fallback value if the property doesn't exist or is incompatible with the boolean type.
1936
+ *
1937
+ * <p>
1938
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1939
+ * Illegal characters in node names and property names must always be escaped, typically via
1940
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1941
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1942
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1943
+ * (e.g. metadata properties) might contain illegal characters.
1944
+ * </p>Gets a Node property from a Node.
1945
+ *
1946
+ * <p>
1947
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
1948
+ * Illegal characters in node names and property names must always be escaped, typically via
1949
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1950
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1951
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1952
+ * (e.g. metadata properties) might contain illegal characters.
1953
+ * </p>Gets a Node property from a Node if an enabling property allows it.
1954
+ *
1955
+ * <p>
1956
+ * In some Sitevision portlet configs there are a "boolean" property that enables a "Node" property and the "Node" might be <code>null</code>.
1957
+ * This is a convenience method for such cases. In Velocity, code like this:
1958
+ * </p>
1959
+ * <pre><code>
1960
+ * #set ($startPage = ...) <em>## Ensure start page value...</em>
1961
+ * #if ($propertyUtil.getBoolean($portlet, 'useCustomStartPage'))
1962
+ * #set ($customStartPage = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customStartPage')}))
1963
+ * #if ($customStartPage)
1964
+ * #set ($startPage = $customStartPage)
1965
+ * #end
1966
+ * #end
1967
+ * </code></pre>
1968
+ * would typically be replaced with this:
1969
+ * <pre><code>
1970
+ * #set ($startPage = $scriptUtil.getNonNull(${propertyUtil.getEnabledNode($portlet, 'useCustomStartPage', 'customStartPage')}))
1971
+ * #if (!$startPage)
1972
+ * #set ($startPage = ...) <em>## Set default start page value if no custom start page was set...</em>
1973
+ * #end
1974
+ * </code></pre>
1975
+ *
1976
+ * <p>
1977
+ * <strong>Note!</strong> This method does <em>not</em> escape names
1978
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aNodePropertyName</code>).
1979
+ * Illegal characters in node names and property names must always be escaped, typically via
1980
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1981
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1982
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1983
+ * (e.g. metadata properties) might contain illegal characters.
1984
+ * </p>Gets a Node property from a Node if an enabling property allows it, with a fallback Node value.
1985
+ *
1986
+ * <p>
1987
+ * <strong>Note!</strong> This method does <em>not</em> escape names
1988
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aNodePropertyName</code>).
1989
+ * Illegal characters in node names and property names must always be escaped, typically via
1990
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
1991
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
1992
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
1993
+ * (e.g. metadata properties) might contain illegal characters.
1994
+ * </p>Gets a String property from a Node if an enabling boolean property allows it.
1995
+ *
1996
+ * <p>
1997
+ * In some Sitevision portlet configs there are a "boolean" property that enables a "String" property and the "String" might
1998
+ * be <code>null</code>. This is a convenience method for such cases. In Velocity, code like this:
1999
+ * </p>
2000
+ * <pre><code>
2001
+ * #set ($name = ...) <em>## Set default name...</em>
2002
+ * #if ($propertyUtil.getBoolean($portlet, 'useCustomName'))
2003
+ * #set ($customName = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customName')}))
2004
+ * #if ($customName)
2005
+ * #set ($name = $customName)
2006
+ * #end
2007
+ * #end
2008
+ * </code></pre>
2009
+ * would typically be replaced with this:
2010
+ * <pre><code>
2011
+ * #set ($name = $scriptUtil.getNonNull(${propertyUtil.getEnabledString($portlet, 'useCustomName', 'customName')}))
2012
+ * #if (!$name)
2013
+ * #set ($name = ...) <em>## Set default name if no custom name was set...</em>
2014
+ * #end
2015
+ * </code></pre>
2016
+ *
2017
+ * <p>
2018
+ * <strong>Note!</strong> This method does <em>not</em> escape names
2019
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
2020
+ * Illegal characters in node names and property names must always be escaped, typically via
2021
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2022
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2023
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2024
+ * (e.g. metadata properties) might contain illegal characters.
2025
+ * </p>Gets a String property from a Node if an enabling boolean property allows it, with a fallback value.
2026
+ *
2027
+ * <p>
2028
+ * <strong>Note!</strong> This method does <em>not</em> escape names
2029
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
2030
+ * Illegal characters in node names and property names must always be escaped, typically via
2031
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2032
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2033
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2034
+ * (e.g. metadata properties) might contain illegal characters.
2035
+ * </p>Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped.
2036
+ *
2037
+ * <p>
2038
+ * In some Sitevision portlet configs there are a "boolean" property that enables a "String" property and the "String"
2039
+ * might be <code>null</code>. This is a convenience method for such cases where you want the value XML escaped. In Velocity, code like this:
2040
+ * </p>
2041
+ * <pre><code>
2042
+ * #set ($endecUtil = ...)
2043
+ * #set ($escapedName = ...) <em>## Set default escaped name...</em>
2044
+ * #if ($propertyUtil.getBoolean($portlet, 'useCustomName'))
2045
+ * #set ($customName = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customName')}))
2046
+ * #if ($customName)
2047
+ * #set ($escapedName = $endecUtil.escapeXML($customName))
2048
+ * #end
2049
+ * #end
2050
+ * </code></pre>
2051
+ * would typically be replaced with this:
2052
+ * <pre><code>
2053
+ * #set ($escapedName = $scriptUtil.getNonNull(${propertyUtil.getEnabledStringEscaped($portlet, 'useCustomName', 'customName')}))
2054
+ * #if (!$escapedName)
2055
+ * #set ($escapedName = ...) <em>## Set default escaped name if no custom name was set...</em>
2056
+ * #end
2057
+ * </code></pre>
2058
+ *
2059
+ * <p>
2060
+ * <strong>Note!</strong> This method does <em>not</em> escape names
2061
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
2062
+ * Illegal characters in node names and property names must always be escaped, typically via
2063
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2064
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2065
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2066
+ * (e.g. metadata properties) might contain illegal characters.
2067
+ * </p>Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped with a fallback value.
2068
+ *
2069
+ * <p>
2070
+ * <strong>Note!</strong> This method does <em>not</em> escape names
2071
+ * (i.e. <code>aEnablingPropertyName</code> and <code>aStringPropertyName</code>).
2072
+ * Illegal characters in node names and property names must always be escaped, typically via
2073
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2074
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2075
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2076
+ * (e.g. metadata properties) might contain illegal characters.
2077
+ * </p>Gets a Calendar property from a Node.
2078
+ *
2079
+ * <p>
2080
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
2081
+ * Illegal characters in node names and property names must always be escaped, typically via
2082
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2083
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2084
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2085
+ * (e.g. metadata properties) might contain illegal characters.
2086
+ * </p>Gets a Calendar property from a Node with a fallback value if the property doesn't exist or is incompatible with the Calendar type.
2087
+ *
2088
+ * <p>
2089
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
2090
+ * Illegal characters in node names and property names must always be escaped, typically via
2091
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2092
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2093
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2094
+ * (e.g. metadata properties) might contain illegal characters.
2095
+ * </p>Gets a Calendar property from a "nested" Node's property.
2096
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
2097
+ * has a <code>Calendar/Date</code> property).
2098
+ * <p>
2099
+ * Note! The name of this method might seem awkward since a <code>Calendar</code> is returned, but this is to resemble the pattern of a
2100
+ * <code>javax.jcr.Node</code> that has the method <code>getDate()</code> that returns a <code>Calendar</code>.
2101
+ * </p>
2102
+ *
2103
+ * <p>
2104
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
2105
+ * Illegal characters in node names and property names must always be escaped, typically via
2106
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2107
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2108
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2109
+ * (e.g. metadata properties) might contain illegal characters.
2110
+ * </p>Gets a Calendar property from a "nested" Node's property with a fallback value if the property doesn't exist.
2111
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
2112
+ * has a <code>Calendar/Date</code> property).
2113
+ *
2114
+ * <p>
2115
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
2116
+ * Illegal characters in node names and property names must always be escaped, typically via
2117
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2118
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2119
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2120
+ * (e.g. metadata properties) might contain illegal characters.
2121
+ * </p>Gets a Node property from a Node with a fallback value if the property doesn't exist.
2122
+ *
2123
+ * <p>
2124
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
2125
+ * Illegal characters in node names and property names must always be escaped, typically via
2126
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2127
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2128
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2129
+ * (e.g. metadata properties) might contain illegal characters.
2130
+ * </p>Gets a <code>List</code> of property values from a Node.
2131
+ *
2132
+ * <p>
2133
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
2134
+ * Illegal characters in node names and property names must always be escaped, typically via
2135
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2136
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2137
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2138
+ * (e.g. metadata properties) might contain illegal characters.
2139
+ * </p>Gets a <code>List</code> of XML escaped property values from a Node.
2140
+ *
2141
+ * <p>
2142
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
2143
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
2144
+ * </p>
2145
+ * <p>
2146
+ * This Velocity code:
2147
+ * </p>
2148
+ * <pre><code>
2149
+ * #set ($endecUtil = ...)
2150
+ * #set ($propertyUtil = ...)
2151
+ * ...
2152
+ * #set ($valueList = $propertyUtil.getStrings($myNode, 'aProperty'))
2153
+ * &lt;ul&gt;
2154
+ * #foreach ($value in $valueList)
2155
+ * &lt;li&gt;
2156
+ * $endecUtil.escapeXML($value)
2157
+ * &lt;/li&gt;
2158
+ * #end
2159
+ * &lt;/ul&gt;
2160
+ * </code></pre>
2161
+ * would typically be replaced with this:
2162
+ * <pre><code>
2163
+ * #set ($propertyUtil = ...)
2164
+ * ...
2165
+ * #set ($escapedValueList = $propertyUtil.getStringsEscaped($myNode, 'aProperty'))
2166
+ * &lt;ul&gt;
2167
+ * #foreach ($escapedValue in $escapedValueList)
2168
+ * &lt;li&gt;
2169
+ * $escapedValue
2170
+ * &lt;/li&gt;
2171
+ * #end
2172
+ * &lt;/ul&gt;
2173
+ * </code></pre>
2174
+ *
2175
+ * <p>
2176
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
2177
+ * Illegal characters in node names and property names must always be escaped, typically via
2178
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2179
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2180
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2181
+ * (e.g. metadata properties) might contain illegal characters.
2182
+ * </p>Gets a <code>List</code> of property values from a Node with a fallback value if the property doesn't exist.
2183
+ *
2184
+ * <p>
2185
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
2186
+ * Illegal characters in node names and property names must always be escaped, typically via
2187
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2188
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2189
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2190
+ * (e.g. metadata properties) might contain illegal characters.
2191
+ * </p>Gets a <code>List</code> of XML escaped property values from a Node with a fallback value if the property doesn't exist.
2192
+ *
2193
+ * <p>
2194
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
2195
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
2196
+ * </p>
2197
+ * <p>
2198
+ * This Velocity code:
2199
+ * </p>
2200
+ * <pre><code>
2201
+ * #set ($endecUtil = ...)
2202
+ * #set ($propertyUtil = ...)
2203
+ * #set ($myDefaultList = ...)
2204
+ * ...
2205
+ * #set ($valueList = $propertyUtil.getStrings($myNode, 'aProperty', $myDefaultList))
2206
+ * &lt;ul&gt;
2207
+ * #foreach ($value in $valueList)
2208
+ * &lt;li&gt;
2209
+ * $endecUtil.escapeXML($value)
2210
+ * &lt;/li&gt;
2211
+ * #end
2212
+ * &lt;/ul&gt;
2213
+ * </code></pre>
2214
+ * would typically be replaced with this:
2215
+ * <pre><code>
2216
+ * #set ($propertyUtil = ...)
2217
+ * #set ($myDefaultList = ...)
2218
+ * ...
2219
+ * #set ($escapedValueList = $propertyUtil.getStringsEscaped($myNode, 'aProperty', $myDefaultList))
2220
+ * &lt;ul&gt;
2221
+ * #foreach ($escapedValue in $escapedValueList)
2222
+ * &lt;li&gt;
2223
+ * $escapedValue
2224
+ * &lt;/li&gt;
2225
+ * #end
2226
+ * &lt;/ul&gt;
2227
+ * </code></pre>
2228
+ *
2229
+ * <p>
2230
+ * <strong>Note!</strong> This method does <em>not</em> escape the property name (i.e. <code>aPropertyName</code>).
2231
+ * Illegal characters in node names and property names must always be escaped, typically via
2232
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2233
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2234
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2235
+ * (e.g. metadata properties) might contain illegal characters.
2236
+ * </p>Gets a <code>List</code> of property values from a "nested" Node's property.
2237
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
2238
+ * has a <code>String</code> property).
2239
+ *
2240
+ * <p>
2241
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
2242
+ * Illegal characters in node names and property names must always be escaped, typically via
2243
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2244
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2245
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2246
+ * (e.g. metadata properties) might contain illegal characters.
2247
+ * </p>Gets a <code>List</code> of XML escaped property values from a "nested" Node's property.
2248
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
2249
+ * has a <code>String</code> property).
2250
+ *
2251
+ * <p>
2252
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
2253
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
2254
+ * </p>
2255
+ * <p>
2256
+ * This Velocity code:
2257
+ * </p>
2258
+ * <pre><code>
2259
+ * #set ($endecUtil = ...)
2260
+ * #set ($propertyUtil = ...)
2261
+ * ...
2262
+ * #set ($valueList = $propertyUtil.getNestedStrings($myNode, 'aNodeProperty', 'aProperty'))
2263
+ * &lt;ul&gt;
2264
+ * #foreach ($value in $valueList)
2265
+ * &lt;li&gt;
2266
+ * $endecUtil.escapeXML($value)
2267
+ * &lt;/li&gt;
2268
+ * #end
2269
+ * &lt;/ul&gt;
2270
+ * </code></pre>
2271
+ * would typically be replaced with this:
2272
+ * <pre><code>
2273
+ * #set ($propertyUtil = ...)
2274
+ * ...
2275
+ * #set ($escapedValueList = $propertyUtil.getNestedStringsEscaped($myNode, 'aNodeProperty', 'aProperty'))
2276
+ * &lt;ul&gt;
2277
+ * #foreach ($escapedValue in $escapedValueList)
2278
+ * &lt;li&gt;
2279
+ * $escapedValue
2280
+ * &lt;/li&gt;
2281
+ * #end
2282
+ * &lt;/ul&gt;
2283
+ * </code></pre>
2284
+ *
2285
+ * <p>
2286
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
2287
+ * Illegal characters in node names and property names must always be escaped, typically via
2288
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2289
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2290
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2291
+ * (e.g. metadata properties) might contain illegal characters.
2292
+ * </p>Gets a <code>List</code> of property values from a "nested" Node's property with a fallback value if the property doesn't exist.
2293
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
2294
+ * has a <code>String</code> property).
2295
+ *
2296
+ * <p>
2297
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
2298
+ * Illegal characters in node names and property names must always be escaped, typically via
2299
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2300
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2301
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2302
+ * (e.g. metadata properties) might contain illegal characters.
2303
+ * </p>Gets a <code>List</code> of property values from a "nested" Node's property with a fallback value if the property doesn't exist,
2304
+ * and returns it XML escaped.
2305
+ * (i.e. the base <code>Node</code> has a property that is a <code>Node</code>, and that "inner/nested" <code>Node</code>
2306
+ * has a <code>String</code> property).
2307
+ *
2308
+ * <p>
2309
+ * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included
2310
+ * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems.
2311
+ * </p>
2312
+ * <p>
2313
+ * This Velocity code:
2314
+ * </p>
2315
+ * <pre><code>
2316
+ * #set ($endecUtil = ...)
2317
+ * #set ($propertyUtil = ...)
2318
+ * #set ($myDefaultList = ...)
2319
+ * ...
2320
+ * #set ($valueList = $propertyUtil.getNestedStrings($myNode, 'aNodeProperty', 'aProperty', $myDefaultList))
2321
+ * &lt;ul&gt;
2322
+ * #foreach ($value in $valueList)
2323
+ * &lt;li&gt;
2324
+ * $endecUtil.escapeXML($value)
2325
+ * &lt;/li&gt;
2326
+ * #end
2327
+ * &lt;/ul&gt;
2328
+ * </code></pre>
2329
+ * would typically be replaced with this:
2330
+ * <pre><code>
2331
+ * #set ($propertyUtil = ...)
2332
+ * #set ($myDefaultList = ...)
2333
+ * ...
2334
+ * #set ($escapedValueList = $propertyUtil.getNestedStringsEscaped($myNode, 'aNodeProperty', 'aProperty', $myDefaultList))
2335
+ * &lt;ul&gt;
2336
+ * #foreach ($escapedValue in $escapedValueList)
2337
+ * &lt;li&gt;
2338
+ * $escapedValue
2339
+ * &lt;/li&gt;
2340
+ * #end
2341
+ * &lt;/ul&gt;
2342
+ * </code></pre>
2343
+ *
2344
+ * <p>
2345
+ * <strong>Note!</strong> This method does <em>not</em> escape names (i.e. <code>aNodePropertyName</code> and <code>aPropertyName</code>).
2346
+ * Illegal characters in node names and property names must always be escaped, typically via
2347
+ * {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
2348
+ * For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
2349
+ * Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
2350
+ * (e.g. metadata properties) might contain illegal characters.
2351
+ * </p>
2352
+ * @author Magnus Lövgren
2353
+ */
2354
+ declare namespace PropertyUtil {
431
2355
  export {
2356
+ getNestedString,
2357
+ getNestedStringEscaped,
2358
+ getNestedInt,
2359
+ getNestedDouble,
2360
+ getNestedBoolean,
2361
+ getNestedNode,
432
2362
  getBinary,
433
- getBoolean,
434
- getCalendar,
2363
+ getNestedBinary,
2364
+ getString,
2365
+ getStringEscaped,
2366
+ getInt,
435
2367
  getDouble,
2368
+ getBoolean,
2369
+ getNode,
436
2370
  getEnabledNode,
437
2371
  getEnabledString,
438
2372
  getEnabledStringEscaped,
439
- getInt,
440
- getNestedBinary,
441
- getNestedBoolean,
2373
+ getCalendar,
442
2374
  getNestedCalendar,
443
- getNestedDouble,
444
- getNestedInt,
445
- getNestedNode,
446
- getNestedString,
447
- getNestedStringEscaped,
448
- getNestedStrings,
449
- getNestedStringsEscaped,
450
- getNode,
451
- getString,
452
- getStringEscaped,
453
2375
  getStrings,
454
2376
  getStringsEscaped,
2377
+ getNestedStrings,
2378
+ getNestedStringsEscaped,
455
2379
  };
456
2380
  }
457
2381
 
458
- export default propertyUtil;
2382
+ export default PropertyUtil;