@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
@@ -0,0 +1,272 @@
1
+ /**
2
+ * Script utility for server-side invoke of a local RESTApp.
3
+ *
4
+ * <p>
5
+ * This is a local, server-side, inbound utility to invoke a specific
6
+ * <a href="https://developer.sitevision.se/restapps" target="_blank">RESTApp</a>
7
+ * of the local site without any outgoing http connections.
8
+ * This utility can be used regardless of the RESTApp allows requests or not!
9
+ * Verb/method restrictions (GET/POST/PUT/DELETE) specified for the RESTApp will be respected.
10
+ * </p>
11
+ *
12
+ * <div id="options">
13
+ * <h3>RESTApp invocation</h3>
14
+ * <p>
15
+ * This utility has methods to server-side invoke a specific RESTApp that resides on the same site as this code is executed.
16
+ * Each method requires that a <em>route</em> is specified. Each method also allows for <em>options</em> to be passed to the RESTApp
17
+ * so it can do its job properly. Each method returns an object with the result of the RESTApp invocation.
18
+ * </p>
19
+ * <h4>Options</h4>
20
+ * <ul>
21
+ * <li>
22
+ * <strong>headers</strong> <em>(key/value object)</em> [optional]
23
+ * - request headers to pass to the invoking RESTApp.
24
+ * </li>
25
+ * <li>
26
+ * <strong><em>&lt;name&gt;</em></strong> <em>(key/value object)</em> [optional, RESTApp dependant]
27
+ * - named parameters/data/files to pass to the invoking RESTApp.
28
+ * </li>
29
+ * </ul>
30
+ * <h4>Result</h4>
31
+ * <ul>
32
+ * <li>
33
+ * <strong>statusCode</strong> <em>(integer)</em>
34
+ * - the http status code.
35
+ * </li>
36
+ * <li>
37
+ * <strong>statusMessage</strong> <em>(string)</em>
38
+ * - the status code message or error message.
39
+ * </li>
40
+ * <li>
41
+ * <strong>headers</strong> <em>(key/value object)</em> [optional, RESTApp dependant]
42
+ * - potential response headers set by the invoked RESTApp.
43
+ * </li>
44
+ * <li>
45
+ * <strong>body</strong> - [optional, RESTApp dependant]
46
+ * - potential result set by the invoked RESTApp:
47
+ * <ul>
48
+ * <li>
49
+ * {@link javax.jcr.Node} (of type sv:file, sv:image or sv:temporaryFileNode) if the RESTApp executes
50
+ * <code>
51
+ * <a href="https://developer.sitevision.se/docs/rest-api/restapps/index.js#h-ressendFilefile" target="_blank">res.sendFile</a>
52
+ * </code>
53
+ * </li>
54
+ * <li>
55
+ * <code>object</code> if the RESTApp executes
56
+ * <code>
57
+ * <a href="https://developer.sitevision.se/docs/rest-api/restapps/index.js#h-resjsonresponse" target="_blank">res.json</a>
58
+ * </code>
59
+ * </li>
60
+ * <li>
61
+ * <code>string</code> if the RESTApp executes
62
+ * <code>
63
+ * <a href="https://developer.sitevision.se/docs/rest-api/restapps/index.js#h-ressendresponse" target="_blank">res.send</a>
64
+ * </code>
65
+ * </li>
66
+ * </ul>
67
+ * </li>
68
+ * </ul>
69
+ * </div>
70
+ *
71
+ * <h3>Basic GET example</h3>
72
+ * <p>
73
+ * Below is an example of how to use the RestAppInvoker utility to execute a GET on the items route of a RESTApp.
74
+ * </p><pre><code> var restAppInvokerFactory = require('RestAppInvokerFactory'),
75
+ * restApp = restAppInvokerFactory.fromPath('/rest-api/my-rest-app'),
76
+ * result;
77
+ *
78
+ * if (restApp) {
79
+ * result = restApp.get('/items', {count:5});
80
+ * if (result.statusCode === 200) {
81
+ * <em>// Handle valid result ...</em>
82
+ * result.body ...
83
+ * } else {
84
+ * <em>// Handle other/error result ...</em>
85
+ * }
86
+ * }</code></pre>
87
+ *
88
+ * <h3>Basic POST example</h3>
89
+ * <p>
90
+ * Below is an example of how to use the RestAppInvoker utility to execute a POST on the addfile route of a RESTApp.
91
+ * </p><pre><code> var restAppInvokerFactory = require('RestAppInvokerFactory'),
92
+ * restApp = restAppInvokerFactory.fromPath('/rest-api/my-rest-app'),
93
+ * fileNode,
94
+ * options,
95
+ * result;
96
+ *
97
+ * if (restApp) {
98
+ * fileNode = ... <em>// Get the JCR file Node (sv:file, sv:image) to pass to the RESTApp</em>
99
+ *
100
+ * options = {
101
+ * headers: {
102
+ * 'X-custom-header': 'Custom value'
103
+ * },
104
+ * spreadsheet: fileNode,
105
+ * sendMail: true,
106
+ * customerId: 'abc123'
107
+ * };
108
+ *
109
+ * result = restApp.post('/addfile', options);
110
+ * if (result.statusCode === 200) {
111
+ * <em>// Handle valid result ...</em>
112
+ * result.body ...
113
+ * } else {
114
+ * <em>// Handle other/error result ...</em>
115
+ * }
116
+ * }</code></pre>
117
+ *
118
+ * <p>
119
+ * <strong>REST siblings note!</strong>
120
+ * </p>
121
+ * <ul>
122
+ * <li>
123
+ * Server-side invoke of the <em>local Sitevision REST API</em> should typically be handled via
124
+ * {@link senselogic.sitevision.api.script.RestApi}.
125
+ * </li>
126
+ * <li>
127
+ * Invoking <em>external REST API:s</em> should typically be handled via
128
+ * {@link senselogic.sitevision.api.script.Requester}.
129
+ * </li>
130
+ * </ul>
131
+ *
132
+ * <p>
133
+ * An instance of the Sitevision class implementing this interface can be obtained via a method in
134
+ * {@link RestAppInvokerFactory}.
135
+ * </p>Executes GET for a route of the RESTApp.
136
+ *
137
+ * <p>
138
+ * <em>REST hint!</em> A <em>get</em> typically indicates a <em>read</em> of something.
139
+ * </p>Executes GET with options for a route of the RESTApp.
140
+ *
141
+ * <p>
142
+ * <em>REST hint!</em> A <em>get</em> typically indicates a <em>read</em> of something.
143
+ * </p>Executes POST for a route of the RESTApp.
144
+ *
145
+ * <p>
146
+ * <em>REST hint!</em> A <em>post</em> typically indicates the <em>creation</em> of something.
147
+ * </p>Executes POST with options for a route of the RESTApp.
148
+ *
149
+ * <p>
150
+ * <em>REST hint!</em> A <em>post</em> typically indicates the <em>creation</em> of something.
151
+ * </p>Executes PUT for a route of the RESTApp.
152
+ *
153
+ * <p>
154
+ * <em>REST hint!</em> A <em>put</em> typically indicates an <em>update</em> of something.
155
+ * </p>Executes PUT with options for a route of the RESTApp.
156
+ *
157
+ * <p>
158
+ * <em>REST hint!</em> A <em>put</em> typically indicates an <em>update</em> of something.
159
+ * </p>Executes DELETE for a route of the RESTApp.
160
+ *
161
+ * <p>
162
+ * <em>REST hint!</em> A <em>delete</em> typically indicates a <em>removal</em> of something.
163
+ * </p>Executes DELETE with options for a route of the RESTApp.
164
+ *
165
+ * <p>
166
+ * <em>REST hint!</em> A <em>delete</em> typically indicates a <em>removal</em> of something.
167
+ * </p>
168
+ * @param <O> script object
169
+ * @author Magnus Lövgren
170
+ * @since Sitevision 7
171
+ * @see senselogic.sitevision.api.script.RestApi
172
+ * @see senselogic.sitevision.api.script.Requester
173
+ */
174
+ interface RestAppInvoker {
175
+ /**
176
+ * Executes GET for a route of the RESTApp.
177
+ *
178
+ * <p>
179
+ * <em>REST hint!</em> A <em>get</em> typically indicates a <em>read</em> of something.
180
+ * </p>
181
+ * @param aRoute a route
182
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
183
+ * @see #get(String, Object)
184
+ */
185
+ get(aRoute: string): unknown;
186
+
187
+ /**
188
+ * Executes GET with options for a route of the RESTApp.
189
+ *
190
+ * <p>
191
+ * <em>REST hint!</em> A <em>get</em> typically indicates a <em>read</em> of something.
192
+ * </p>
193
+ * @param aRoute a route
194
+ * @param aOptions a options
195
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
196
+ */
197
+ get(aRoute: string, aOptions: unknown): unknown;
198
+
199
+ /**
200
+ * Executes POST for a route of the RESTApp.
201
+ *
202
+ * <p>
203
+ * <em>REST hint!</em> A <em>post</em> typically indicates the <em>creation</em> of something.
204
+ * </p>
205
+ * @param aRoute a route
206
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
207
+ * @see #post(String, Object)
208
+ */
209
+ post(aRoute: string): unknown;
210
+
211
+ /**
212
+ * Executes POST with options for a route of the RESTApp.
213
+ *
214
+ * <p>
215
+ * <em>REST hint!</em> A <em>post</em> typically indicates the <em>creation</em> of something.
216
+ * </p>
217
+ * @param aRoute a route
218
+ * @param aOptions a options
219
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
220
+ */
221
+ post(aRoute: string, aOptions: unknown): unknown;
222
+
223
+ /**
224
+ * Executes PUT for a route of the RESTApp.
225
+ *
226
+ * <p>
227
+ * <em>REST hint!</em> A <em>put</em> typically indicates an <em>update</em> of something.
228
+ * </p>
229
+ * @param aRoute a route
230
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
231
+ * @see #put(String, Object)
232
+ */
233
+ put(aRoute: string): unknown;
234
+
235
+ /**
236
+ * Executes PUT with options for a route of the RESTApp.
237
+ *
238
+ * <p>
239
+ * <em>REST hint!</em> A <em>put</em> typically indicates an <em>update</em> of something.
240
+ * </p>
241
+ * @param aRoute a route
242
+ * @param aOptions a options
243
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
244
+ */
245
+ put(aRoute: string, aOptions: unknown): unknown;
246
+
247
+ /**
248
+ * Executes DELETE for a route of the RESTApp.
249
+ *
250
+ * <p>
251
+ * <em>REST hint!</em> A <em>delete</em> typically indicates a <em>removal</em> of something.
252
+ * </p>
253
+ * @param aRoute a route
254
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
255
+ * @see #delete(String, Object)
256
+ */
257
+ delete(aRoute: string): unknown;
258
+
259
+ /**
260
+ * Executes DELETE with options for a route of the RESTApp.
261
+ *
262
+ * <p>
263
+ * <em>REST hint!</em> A <em>delete</em> typically indicates a <em>removal</em> of something.
264
+ * </p>
265
+ * @param aRoute a route
266
+ * @param aOptions a options
267
+ * @return a script object representing the response (properties: headers, statusCode, statusMessage, body)
268
+ */
269
+ delete(aRoute: string, aOptions: unknown): unknown;
270
+ }
271
+
272
+ export default RestAppInvoker;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * This interface is a representation of a constructor argument (it's value and type) that can be used to
3
+ * create Java object instances via {@link InstanceCreatorUtil}.
4
+ *
5
+ * <p>
6
+ * An instance of the Sitevision class implementing this interface can be obtained via any of these methods:
7
+ * </p>
8
+ * <ul>
9
+ * <li>{@link InstanceCreatorUtil#getBooleanArgument(boolean)}</li>
10
+ * <li>{@link InstanceCreatorUtil#getByteArgument(byte)}</li>
11
+ * <li>{@link InstanceCreatorUtil#getCharArgument(char)}</li>
12
+ * <li>{@link InstanceCreatorUtil#getCustomArgument(String, Object)}</li>
13
+ * <li>{@link InstanceCreatorUtil#getDoubleArgument(double)}</li>
14
+ * <li>{@link InstanceCreatorUtil#getEnumArgument(String, Object)}</li>
15
+ * <li>{@link InstanceCreatorUtil#getFloatArgument(float)}</li>
16
+ * <li>{@link InstanceCreatorUtil#getIntArgument(int)}</li>
17
+ * <li>{@link InstanceCreatorUtil#getLongArgument(long)}</li>
18
+ * <li>{@link InstanceCreatorUtil#getNullArgument(String)}</li>
19
+ * <li>{@link InstanceCreatorUtil#getObjectArgument(Object)}</li>
20
+ * <li>{@link InstanceCreatorUtil#getShortArgument(short)}</li>
21
+ * </ul>
22
+ *
23
+ * <p>
24
+ * See {@link InstanceCreatorUtil} for how to obtain an instance of the <code>InstanceCreatorUtil</code> interface.
25
+ * </p>Gets the argument class.Gets the argument value.
26
+ * @author Magnus Lövgren
27
+ * @since Sitevision 3.1
28
+ */
29
+ interface TypedArgument {
30
+ /**
31
+ * Gets the argument class.
32
+ * @return the class of the argument
33
+ */
34
+ getType(): unknown;
35
+
36
+ /**
37
+ * Gets the argument value.
38
+ * @return the value of the argument
39
+ */
40
+ getValue(): unknown;
41
+ }
42
+
43
+ export default TypedArgument;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Decorates the iterator of a collection with a {@link ExceptionSuppressingIterator} to ensure exceptions are suppressed for all
3
+ * iterator invocations.
4
+ *
5
+ * <p>
6
+ * The sole purpose of the <code>ExceptionSuppressingCollection</code> is to provide easy access to a decorated iterator
7
+ * (i.e. an {@link ExceptionSuppressingIterator}). You should <em>not</em> create a collection of exception suppressing proxys
8
+ * (i.e. <code>Collection&lt;ExceptionSuppressingProxy&gt;</code>) yourself. You should use <code>ExceptionSuppressingCollection</code>
9
+ * with your "regular" collection since the actual proxying is done by the iterator itself.
10
+ * </p>
11
+ * <p>
12
+ * Note that the <code>next</code> method of the interator returns an instance of a <em>Dynamic proxy</em> so not all methods can be invoked
13
+ * directly on the returned object. To invoke a method that is not proxied (i.e. a method not declared in an interface the object implements),
14
+ * you must extract the "real" object from the proxy and use that reference when invoking the method. See {@link ExceptionSuppressingIterator}
15
+ * for more information about the iterator and {@link ExceptionSuppressingProxy} for more information about dynamic proxies and how to extract
16
+ * "real" object.
17
+ * </p>
18
+ *
19
+ * <p>
20
+ * <strong>Important note! </strong>This interface is intended to be used <em>only</em> in contexts where exceptions when iterating a
21
+ * collection will cause <em>serious</em> trouble if they arise and the context doesn't provide proper exception handling
22
+ * (e.g. when rendering a Velocity template). Suppressing exceptions is generally a bad idea and using this decorator will affect performance.
23
+ * Hence, this interface should only be used where the upsides with suppressing exceptions outweighs the downsides.
24
+ * This interface should be used only as a temporary patch/solution until the "real" problem causing the exception has been solved.
25
+ * </p>
26
+ *
27
+ * <p>
28
+ * An instance of the Sitevision class implementing this interface can be obtained via
29
+ * {@link senselogic.sitevision.api.Utils#getExceptionSuppressingCollection(java.util.Collection)}.
30
+ * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
31
+ * </p>
32
+ *
33
+ * <p>
34
+ * ----------------------------------------------------------------------------------------------------
35
+ * </p>
36
+ *
37
+ * <p>
38
+ * <strong>Example of how <code>ExceptionSuppressingCollection</code> could be used in Velocity:</strong>
39
+ * </p>
40
+ *
41
+ * <p>Case description:</p>
42
+ * <p>
43
+ * <em>You have a Velocity template where you iterate a collection. Sometimes a certain method throws an exception.
44
+ * The rendered output of the template gets corrupt whenever an exception is thrown and you have not yet tracked down the root
45
+ * cause of the exception. Until the root cause is found and the problem is fixed, you need a temporary solution that ignores
46
+ * exceptions to keep template output acceptable. Since the method is declared in an interface and implemented in the instance
47
+ * you're invoking, you're in sheer luck. You can decorate your collection with a <code>ExceptionSuppressingCollection</code>
48
+ * to get a decorated iterator. When interating, all returned elements are proxied by an <code>ExceptionSuppressingProxy</code>.
49
+ * Invoking the method through the proxy will suppress exceptions and you can diminish the output problems.
50
+ * Note that you should invoke the real object for all non-problematic methods and methods that can't be proxied
51
+ * (i.e. methods not declared in an interface). To get a reference to the real object,
52
+ * use {@link ExceptionSuppressingProxy#getProxiedObject()}.</em>
53
+ * </p>
54
+ * <p>
55
+ * This is what the code looks like before your temporary fix:
56
+ * </p>
57
+ * <pre><code>
58
+ * #foreach ($item in $myCollection)
59
+ * &lt;p&gt;
60
+ * $item.thisNeverThrowsExceptions()
61
+ * $item.thisMethodSometimesThrowsExceptions()
62
+ * &lt;/p&gt;
63
+ * #end
64
+ * </code></pre>
65
+ * <p>
66
+ * This is how you could use an <code>ExceptionSuppressingCollection</code> to apply a temporary fix:
67
+ * </p>
68
+ * <pre><code>
69
+ * <em>## Decorate collection</em>
70
+ * #set ($decoratedCollection = $sitevisionUtils.getExceptionSuppressingCollection($myCollection))
71
+ *
72
+ * #foreach ($item in $decoratedCollection)
73
+ * &lt;p&gt;
74
+ * <em>## Get the real object and invoke non-problematic method as usual</em>
75
+ * #set ($realObject = $item.getProxiedObject())
76
+ *
77
+ * $realObject.thisNeverThrowsExceptions()
78
+ * $!item.thisMethodSometimesThrowsExceptions() <em>## Executed through a proxy, might return null</em>
79
+ * &lt;/p&gt;
80
+ * #end
81
+ * &lt;/p&gt;
82
+ * </code></pre>Returns an exception suppressing iterator that ensures no exceptions will be thrown during iteration.
83
+ * @author Magnus Lövgren
84
+ * @since Sitevision 2.6.1_09
85
+ */
86
+ interface ExceptionSuppressingCollection {
87
+ /**
88
+ * Returns an exception suppressing iterator that ensures no exceptions will be thrown during iteration.
89
+ * @return a {@link ExceptionSuppressingIterator} that suppresses exceptions and returns proxied items
90
+ */
91
+ iterator(): unknown;
92
+ }
93
+
94
+ export default ExceptionSuppressingCollection;
@@ -0,0 +1,117 @@
1
+ import ExceptionSuppressingProxy from "../ExceptionSuppressingProxy";
2
+
3
+ /**
4
+ * Decorates an iterator with exception suppressing behaviour and returns {@link ExceptionSuppressingProxy}s in order to ensure that no
5
+ * invocation will throw an exception.
6
+ *
7
+ * <p>
8
+ * This iterator is of type <code>ExceptionSuppressingProxy</code> that is an implementation of a <em>Dynamic proxy</em> so not all
9
+ * methods can be directly invoked on objects retrieved by the <code>next</code> method. See {@link ExceptionSuppressingCollection}
10
+ * for an example of how this iterator can be used easily from Velocity and how to invoke methods not declared in an interface.
11
+ * See {@link ExceptionSuppressingProxy} for more information about dynamic proxies.
12
+ * </p>
13
+ * <p>
14
+ * <strong>Important note! </strong>This interface is intended to be used <em>only</em> in contexts where exceptions thrown during iteration will
15
+ * cause <em>serious</em> trouble if they arise and the context doesn't provide proper exception handling (e.g. when executing a Velocity template).
16
+ * Suppressing exceptions is generally a bad idea and using this iterator will affect performance.
17
+ * Hence, this interface should only be used where the upsides with suppressing exceptions far outweighs the downsides.
18
+ * This interface should be used only as a temporary patch/solution until the "real" problem causing the exception has been solved.
19
+ * </p>
20
+ *
21
+ * <p>
22
+ * An instance of the Sitevision class implementing this interface can be obtained directly via
23
+ * {@link senselogic.sitevision.api.Utils#getExceptionSuppressingIterator(java.util.Iterator)}
24
+ * or indirectly via {@link senselogic.sitevision.api.Utils#getExceptionSuppressingCollection(java.util.Collection)}.
25
+ * You would typically use the latter if you should iterate a collection with the Velocity #foreach loop.
26
+ * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
27
+ * </p>Returns <code>true</code> if decorated iterator has more elements. (In other words, returns <code>true</code>
28
+ * if <code>next</code> would return an element rather than throwing an exception.)
29
+ *
30
+ * <p>
31
+ * This method will never throw an exception
32
+ * </p>Returns a proxy for the next element of the decorated iterator. Calling this method repeatedly until the {@link #hasNext()} method
33
+ * returns <code>false</code> will return each element in the underlying collection exactly once.
34
+ *
35
+ * <p>
36
+ * <strong>Note!</strong> The returned element will be embedded in an <code>ExceptionSuppressingProxy</code> that will be reused for
37
+ * <em>all</em> next() invocations on this iterator. In other words, the proxied item of the returned element will change,
38
+ * but never the returned element itself. This implies that you shouldn't keep references to an item retrieved from a next()
39
+ * invocation during iteration. If you do, don't be surprised if the element contains something else than it did when you set the reference...
40
+ * </p>
41
+ *
42
+ * <p>
43
+ * This method will never throw an exception.
44
+ * </p>
45
+ * <p>
46
+ * <strong>Note! </strong>Be aware of <code>null</code> items since they're never proxied. If the underlying collection contains a
47
+ * <code>null</code> item, this iterator will just return <code>null</code>, not a proxy. In other words: even though this method
48
+ * won't throw any exceptions, invoking a method on the returned object might throw a <code>NullPointerException</code>.
49
+ * </p>Tries to remove from the underlying collection the last element returned by decorated iterator (optional operation).
50
+ * This method can be called only once per call to <code>next</code>. The behavior of an iterator is unspecified if
51
+ * the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
52
+ *
53
+ * <p>
54
+ * This method will never throw an exception.
55
+ * </p>
56
+ * <p>
57
+ * <strong>Note!</strong> Since exceptions are suppressed, you can never tell if the remove operation actually succeeded
58
+ * or if the underlying collection doesn't support removal (i.e. <code>UnsupportedOperationException</code> thrown by the
59
+ * decorated iterator is catched by this iterator).
60
+ * </p>
61
+ * @author Magnus Lövgren
62
+ * @since Sitevision 2.6.1_09
63
+ */
64
+ interface ExceptionSuppressingIterator {
65
+ /**
66
+ * Returns <code>true</code> if decorated iterator has more elements. (In other words, returns <code>true</code>
67
+ * if <code>next</code> would return an element rather than throwing an exception.)
68
+ *
69
+ * <p>
70
+ * This method will never throw an exception
71
+ * </p>
72
+ * @return <code>true</code> if the decorated iterator has more elements, <code>false</code> if not or if an exception is thrown by the decorated iterator
73
+ */
74
+ hasNext(): boolean;
75
+
76
+ /**
77
+ * Returns a proxy for the next element of the decorated iterator. Calling this method repeatedly until the {@link #hasNext()} method
78
+ * returns <code>false</code> will return each element in the underlying collection exactly once.
79
+ *
80
+ * <p>
81
+ * <strong>Note!</strong> The returned element will be embedded in an <code>ExceptionSuppressingProxy</code> that will be reused for
82
+ * <em>all</em> next() invocations on this iterator. In other words, the proxied item of the returned element will change,
83
+ * but never the returned element itself. This implies that you shouldn't keep references to an item retrieved from a next()
84
+ * invocation during iteration. If you do, don't be surprised if the element contains something else than it did when you set the reference...
85
+ * </p>
86
+ *
87
+ * <p>
88
+ * This method will never throw an exception.
89
+ * </p>
90
+ * <p>
91
+ * <strong>Note! </strong>Be aware of <code>null</code> items since they're never proxied. If the underlying collection contains a
92
+ * <code>null</code> item, this iterator will just return <code>null</code>, not a proxy. In other words: even though this method
93
+ * won't throw any exceptions, invoking a method on the returned object might throw a <code>NullPointerException</code>.
94
+ * </p>
95
+ * @return the next element, or <code>null</code> if an exception is thrown.
96
+ */
97
+ next(): ExceptionSuppressingProxy;
98
+
99
+ /**
100
+ * Tries to remove from the underlying collection the last element returned by decorated iterator (optional operation).
101
+ * This method can be called only once per call to <code>next</code>. The behavior of an iterator is unspecified if
102
+ * the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
103
+ *
104
+ * <p>
105
+ * This method will never throw an exception.
106
+ * </p>
107
+ * <p>
108
+ * <strong>Note!</strong> Since exceptions are suppressed, you can never tell if the remove operation actually succeeded
109
+ * or if the underlying collection doesn't support removal (i.e. <code>UnsupportedOperationException</code> thrown by the
110
+ * decorated iterator is catched by this iterator).
111
+ * </p>
112
+
113
+ */
114
+ remove(): void;
115
+ }
116
+
117
+ export default ExceptionSuppressingIterator;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Proxies an object and delegates all interface method invocations to the proxied object in order to ensure that no invocation
3
+ * will throw an exception.
4
+ *
5
+ * <p>
6
+ * This interface is an exception suppressing implementation of a so called
7
+ * <em><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/reflection/proxy.html">Dynamic proxy</a></em>.
8
+ * This means it will proxy all methods of an object that are declared in an interface implemented by the object.
9
+ * If a method invocation through this proxy throws an <code>Exception</code>, it will be catched and the default value will be returned
10
+ * (e.g. <code>null</code>, <code>0</code>, <code>false</code> etc).
11
+ * </p>
12
+ *
13
+ * <p>
14
+ * <strong>Important note! </strong>This interface is intended to be used <em>only</em> in contexts where exceptions will cause <em>serious</em>
15
+ * trouble if they arise and the context doesn't provide proper exception handling (e.g. when executing a Velocity template).
16
+ * Suppressing exceptions is generally a <em>really</em> bad idea and using this proxy will affect performance.
17
+ * Hence, this interface should only be used where the upsides with suppressing exceptions far outweighs the downsides.
18
+ * This interface should be used only as a temporary patch/solution until the "real" problem causing the exception has been solved.
19
+ * </p>
20
+ *
21
+ * <p>
22
+ * The state of an ExceptionSuppressingProxy is available at all times and updated for each method invocation
23
+ * (except for invocations of methods declared in this interface).
24
+ * If last method invocation resulted in a thrown exception the proxy status will be {@link #EXCEPTION_THROWN_STATUS}
25
+ * and the exception will be available via {@link #getCurrentException()}.
26
+ * </p>
27
+ *
28
+ * <p>
29
+ * An instance of the Sitevision class implementing this interface can be obtained via
30
+ * {@link senselogic.sitevision.api.Utils#getExceptionSuppressingProxy(Object)}.
31
+ * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
32
+ * </p>
33
+ *
34
+ * <p>
35
+ * ----------------------------------------------------------------------------------------------------
36
+ * </p>
37
+ *
38
+ * <p>
39
+ * <strong>Example of how <code>ExceptionSuppressingProxy</code> could be used in Velocity:</strong>
40
+ * </p>
41
+ *
42
+ * <p>Case description:</p>
43
+ * <p>
44
+ * <em>You have a Velocity template where a certain method invocation sometimes throws an exception.
45
+ * The rendered output of the template gets corrupt whenever an exception is thrown and you have not yet tracked down the root cause
46
+ * of the exception. Until the root cause is found and the problem is fixed, you need a temporary solution that ignores exceptions
47
+ * to keep template output acceptable. Since the method is declared in an interface and implemented in the instance you're invoking,
48
+ * you're in sheer luck. You can use an <code>ExceptionSuppressingProxy</code> to suppress exceptions in order to diminish output
49
+ * problems.</em><p>This is what the code looks like before your temporary fix:
50
+ * </p>
51
+ * <pre><code>
52
+ * &lt;p&gt;
53
+ * $myObject.thisNeverThrowsExceptions()
54
+ * $myObject.thisMethodSometimesThrowsExceptions() <em>## This method is declared in an interface, hence can be proxied</em>
55
+ * &lt;/p&gt;
56
+ * </code></pre>
57
+ * This is how you could use an <code>ExceptionSuppressingProxy</code> to apply a temporary fix:<pre><code>
58
+ * &lt;p&gt;
59
+ * $myObject.thisNeverThrowsExceptions()
60
+ *
61
+ * <em>## Get an ExceptionSuppressingProxy instance for myObject</em>
62
+ * #set ($proxy = $sitevisionUtils.getExceptionSuppressingProxy($myObject))
63
+ *
64
+ * $!proxy.thisMethodSometimesThrowsExceptions() <em>## Method invoked through a proxy, might return null</em>
65
+ * &lt;/p&gt;
66
+ * </code></pre>Returns current statusReturns the exception that was thrown during last method invocation of the proxied object.Returns the proxied objectThe status indicating that this proxy has no object set, nothing to proxy.The status indicating that last method invocation did not throw an exception.The status indicating that last method invocation did throw an exception
67
+ * @author Magnus Lövgren
68
+ * @since Sitevision 2.6.1_09
69
+ */
70
+ interface ExceptionSuppressingProxy {
71
+ /**
72
+ * Returns current status
73
+ * @return {@link #NO_OBJECT_PROXIED_STATUS} or {@link #NO_EXCEPTION_THROWN_STATUS} or {@link #EXCEPTION_THROWN_STATUS}
74
+ */
75
+ getCurrentStatus(): number;
76
+
77
+ /**
78
+ * Returns the exception that was thrown during last method invocation of the proxied object.
79
+ * @return the exception thrown during last method invocation, or <code>null</code> if no exeption was thrown
80
+ */
81
+ getCurrentException(): unknown;
82
+
83
+ /**
84
+ * Returns the proxied object
85
+ * @return the object that is proxied by an instance of this interface, or <code>null</code> if no proxied object is set
86
+ */
87
+ getProxiedObject(): unknown;
88
+ }
89
+
90
+ export default ExceptionSuppressingProxy;