@sitevision/api 1.0.19 → 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.
- package/common/router/index.d.ts +1 -1
- package/hidden/javax/jcr/Binary/index.d.ts +86 -0
- package/hidden/javax/jcr/Credentials/index.d.ts +11 -0
- package/hidden/javax/jcr/ImportUUIDBehavior/index.d.ts +11 -0
- package/hidden/javax/jcr/Item/index.d.ts +353 -0
- package/hidden/javax/jcr/ItemVisitor/index.d.ts +41 -0
- package/hidden/javax/jcr/NamespaceRegistry/index.d.ts +100 -0
- package/hidden/javax/jcr/Node/index.d.ts +2808 -0
- package/hidden/javax/jcr/NodeIterator/index.d.ts +18 -0
- package/hidden/javax/jcr/Property/index.d.ts +801 -0
- package/hidden/javax/jcr/PropertyIterator/index.d.ts +17 -0
- package/hidden/javax/jcr/RangeIterator/index.d.ts +75 -0
- package/hidden/javax/jcr/Repository/index.d.ts +318 -0
- package/hidden/javax/jcr/RepositoryFactory/index.d.ts +90 -0
- package/hidden/javax/jcr/Value/index.d.ts +190 -0
- package/hidden/javax/jcr/ValueFactory/index.d.ts +179 -0
- package/hidden/javax/jcr/Workspace/index.d.ts +1061 -0
- package/hidden/javax/jcr/lock/Lock/index.d.ts +142 -0
- package/hidden/javax/jcr/lock/LockManager/index.d.ts +217 -0
- package/hidden/javax/jcr/nodetype/ItemDefinition/index.d.ts +219 -0
- package/hidden/javax/jcr/nodetype/NodeDefinition/index.d.ts +158 -0
- package/hidden/javax/jcr/nodetype/NodeDefinitionTemplate/index.d.ts +74 -0
- package/hidden/javax/jcr/nodetype/NodeType/index.d.ts +349 -0
- package/hidden/javax/jcr/nodetype/NodeTypeDefinition/index.d.ts +248 -0
- package/hidden/javax/jcr/nodetype/NodeTypeIterator/index.d.ts +16 -0
- package/hidden/javax/jcr/nodetype/NodeTypeManager/index.d.ts +218 -0
- package/hidden/javax/jcr/nodetype/NodeTypeTemplate/index.d.ts +98 -0
- package/hidden/javax/jcr/nodetype/PropertyDefinition/index.d.ts +536 -0
- package/hidden/javax/jcr/nodetype/PropertyDefinitionTemplate/index.d.ts +97 -0
- package/hidden/javax/jcr/observation/Event/index.d.ts +133 -0
- package/hidden/javax/jcr/observation/EventIterator/index.d.ts +20 -0
- package/hidden/javax/jcr/observation/EventJournal/index.d.ts +22 -0
- package/hidden/javax/jcr/observation/EventListener/index.d.ts +23 -0
- package/hidden/javax/jcr/observation/EventListenerIterator/index.d.ts +20 -0
- package/hidden/javax/jcr/observation/ObservationManager/index.d.ts +227 -0
- package/hidden/javax/jcr/query/Query/index.d.ts +201 -0
- package/hidden/javax/jcr/query/QueryManager/index.d.ts +73 -0
- package/hidden/javax/jcr/query/QueryResult/index.d.ts +51 -0
- package/hidden/javax/jcr/query/Row/index.d.ts +159 -0
- package/hidden/javax/jcr/query/RowIterator/index.d.ts +20 -0
- package/hidden/javax/jcr/query/qom/And/index.d.ts +26 -0
- package/hidden/javax/jcr/query/qom/BindVariableValue/index.d.ts +15 -0
- package/hidden/javax/jcr/query/qom/ChildNode/index.d.ts +27 -0
- package/hidden/javax/jcr/query/qom/ChildNodeJoinCondition/index.d.ts +27 -0
- package/hidden/javax/jcr/query/qom/Column/index.d.ts +39 -0
- package/hidden/javax/jcr/query/qom/Comparison/index.d.ts +82 -0
- package/hidden/javax/jcr/query/qom/Constraint/index.d.ts +13 -0
- package/hidden/javax/jcr/query/qom/DescendantNode/index.d.ts +31 -0
- package/hidden/javax/jcr/query/qom/DescendantNodeJoinCondition/index.d.ts +29 -0
- package/hidden/javax/jcr/query/qom/DynamicOperand/index.d.ts +9 -0
- package/hidden/javax/jcr/query/qom/EquiJoinCondition/index.d.ts +41 -0
- package/hidden/javax/jcr/query/qom/FullTextSearch/index.d.ts +89 -0
- package/hidden/javax/jcr/query/qom/FullTextSearchScore/index.d.ts +24 -0
- package/hidden/javax/jcr/query/qom/Join/index.d.ts +36 -0
- package/hidden/javax/jcr/query/qom/JoinCondition/index.d.ts +9 -0
- package/hidden/javax/jcr/query/qom/Length/index.d.ts +24 -0
- package/hidden/javax/jcr/query/qom/Literal/index.d.ts +18 -0
- package/hidden/javax/jcr/query/qom/LowerCase/index.d.ts +26 -0
- package/hidden/javax/jcr/query/qom/NodeLocalName/index.d.ts +16 -0
- package/hidden/javax/jcr/query/qom/NodeName/index.d.ts +16 -0
- package/hidden/javax/jcr/query/qom/Not/index.d.ts +20 -0
- package/hidden/javax/jcr/query/qom/Operand/index.d.ts +9 -0
- package/hidden/javax/jcr/query/qom/Or/index.d.ts +30 -0
- package/hidden/javax/jcr/query/qom/Ordering/index.d.ts +53 -0
- package/hidden/javax/jcr/query/qom/PropertyExistence/index.d.ts +24 -0
- package/hidden/javax/jcr/query/qom/PropertyValue/index.d.ts +25 -0
- package/hidden/javax/jcr/query/qom/QueryObjectModel/index.d.ts +64 -0
- package/hidden/javax/jcr/query/qom/QueryObjectModelConstants/index.d.ts +9 -0
- package/hidden/javax/jcr/query/qom/QueryObjectModelFactory/index.d.ts +638 -0
- package/hidden/javax/jcr/query/qom/SameNode/index.d.ts +27 -0
- package/hidden/javax/jcr/query/qom/SameNodeJoinCondition/index.d.ts +36 -0
- package/hidden/javax/jcr/query/qom/Selector/index.d.ts +35 -0
- package/hidden/javax/jcr/query/qom/Source/index.d.ts +9 -0
- package/hidden/javax/jcr/query/qom/StaticOperand/index.d.ts +10 -0
- package/hidden/javax/jcr/query/qom/UpperCase/index.d.ts +26 -0
- package/hidden/javax/jcr/retention/Hold/index.d.ts +34 -0
- package/hidden/javax/jcr/retention/RetentionManager/index.d.ts +189 -0
- package/hidden/javax/jcr/retention/RetentionPolicy/index.d.ts +21 -0
- package/hidden/javax/jcr/security/AccessControlEntry/index.d.ts +24 -0
- package/hidden/javax/jcr/security/AccessControlList/index.d.ts +91 -0
- package/hidden/javax/jcr/security/AccessControlManager/index.d.ts +297 -0
- package/hidden/javax/jcr/security/AccessControlPolicy/index.d.ts +11 -0
- package/hidden/javax/jcr/security/AccessControlPolicyIterator/index.d.ts +20 -0
- package/hidden/javax/jcr/security/NamedAccessControlPolicy/index.d.ts +22 -0
- package/hidden/javax/jcr/security/Privilege/index.d.ts +117 -0
- package/hidden/javax/jcr/version/Version/index.d.ts +121 -0
- package/hidden/javax/jcr/version/VersionHistory/index.d.ts +307 -0
- package/hidden/javax/jcr/version/VersionIterator/index.d.ts +20 -0
- package/hidden/javax/jcr/version/VersionManager/index.d.ts +1082 -0
- package/hidden/senselogic/sitevision/api/base/Builder/index.d.ts +102 -0
- package/hidden/senselogic/sitevision/api/base/Filter/index.d.ts +25 -0
- package/hidden/senselogic/sitevision/api/base/FilterSplit/index.d.ts +50 -0
- package/hidden/senselogic/sitevision/api/base/Loadable/index.d.ts +15 -0
- package/hidden/senselogic/sitevision/api/base/Resolver/index.d.ts +31 -0
- package/hidden/senselogic/sitevision/api/base/Wrapper/index.d.ts +24 -0
- package/hidden/senselogic/sitevision/api/collaboration/CollaborationGroupWrapper/index.d.ts +417 -0
- package/hidden/senselogic/sitevision/api/format/NumericFormatter/index.d.ts +80 -0
- package/hidden/senselogic/sitevision/api/format/NumericFormatterBuilder/index.d.ts +100 -0
- package/hidden/senselogic/sitevision/api/i18n/Currency/index.d.ts +120 -0
- package/hidden/senselogic/sitevision/api/link/CustomLinkProcessor/index.d.ts +45 -0
- package/hidden/senselogic/sitevision/api/link/CustomLinkRenderData/index.d.ts +65 -0
- package/hidden/senselogic/sitevision/api/mail/Mail/index.d.ts +32 -0
- package/hidden/senselogic/sitevision/api/message/MessageTextLinker/index.d.ts +15 -0
- package/hidden/senselogic/sitevision/api/metadata/value/LinkValue/index.d.ts +23 -0
- package/hidden/senselogic/sitevision/api/metadata/value/RelatedValue/index.d.ts +23 -0
- package/hidden/senselogic/sitevision/api/property/VersionedPropertyUtil/index.d.ts +642 -0
- package/hidden/senselogic/sitevision/api/render/BuddyIconRenderer/BuddyIconInfo/index.d.ts +51 -0
- package/hidden/senselogic/sitevision/api/render/ImageScaler/index.d.ts +58 -0
- package/hidden/senselogic/sitevision/api/render/TextModuleRenderer/index.d.ts +301 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/ArticleUtilConstants/index.d.ts +85 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/ExceptionSuppressingProxyConstants/index.d.ts +31 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/IndexingUtilConstants/index.d.ts +31 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/LinkPageUtilConstants/index.d.ts +67 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/MathInstanceConstants/index.d.ts +25 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/MimeTypeUtilConstants/index.d.ts +19 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/NodeTypeUtilConstants/index.d.ts +1243 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/OutputUtilConstants/index.d.ts +31 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/PageUtilConstants/index.d.ts +91 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/PortletContextUtilConstants/index.d.ts +27 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/PortletUtilConstants/index.d.ts +19 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/QueryStringUtilConstants/index.d.ts +19 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/SearchHitConstants/index.d.ts +25 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/SearchResultConstants/index.d.ts +37 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/VersionUtilConstants/index.d.ts +25 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityAccess/index.d.ts +8 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityContext/index.d.ts +50 -0
- package/hidden/senselogic/sitevision/api/render/velocity/VelocityEvaluator/index.d.ts +89 -0
- package/hidden/senselogic/sitevision/api/script/RequesterChainable/index.d.ts +119 -0
- package/hidden/senselogic/sitevision/api/script/app/RestAppInvoker/index.d.ts +272 -0
- package/hidden/senselogic/sitevision/api/script/factory/TypedArgument/index.d.ts +43 -0
- package/hidden/senselogic/sitevision/api/script/proxy/ExceptionSuppressingCollection/index.d.ts +94 -0
- package/hidden/senselogic/sitevision/api/script/proxy/ExceptionSuppressingIterator/index.d.ts +117 -0
- package/hidden/senselogic/sitevision/api/script/proxy/ExceptionSuppressingProxy/index.d.ts +90 -0
- package/hidden/senselogic/sitevision/api/search/SearchFieldUtil/index.d.ts +89 -0
- package/hidden/senselogic/sitevision/api/search/SearchHighlighter/index.d.ts +45 -0
- package/hidden/senselogic/sitevision/api/search/SearchHit/index.d.ts +1176 -0
- package/hidden/senselogic/sitevision/api/search/SearchResult/index.d.ts +414 -0
- package/hidden/senselogic/sitevision/api/search/facet/SearchFacetField/index.d.ts +27 -0
- package/hidden/senselogic/sitevision/api/search/facet/SearchFacetValue/index.d.ts +61 -0
- package/hidden/senselogic/sitevision/api/search/searcher/Searcher/index.d.ts +277 -0
- package/hidden/senselogic/sitevision/api/search/searcher/component/Filter/index.d.ts +25 -0
- package/hidden/senselogic/sitevision/api/search/searcher/component/Highlight/index.d.ts +29 -0
- package/hidden/senselogic/sitevision/api/search/searcher/component/Monitor/index.d.ts +25 -0
- package/hidden/senselogic/sitevision/api/search/searcher/component/Parser/index.d.ts +35 -0
- package/hidden/senselogic/sitevision/api/search/searcher/component/Sort/index.d.ts +25 -0
- package/hidden/senselogic/sitevision/api/search/searcher/component/SpellCheck/index.d.ts +29 -0
- package/hidden/senselogic/sitevision/api/search/sort/CustomSort/index.d.ts +82 -0
- package/hidden/senselogic/sitevision/api/search/suggestion/SearchSuggestion/index.d.ts +21 -0
- package/hidden/senselogic/sitevision/api/security/DirectoryAttributes/index.d.ts +70 -0
- package/hidden/senselogic/sitevision/api/security/MessageDigester/index.d.ts +50 -0
- package/hidden/senselogic/sitevision/api/security/RoleAssignment/index.d.ts +72 -0
- package/hidden/senselogic/sitevision/api/security/RoleMatcher/index.d.ts +29 -0
- package/hidden/senselogic/sitevision/api/security/SecretStore/index.d.ts +55 -0
- package/hidden/senselogic/sitevision/api/security/UserUtil/index.d.ts +80 -0
- package/hidden/senselogic/sitevision/api/security/jaas/filter/AuthenticationFilter/index.d.ts +36 -0
- package/hidden/senselogic/sitevision/api/security/jaas/filter/AuthenticationFilterChain/index.d.ts +32 -0
- package/hidden/senselogic/sitevision/api/user/UserIdentityWrapper/index.d.ts +599 -0
- package/hidden/senselogic/sitevision/api/webresource/LinkTarget/index.d.ts +20 -0
- package/hidden/senselogic/sitevision/api/xml/XmlElement/index.d.ts +55 -0
- package/hidden/senselogic/sitevision/api/xml/XmlElementHandler/index.d.ts +17 -0
- package/package.json +2 -4
- package/server/AliasUtil/index.d.ts +25 -0
- package/server/AliasUtil/index.js +10 -0
- package/server/ArchiveUtil/index.d.ts +65 -11
- package/server/ArraysInstance/index.d.ts +1846 -0
- package/server/ArticleUtil/index.d.ts +381 -69
- package/server/AuthenticationUtil/index.d.ts +106 -0
- package/server/BookmarkUtil/index.d.ts +36 -28
- package/server/BuddyIconRenderer/index.d.ts +240 -0
- package/server/ClientUtil/index.d.ts +18 -4
- package/server/CollaborationFactory/index.d.ts +42 -25
- package/server/CollaborationGroupFolderUtil/index.d.ts +40 -29
- package/server/CollaborationGroupTemplateUtil/index.d.ts +71 -39
- package/server/CollaborationGroupUtil/index.d.ts +128 -55
- package/server/CollectionsInstance/index.d.ts +738 -0
- package/server/ColorUtil/index.d.ts +22 -17
- package/server/CompoundAndFilterBuilder/index.d.ts +60 -0
- package/server/CompoundComparatorBuilder/index.d.ts +63 -0
- package/server/CompoundOrFilterBuilder/index.d.ts +59 -0
- package/server/ContentNodeUtil/index.d.ts +76 -0
- package/server/CurrencyFactory/index.d.ts +135 -0
- package/server/DateUtil/index.d.ts +154 -77
- package/server/DecorationUtil/index.d.ts +23 -0
- package/server/DeviceUtil/index.d.ts +36 -0
- package/server/DirectoryUtil/index.d.ts +107 -47
- package/server/DocTypeUtil/index.d.ts +149 -0
- package/server/EndecUtil/index.d.ts +537 -91
- package/server/ExtendedDismaxParserBuilder/index.d.ts +311 -0
- package/server/FileIconRenderer/index.d.ts +346 -0
- package/server/FileUtil/index.d.ts +462 -0
- package/server/FilterBuilder/index.d.ts +120 -0
- package/server/FolderUtil/index.d.ts +161 -0
- package/server/FontUtil/index.d.ts +49 -0
- package/server/FormatterBuilderFactory/index.d.ts +129 -0
- package/server/HighlightBuilder/index.d.ts +194 -0
- package/server/IconUtil/index.d.ts +37 -0
- package/server/ImageLinkRenderer/index.d.ts +134 -0
- package/server/ImageRenderer/index.d.ts +613 -231
- package/server/ImageUtil/index.d.ts +430 -0
- package/server/IndexUtil/index.d.ts +71 -0
- package/server/IndexingUtil/index.d.ts +92 -0
- package/server/InstanceCreatorUtil/index.d.ts +661 -0
- package/server/InstanceTypeUtil/index.d.ts +202 -0
- package/server/JwtUtil/index.d.ts +217 -0
- package/server/LandingPageUtil/index.d.ts +67 -50
- package/server/LinkPageUtil/index.d.ts +468 -0
- package/server/LinkRenderer/index.d.ts +1157 -0
- package/server/LinkTargetBuilder/index.d.ts +146 -0
- package/server/LinkValueBuilder/index.d.ts +129 -52
- package/server/ListWrapper/index.d.ts +172 -0
- package/server/LocaleUtil/index.d.ts +695 -61
- package/server/LogUtil/index.d.ts +118 -77
- package/server/MailBuilder/index.d.ts +238 -0
- package/server/MailUtil/index.d.ts +98 -0
- package/server/MathInstance/index.d.ts +681 -0
- package/server/MessageDigesterFactory/index.d.ts +49 -0
- package/server/MetadataDefinitionUtil/index.d.ts +118 -0
- package/server/MetadataUtil/index.d.ts +524 -79
- package/server/MimeTypeUtil/index.d.ts +316 -0
- package/server/MonitorBuilder/index.d.ts +51 -0
- package/server/NodeComparatorUtil/index.d.ts +397 -0
- package/server/NodeFactoryUtil/index.d.ts +32 -0
- package/server/NodeFilterUtil/index.d.ts +924 -0
- package/server/NodeIteratorUtil/index.d.ts +322 -72
- package/server/NodeResolverUtil/index.d.ts +767 -0
- package/server/NodeTreeUtil/index.d.ts +339 -63
- package/server/NodeTypeUtil/index.d.ts +391 -197
- package/server/OfflineVersionPropertyUtil/index.d.ts +30 -0
- package/server/OnlineVersionPropertyUtil/index.d.ts +30 -0
- package/server/OutputUtil/index.d.ts +641 -0
- package/server/PageUtil/index.d.ts +330 -0
- package/server/PermissionUtil/index.d.ts +650 -0
- package/server/PortletContextUtil/index.d.ts +118 -37
- package/server/PortletContextUtil/index.js +1 -0
- package/server/PortletUtil/index.d.ts +40 -0
- package/server/PrincipalUtil/index.d.ts +51 -0
- package/server/Properties/index.d.ts +185 -38
- package/server/PropertyUtil/index.d.ts +2330 -406
- package/server/PublishingUtil/index.d.ts +385 -49
- package/server/QueryStringUtil/index.d.ts +737 -0
- package/server/RedirectUtil/index.d.ts +98 -0
- package/server/RelatedValueBuilder/index.d.ts +81 -39
- package/server/Requester/index.d.ts +441 -65
- package/server/ResourceLocatorUtil/index.d.ts +483 -227
- package/server/RestApi/index.d.ts +208 -23
- package/server/RestAppInvokerFactory/index.d.ts +73 -0
- package/server/RoleAssignmentBuilder/index.d.ts +60 -0
- package/server/RoleMatcherBuilder/index.d.ts +59 -0
- package/server/RoleUtil/index.d.ts +57 -0
- package/server/ScriptUtil/index.d.ts +625 -143
- package/server/SearchFactory/index.d.ts +133 -0
- package/server/SearchUtil/index.d.ts +164 -0
- package/server/SearcherBuilder/index.d.ts +260 -0
- package/server/Session/index.d.ts +1758 -0
- package/server/SimpleUserUtil/index.d.ts +39 -30
- package/server/SiteCookieUtil/index.d.ts +78 -53
- package/server/SortBuilder/index.d.ts +111 -0
- package/server/SpellCheckBuilder/index.d.ts +68 -0
- package/server/StandardParserBuilder/index.d.ts +112 -0
- package/server/StructureUtil/index.d.ts +167 -0
- package/server/SubscriberUtil/index.d.ts +122 -0
- package/server/SubscriptionUtil/index.d.ts +197 -0
- package/server/SystemUserUtil/index.d.ts +201 -98
- package/server/TagUtil/index.d.ts +193 -0
- package/server/TemplateUtil/index.d.ts +217 -0
- package/server/TemporaryFileNodeBuilder/index.d.ts +63 -0
- package/server/TemporaryNodeBuilder/index.d.ts +241 -0
- package/server/TextModuleRendererBuilder/index.d.ts +68 -0
- package/server/TimestampUtil/index.d.ts +98 -82
- package/server/TranslationUtil/index.d.ts +175 -0
- package/server/TrashcanUtil/index.d.ts +193 -24
- package/server/UserDataUtil/index.d.ts +167 -85
- package/server/UserFactory/index.d.ts +45 -30
- package/server/UserFieldRenderer/index.d.ts +258 -0
- package/server/UserIdentityUtil/index.d.ts +61 -29
- package/server/UserUtil/index.d.ts +69 -28
- package/server/Utils/index.d.ts +870 -12
- package/server/VelocityRenderer/index.d.ts +248 -0
- package/server/VersionUtil/index.d.ts +15 -12
- package/server/WebContentUtil/index.d.ts +644 -0
- package/server/WebResourceFactory/index.d.ts +66 -0
- package/server/XSLTUtil/index.d.ts +49 -10
- package/server/XmlParserUtil/index.d.ts +82 -81
- package/builtins/Binary/index.d.ts +0 -3
- package/builtins/Calendar/index.d.ts +0 -3
- package/builtins/Collection/index.d.ts +0 -3
- package/builtins/Date/index.d.ts +0 -3
- package/builtins/InputStream/index.d.ts +0 -3
- package/builtins/Instant/index.d.ts +0 -3
- package/builtins/List/index.d.ts +0 -3
- package/builtins/LocalDateTime/index.d.ts +0 -3
- package/builtins/Locale/index.d.ts +0 -3
- package/builtins/Node/index.d.ts +0 -3
- package/builtins/NodeIterator/index.d.ts +0 -27
- package/builtins/Property/index.d.ts +0 -3
- package/builtins/Serializable/index.d.ts +0 -3
- package/builtins/Set/index.d.ts +0 -3
- package/builtins/Throwable/index.d.ts +0 -3
- package/builtins/byte/index.d.ts +0 -3
|
@@ -1,214 +1,696 @@
|
|
|
1
|
-
import List from "../../builtins/List";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function flatten(aString: string): string;
|
|
2
|
+
* Gets the boolean true primitive.
|
|
3
|
+
* @return <code>true</code>
|
|
4
|
+
*/
|
|
5
|
+
export function getTrue(): boolean;
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
|
-
* Gets the boolean false primitive.
|
|
11
|
-
* @
|
|
12
|
-
*/
|
|
8
|
+
* Gets the boolean false primitive.
|
|
9
|
+
* @return <code>false</code>
|
|
10
|
+
*/
|
|
13
11
|
export function getFalse(): boolean;
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export function getHumanPresentableSize(aSize: number): string;
|
|
14
|
+
* Gets the null reference.
|
|
15
|
+
* @return <code>null</code>
|
|
16
|
+
*/
|
|
17
|
+
export function getNull(): unknown;
|
|
21
18
|
|
|
22
19
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
* Gets an object that is ensured not to be null.
|
|
21
|
+
*
|
|
22
|
+
* <p>
|
|
23
|
+
* This is a convenience method that can be used to avoid unnecessary subsequent method invocations in Velocity.
|
|
24
|
+
* </p>
|
|
25
|
+
*
|
|
26
|
+
* <p>
|
|
27
|
+
* Velocity ignores <code>null</code> assignments and trying to assign a null reference will be logged as a WARNING message.
|
|
28
|
+
* A common strategy to work around this is to use the the Velocity <code>#if</code> clause. It allows for easy non-null
|
|
29
|
+
* checks - a <code>null</code> object is considered to be <code>false</code>. The downside with this strategy is that it
|
|
30
|
+
* requires two subsequent method invocations. That can of course be a really bad thing if the method does costly things. This method
|
|
31
|
+
* can be used to avoid such problems.
|
|
32
|
+
* </p>
|
|
33
|
+
*
|
|
34
|
+
* <p>
|
|
35
|
+
* <strong>An example</strong><br>
|
|
36
|
+
* This Velocity code:
|
|
37
|
+
* </p>
|
|
38
|
+
* <pre><code> #if ($anObject.getPersonOrNull())
|
|
39
|
+
* #set ($person = $anObject.getPersonOrNull())
|
|
40
|
+
* $person.getName()
|
|
41
|
+
* ...
|
|
42
|
+
* #end</code></pre>
|
|
43
|
+
* Can be better utilized as:
|
|
44
|
+
* <pre><code> #set ($scriptUtil = ...)
|
|
45
|
+
*
|
|
46
|
+
* #set ($person = $scriptUtil.getNonNull(${anObject.getPersonOrNull()}))
|
|
47
|
+
* #if ($person)
|
|
48
|
+
* $person.getName()
|
|
49
|
+
* ...
|
|
50
|
+
* #end
|
|
51
|
+
* </code></pre>
|
|
52
|
+
* @param anObject the object that might be <code>null</code>
|
|
53
|
+
* @return anObject if non-null, <code>Boolean.FALSE</code> otherwise
|
|
54
|
+
* @see #getNonNull(Object, Object)
|
|
55
|
+
* @see #getNonBlank(String)
|
|
56
|
+
* @since Sitevision 2.6.2
|
|
57
|
+
*/
|
|
58
|
+
export function getNonNull(anObject: unknown): unknown;
|
|
28
59
|
|
|
29
60
|
/**
|
|
30
|
-
* Gets an object that is ensured not to be null or a whitespace only string.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
61
|
+
* Gets an object that is ensured not to be null or a whitespace only string.
|
|
62
|
+
*
|
|
63
|
+
* <p>
|
|
64
|
+
* This is a convenience method that can be used to avoid unnecessary subsequent method invocations in Velocity.
|
|
65
|
+
* </p>
|
|
66
|
+
*
|
|
67
|
+
* <p>
|
|
68
|
+
* Velocity ignores <code>null</code> assignments and trying to assign a null reference will be logged as a WARNING message.
|
|
69
|
+
* A common strategy to work around this is to use the the Velocity <code>#if</code> clause. It allows for easy non-null
|
|
70
|
+
* checks - a <code>null</code> object is considered to be <code>false</code>. The downside with this strategy is that it
|
|
71
|
+
* requires two subsequent method invocations. That can of course be a really bad thing if the method does costly things. This method
|
|
72
|
+
* can be used to avoid such problems.
|
|
73
|
+
* </p>
|
|
74
|
+
*
|
|
75
|
+
* <p>
|
|
76
|
+
* <strong>An example</strong><br>
|
|
77
|
+
* This Velocity code:
|
|
78
|
+
* </p>
|
|
79
|
+
* <pre><code> #if ($anObject.getPersonNameThatCanBeNullOrEmptyOrWhitespaceOnly())
|
|
80
|
+
* #set ($name = $anObject.getPersonNameThatCanBeNullOrEmptyOrWhitespaceOnly())
|
|
81
|
+
* #if ($name.trim().length() > 0)
|
|
82
|
+
* <p>
|
|
83
|
+
* $name
|
|
84
|
+
* </p>
|
|
85
|
+
* #end
|
|
86
|
+
* #end</code></pre>
|
|
87
|
+
* Can be better utilized as:
|
|
88
|
+
* <pre><code> #set ($scriptUtil = ...)
|
|
89
|
+
*
|
|
90
|
+
* #set ($name = $scriptUtil.getNonBlank(${anObject.getPersonNameThatCanBeNullOrEmptyOrWhitespaceOnly()}))
|
|
91
|
+
* #if ($name)
|
|
92
|
+
* <p>
|
|
93
|
+
* $name
|
|
94
|
+
* </p>
|
|
95
|
+
* #end
|
|
96
|
+
* </code></pre>
|
|
97
|
+
*
|
|
98
|
+
* <p>
|
|
99
|
+
* <strong>A typical example when using {@link senselogic.sitevision.api.property.PropertyUtil} and whitespace is an issue</strong><br>
|
|
100
|
+
* This Velocity code:
|
|
101
|
+
* </p>
|
|
102
|
+
* <pre><code> #if ($propertyUtil.getString($theNode, 'thePropertyName'))
|
|
103
|
+
* #set ($propertyValue = $propertyUtil.getString($theNode, 'thePropertyName'))
|
|
104
|
+
* #if ($propertyValue.trim().length() > 0)
|
|
105
|
+
* <p>
|
|
106
|
+
* $propertyValue
|
|
107
|
+
* </p>
|
|
108
|
+
* #end
|
|
109
|
+
* #end</code></pre>
|
|
110
|
+
* Can be better utilized as:
|
|
111
|
+
* <pre><code> #set ($scriptUtil = ...)
|
|
112
|
+
*
|
|
113
|
+
* #set ($propertyValue = $scriptUtil.getNonBlank(${propertyUtil.getString($theNode, 'thePropertyName')}))
|
|
114
|
+
* #if ($propertyValue)
|
|
115
|
+
* <p>
|
|
116
|
+
* $propertyValue
|
|
117
|
+
* </p>
|
|
118
|
+
* #end
|
|
119
|
+
* </code></pre>
|
|
120
|
+
* @param aString the string that might be <code>null</code> or whitespace only
|
|
121
|
+
* @return aString if <code>aString</code> is non-null and not whitespace only, <code>Boolean.FALSE</code> otherwise
|
|
122
|
+
* @see #getNonBlank(String, Object)
|
|
123
|
+
* @since Sitevision 3.6
|
|
124
|
+
*/
|
|
125
|
+
export function getNonBlank(aString: string): unknown;
|
|
35
126
|
|
|
36
127
|
/**
|
|
37
|
-
* Gets a default value if
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @
|
|
41
|
-
|
|
42
|
-
|
|
128
|
+
* Gets a default value if an object is null.
|
|
129
|
+
* @param anObject the object that might be <code>null</code>
|
|
130
|
+
* @param aDefaultValue the default value to return if <code>anObject</code> is <code>null</code>
|
|
131
|
+
* @return anObject if non-null, <code>aDefaultValue</code> otherwise
|
|
132
|
+
* @see #getNonNull(Object)
|
|
133
|
+
* @since Sitevision 2.6.2
|
|
134
|
+
*/
|
|
135
|
+
export function getNonNull(anObject: unknown, aDefaultValue: unknown): unknown;
|
|
43
136
|
|
|
44
137
|
/**
|
|
45
|
-
* Gets
|
|
46
|
-
* @param
|
|
47
|
-
* @
|
|
48
|
-
|
|
49
|
-
|
|
138
|
+
* Gets a default value if a string is null or whitespace only.
|
|
139
|
+
* @param aString the string that might be <code>null</code> or whitespace only
|
|
140
|
+
* @param aDefaultValue the default value to return if <code>aString</code> is <code>null</code> or whitespace only
|
|
141
|
+
* @return aString if <code>aString</code> is non-null and not whitespace only, <code>aDefaultValue</code> otherwise
|
|
142
|
+
* @see #getNonBlank(String)
|
|
143
|
+
* @since Sitevision 3.6
|
|
144
|
+
*/
|
|
145
|
+
export function getNonBlank(aString: string, aDefaultValue: unknown): unknown;
|
|
50
146
|
|
|
51
147
|
/**
|
|
52
|
-
*
|
|
53
|
-
* @param
|
|
54
|
-
* @
|
|
55
|
-
* @
|
|
56
|
-
|
|
57
|
-
|
|
148
|
+
* Checks if a string is not null and not empty.
|
|
149
|
+
* @param aString the string to check
|
|
150
|
+
* @return <code>true</code> if <code>aString</code> is not <code>null</code> and not empty, <code>false</code> otherwise
|
|
151
|
+
* @see #isNotBlank(String)
|
|
152
|
+
* @since Sitevision 2.6
|
|
153
|
+
*/
|
|
154
|
+
export function isNotEmpty(aString: string): boolean;
|
|
58
155
|
|
|
59
156
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @
|
|
62
|
-
|
|
63
|
-
|
|
157
|
+
* Checks if a string is null or empty.
|
|
158
|
+
* @param aString the string to check
|
|
159
|
+
* @return <code>true</code> if <code>aString</code> is <code>null</code> or empty, <code>false</code> otherwise
|
|
160
|
+
* @see #isBlank(String)
|
|
161
|
+
* @since Sitevision 3.6.2
|
|
162
|
+
*/
|
|
163
|
+
export function isEmpty(aString: string): boolean;
|
|
64
164
|
|
|
65
165
|
/**
|
|
66
|
-
*
|
|
67
|
-
* @
|
|
68
|
-
|
|
69
|
-
|
|
166
|
+
* Checks if a string is not null, not empty and not whitespace only.
|
|
167
|
+
* @param aString the string to check
|
|
168
|
+
* @return <code>true</code> if <code>aString</code> is not <code>null</code>, not empty and not whitespace only - <code>false</code> otherwise
|
|
169
|
+
* @see #isNotEmpty(String)
|
|
170
|
+
* @since Sitevision 2.6
|
|
171
|
+
*/
|
|
172
|
+
export function isNotBlank(aString: string): boolean;
|
|
70
173
|
|
|
71
174
|
/**
|
|
72
|
-
* Checks if a string is null, empty or whitespace only.
|
|
73
|
-
* @param
|
|
74
|
-
* @
|
|
75
|
-
|
|
175
|
+
* Checks if a string is null, empty or whitespace only.
|
|
176
|
+
* @param aString the string to check
|
|
177
|
+
* @return <code>true</code> if <code>aString</code> is <code>null</code>, empty or whitespace only - <code>false</code> otherwise
|
|
178
|
+
* @see #isEmpty(String)
|
|
179
|
+
* @since Sitevision 3.6.2
|
|
180
|
+
*/
|
|
76
181
|
export function isBlank(aString: string): boolean;
|
|
77
182
|
|
|
78
183
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
184
|
+
* Gets a system property. This method invokes the getProperty method of the java.lang.System class, i.e <code>System.getProperty(String)</code>.
|
|
185
|
+
*
|
|
186
|
+
* <p>
|
|
187
|
+
* <strong>Important note!</strong><br>
|
|
188
|
+
* This method can be used to reveal potential sensitive information about the server.
|
|
189
|
+
* </p>
|
|
190
|
+
* <p>
|
|
191
|
+
* Allowed properties:
|
|
192
|
+
* </p>
|
|
193
|
+
* <ul>
|
|
194
|
+
* <li>"sitevision.version" (5.1)</li>
|
|
195
|
+
* <li>"sitevision.build" (5.1)</li>
|
|
196
|
+
* <li>"sitevision.environment.type" (5.2.1)</li>
|
|
197
|
+
* </ul>
|
|
198
|
+
* <p>
|
|
199
|
+
* A legacy mode that enables the API to return all properties can be enabled using the following system property:<br>
|
|
200
|
+
* <em>sitevision.api.scriptutil.legacy_system_properties=true</em>
|
|
201
|
+
* </p>
|
|
202
|
+
*
|
|
203
|
+
* <p>
|
|
204
|
+
* A tip if you need to do backward compatibility workarounds: The Sitevision version is accessible as a system property
|
|
205
|
+
* named <em>sitevision.version</em>.
|
|
206
|
+
* </p>
|
|
207
|
+
* @param aName the name of the system property
|
|
208
|
+
* @return the value of the system property, or <code>null</code> if indeterminable (e.g. no accessible property named <code>aName</code> exist)
|
|
209
|
+
* @since Sitevision 2.6_02
|
|
210
|
+
* @deprecated Exposes server information and will therefore be removed in future releases of Sitevision
|
|
211
|
+
*/
|
|
212
|
+
export function getSystemProperty(aName: string): string;
|
|
84
213
|
|
|
85
214
|
/**
|
|
86
|
-
*
|
|
87
|
-
* @param
|
|
88
|
-
* @
|
|
89
|
-
|
|
90
|
-
|
|
215
|
+
* Creates and returns an instance of a Java class.
|
|
216
|
+
* @param aQualifiedClassName a fully qualified name of the class (i.e. including packages)
|
|
217
|
+
* @return an instance of the class, or <code>null</code> if an instance can not be created
|
|
218
|
+
* @deprecated Use {@link senselogic.sitevision.api.script.factory.InstanceCreatorUtil#getDefaultInstance(String)} instead
|
|
219
|
+
*/
|
|
220
|
+
export function getInstance(aQualifiedClassName: string): unknown;
|
|
91
221
|
|
|
92
222
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @param
|
|
95
|
-
* @
|
|
96
|
-
|
|
97
|
-
|
|
223
|
+
* Methods that wraps an array in a <code>List</code>. Arrays are sub optimal in Velocity and JavaScript.
|
|
224
|
+
* @param anArray an array that needs to be wrapped
|
|
225
|
+
* @return a list containing the array elements. If the array is <code>null</code>, <code>null</code> is returned
|
|
226
|
+
* @since Sitevision 2.6_06
|
|
227
|
+
*/
|
|
228
|
+
export function getList(anArray: unknown): unknown[];
|
|
98
229
|
|
|
99
230
|
/**
|
|
100
|
-
*
|
|
101
|
-
* @param
|
|
102
|
-
* @
|
|
103
|
-
|
|
104
|
-
|
|
231
|
+
* Gets the date format pattern used in the Sitevision editor for a specific Locale.
|
|
232
|
+
* @param aLocale the <code>Locale</code> that specifies the date format pattern
|
|
233
|
+
* @return the date format pattern used in the Sitevision editor that corresponds to <code>aLocale</code>. If <code>aLocale</code> is <code>null</code> then the current locale (as of {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentLocale()}) is used to locate the format pattern. If no pattern exist for <code>aLocale</code> then the pattern that corresponds to <code>Locale.ENGLISH</code> will be returned.
|
|
234
|
+
* @since Sitevision 2.6.1_02
|
|
235
|
+
* @deprecated use {@link senselogic.sitevision.api.date.DateUtil#getEditorFormatPattern(java.util.Locale)} instead
|
|
236
|
+
*/
|
|
237
|
+
export function getFormatPattern(aLocale: unknown): string;
|
|
105
238
|
|
|
106
239
|
/**
|
|
107
|
-
*
|
|
108
|
-
* @param
|
|
109
|
-
* @
|
|
110
|
-
|
|
111
|
-
|
|
240
|
+
* Methods that formats a date according to a <code>SimpleDateFormat</code> pattern
|
|
241
|
+
* @param aFormatPattern date to string pattern according to <code>SimpleDateFormat</code>. If <code>null</code> is specified the default format is used
|
|
242
|
+
* @param aDate the <code>Date</code>
|
|
243
|
+
* @return returns a <code>String</code> representation of <code>aDate</code> according to <code>aFormatPattern</code>. Returns <code>null</code> if <code>aDate</code> is <code>null</code>.
|
|
244
|
+
* @since Sitevision 2.6_06
|
|
245
|
+
* @deprecated use {@link senselogic.sitevision.api.date.DateUtil#getDateAsString(String, java.util.Date)} instead
|
|
246
|
+
*/
|
|
247
|
+
export function getDateAsString(aFormatPattern: string, aDate: unknown): string;
|
|
112
248
|
|
|
113
249
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @returns
|
|
118
|
-
|
|
119
|
-
|
|
250
|
+
* Methods that formats the date of a calendar according to a <code>SimpleDateFormat</code> pattern
|
|
251
|
+
* @param aFormatPattern date to string pattern according to <code>SimpleDateFormat</code>. If <code>null</code> is specified the default format is used
|
|
252
|
+
* @param aCalendar the <code>Calendar</code>
|
|
253
|
+
* @return returns a <code>String</code> representation of the date of <code>aCalendar</code> according to <code>aFormatPattern</code>. Returns <code>null</code> if <code>aDate</code> is <code>null</code>.
|
|
254
|
+
* @since Sitevision 2.6.1_02
|
|
255
|
+
* @deprecated use {@link senselogic.sitevision.api.date.DateUtil#getCalendarAsString(String, java.util.Calendar)} instead
|
|
256
|
+
*/
|
|
257
|
+
export function getCalendarAsString(
|
|
258
|
+
aFormatPattern: string,
|
|
259
|
+
aCalendar: unknown
|
|
260
|
+
): string;
|
|
120
261
|
|
|
121
262
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
263
|
+
* Methods that returns a human presentable size with an appropriate byte-suffix (bytes/kB/MB/GB/TB).
|
|
264
|
+
* <p>
|
|
265
|
+
* Note! This method uses two significant digits and 1024 as base. Some examples:<br>
|
|
266
|
+
* <code>126</code> -> "<code>130 bytes</code>"<br>
|
|
267
|
+
* <code>126975</code> -> "<code>120 kB</code>"<br>
|
|
268
|
+
* <code>456456456</code> -> "<code>440 MB</code>"
|
|
269
|
+
* </p>
|
|
270
|
+
* @param aSize a size that should be presented for humans
|
|
271
|
+
* @return a human presentable byte-suffixed size with two significant digits. If <code>aSize</code> is less than 0 or larger than 1125899906842624 (1024 TB), an empty String will be returned.
|
|
272
|
+
* @since Sitevision 2.6.1_04
|
|
273
|
+
*/
|
|
274
|
+
export function getHumanPresentableSize(aSize: number): string;
|
|
128
275
|
|
|
129
276
|
/**
|
|
130
|
-
*
|
|
131
|
-
* @param
|
|
132
|
-
* @
|
|
133
|
-
* @
|
|
134
|
-
*/
|
|
135
|
-
export function
|
|
277
|
+
* Method that converts a string to an int.
|
|
278
|
+
* @param aString the string to be converted
|
|
279
|
+
* @return <code>aString</code> as <code>int</code>. If <code>aString</code> is <code>null</code> or can't be converted, -1 is returned
|
|
280
|
+
* @since Sitevision 2.6.1_04
|
|
281
|
+
*/
|
|
282
|
+
export function stringToInt(aString: string): number;
|
|
136
283
|
|
|
137
284
|
/**
|
|
138
|
-
* Method that converts a string to a
|
|
139
|
-
* @param
|
|
140
|
-
* @
|
|
141
|
-
|
|
285
|
+
* Method that converts a string to a long.
|
|
286
|
+
* @param aString the string to be converted
|
|
287
|
+
* @return <code>aString</code> as <code>long</code>. If <code>aString</code> is <code>null</code> or can't be converted, -1 is returned
|
|
288
|
+
* @since Sitevision 2.6.1_04
|
|
289
|
+
*/
|
|
290
|
+
export function stringToLong(aString: string): number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Method that converts a string to a double.
|
|
294
|
+
* @param aString the string to be converted
|
|
295
|
+
* @return <code>aString</code> as <code>double</code>. If <code>aString</code> is <code>null</code> or can't be converted, -1.0 is returned
|
|
296
|
+
* @since Sitevision 2.6.1_04
|
|
297
|
+
*/
|
|
142
298
|
export function stringToDouble(aString: string): number;
|
|
143
299
|
|
|
144
300
|
/**
|
|
145
|
-
* Method that converts a string to a float.
|
|
146
|
-
* @param
|
|
147
|
-
* @
|
|
148
|
-
|
|
301
|
+
* Method that converts a string to a float.
|
|
302
|
+
* @param aString the string to be converted
|
|
303
|
+
* @return <code>aString</code> as <code>float</code>. If <code>aString</code> is <code>null</code> or can't be converted, -1.0 is returned
|
|
304
|
+
* @since Sitevision 2.6.1_04
|
|
305
|
+
*/
|
|
149
306
|
export function stringToFloat(aString: string): number;
|
|
150
307
|
|
|
151
308
|
/**
|
|
152
|
-
* Method that
|
|
153
|
-
* @param
|
|
154
|
-
* @returns
|
|
155
|
-
|
|
156
|
-
|
|
309
|
+
* Method that returns true for values that can be interpreted as the true value.
|
|
310
|
+
* @param anObject an Object that might be interpreted as a true value
|
|
311
|
+
* @return returns <code>true</code> if <code>anObject</code> is a <code>Boolean</code> with a <code>true</code> value or a <code>String</code> with a "<code>true</code>" value, <code>false</code> otherwise.
|
|
312
|
+
* @since Sitevision 2.6.1_04
|
|
313
|
+
*/
|
|
314
|
+
export function isTrue(anObject: unknown): boolean;
|
|
157
315
|
|
|
158
316
|
/**
|
|
159
|
-
* Method that
|
|
160
|
-
* @param
|
|
161
|
-
* @returns
|
|
162
|
-
|
|
163
|
-
|
|
317
|
+
* Method that returns true for values that can be interpreted as the false value.
|
|
318
|
+
* @param anObject an Object that might be interpreted as a false value
|
|
319
|
+
* @return returns <code>true</code> if <code>anObject</code> is a <code>Boolean</code> with a <code>false</code> value or a <code>String</code> with a "<code>false</code>" value, <code>false</code> otherwise.
|
|
320
|
+
* @since Sitevision 2.6.1_04
|
|
321
|
+
*/
|
|
322
|
+
export function isFalse(anObject: unknown): boolean;
|
|
164
323
|
|
|
165
324
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
|
|
169
|
-
|
|
325
|
+
* Joins the elements of an array to a single String.
|
|
326
|
+
*
|
|
327
|
+
* <p>Some examples:</p>
|
|
328
|
+
* <pre><code>
|
|
329
|
+
* joinArray(["one", "two", "three"], ";") -> "one;two;three"
|
|
330
|
+
* joinArray(["a", myTwoInteger], "-") -> "a-2"
|
|
331
|
+
* joinArray(["", null, "three"], "-") -> "--three"
|
|
332
|
+
* joinArray([], "-") -> ""
|
|
333
|
+
* joinArray(null, "-") -> null
|
|
334
|
+
* </code></pre>
|
|
335
|
+
* @param anArray the array that should be joined to a single string. <code>null</code> elements will be treated as empty (<code>""</code>) and for non-String elements <code>toString()</code> will be invoked on the element to get a string representation.
|
|
336
|
+
* @param aSeparator the separator that should delimit the elements of <code>anArray</code> in the resulting joined string. <code>null</code> will be treated as empty (<code>""</code>)
|
|
337
|
+
* @return the joined <code>String</code>. If <code>anArray</code> is <code>null</code>, <code>null</code> will be returned
|
|
338
|
+
* @see #joinCollection(java.util.Collection, String)
|
|
339
|
+
* @since Sitevision 2.6.1_04
|
|
340
|
+
*/
|
|
341
|
+
export function joinArray(anArray: unknown, aSeparator: string): string;
|
|
170
342
|
|
|
171
343
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
|
|
176
|
-
|
|
344
|
+
* Joins the items of a Collection to a single String.
|
|
345
|
+
*
|
|
346
|
+
* <p>
|
|
347
|
+
* For examples, see {@link #joinArray(Object[], String)}
|
|
348
|
+
* </p>
|
|
349
|
+
* @param aCollection the collection that should be joined to a single string. <code>null</code> items will be treated as empty (<code>""</code>) and for non-String items <code>toString()</code> will be invoked on the item to get a string representation.
|
|
350
|
+
* @param aSeparator the separator that should delimit the items of <code>aCollection</code> in the resulting joined string. <code>null</code> will be treated as empty (<code>""</code>)
|
|
351
|
+
* @return the joined <code>String</code>. If <code>aCollection</code> is <code>null</code>, <code>null</code> will be returned
|
|
352
|
+
* @see #joinArray(Object[], String)
|
|
353
|
+
* @since Sitevision 2.6.1_04
|
|
354
|
+
*/
|
|
355
|
+
export function joinCollection(
|
|
356
|
+
aCollection: unknown,
|
|
357
|
+
aSeparator: string
|
|
358
|
+
): string;
|
|
177
359
|
|
|
178
360
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
|
|
361
|
+
* A utility method to get a formatted string based on a pattern and some pattern arguments.
|
|
362
|
+
*
|
|
363
|
+
* <p>
|
|
364
|
+
* <strong>A Velocity example:</strong>
|
|
365
|
+
* </p>
|
|
366
|
+
* <pre><code>
|
|
367
|
+
* #set ($instanceCreatorUtil = ...)
|
|
368
|
+
* #set ($scriptUtil = ...)
|
|
369
|
+
* #set ($searchPhrase = ...)
|
|
370
|
+
*
|
|
371
|
+
* <em>## Determine pattern</em>
|
|
372
|
+
* #if ($language == 'sv')
|
|
373
|
+
* #set ($pattern = 'Din sökning {0} gav inga träffar')
|
|
374
|
+
* #else
|
|
375
|
+
* #set ($pattern = 'No hits for your search {0}')
|
|
376
|
+
* #end
|
|
377
|
+
*
|
|
378
|
+
* <em>## Set up pattern argument(s)</em>
|
|
379
|
+
* #set ($argsList = $instanceCreatorUtil.list)
|
|
380
|
+
* $scriptUtil.swallow(${argsList.add($searchPhrase)})
|
|
381
|
+
*
|
|
382
|
+
* <em>## Format and print result</em>
|
|
383
|
+
* <p>$scriptUtil.messageFormat($pattern, $argsList)</p>
|
|
384
|
+
* </code></pre>
|
|
385
|
+
* @param aMessageFormatPattern a pattern accepted by the Java <a href="http://docs.oracle.com/javase/8/docs/api/java/text/MessageFormat.html">MessageFormat</a> class
|
|
386
|
+
* @param anArguments arguments needed by the pattern
|
|
387
|
+
* @return the result of the pattern evaluation or <code>null</code> if evaluation fails. Returns <code>null</code> if <code>aMessageFormatPattern</code> is <code>null</code> or if <code>anArguments</code> doesn't contain any arguments.
|
|
388
|
+
* @since Sitevision 3.0
|
|
389
|
+
*/
|
|
390
|
+
export function messageFormat(
|
|
391
|
+
aMessageFormatPattern: string,
|
|
392
|
+
anArguments: unknown[]
|
|
393
|
+
): string;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* A utility method that can be used to prevent method invocation return values to be added to the Velocity output.
|
|
397
|
+
*
|
|
398
|
+
* <p>
|
|
399
|
+
* <strong>An example:</strong><br>This Velocity code:
|
|
400
|
+
* </p>
|
|
401
|
+
* <pre><code>
|
|
402
|
+
* #set ($myList = $instanceCreatorUtil.list)
|
|
403
|
+
* $myList.add("Magnus Lövgren")
|
|
404
|
+
* $myList.add("Mikael Wikblom")
|
|
405
|
+
* </code></pre>
|
|
406
|
+
* will result in the following Velocity output (the <code>add</code> method of <code>ArrayList</code> returns a <code>boolean</code>):
|
|
407
|
+
* <pre><code>true true</code></pre>
|
|
408
|
+
* <p>
|
|
409
|
+
* If a non-void method is invoked and the return value isn't handled, it will be part of the Velocity output.
|
|
410
|
+
* The <code>swallow</code> method can be used to prevent that (i.e. use it to "swallow" the result):
|
|
411
|
+
* </p>
|
|
412
|
+
* <pre><code>
|
|
413
|
+
* #set ($myList = $instanceCreatorUtil.list)
|
|
414
|
+
* $scriptUtil.swallow(${myList.add("Magnus Lövgren")})
|
|
415
|
+
* $scriptUtil.swallow(${myList.add("Mikael Wikblom")})</code></pre>
|
|
416
|
+
* <p>
|
|
417
|
+
* <em>Note! The code above is just an example that illustrates a common problem. When creating and working with a
|
|
418
|
+
* List from Velocity, you should probably use a {@link senselogic.sitevision.api.script.factory.ListWrapper} instead</em>
|
|
419
|
+
* </p>
|
|
420
|
+
* @param anObject the object that should be "swallowed"
|
|
421
|
+
* @since Sitevision 3.0
|
|
422
|
+
*/
|
|
423
|
+
export function swallow(anObject: unknown): void;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Removes leading and ending control characters (char <= 32) from a String and returns the result (<code>null</code>
|
|
427
|
+
* if the string is empty or <code>null</code>).
|
|
428
|
+
*
|
|
429
|
+
* <p>
|
|
430
|
+
* The String is trimmed using <code>String.trim()</code>
|
|
431
|
+
* </p>
|
|
432
|
+
* @param aString the string that should be trimmed
|
|
433
|
+
* @return the trimmed String. Returns <code>null</code> if <code>aString</code> is <code>null</code> or the trimmed String is empty.
|
|
434
|
+
* @since Sitevision 2.6.1_04
|
|
435
|
+
*/
|
|
183
436
|
export function trimToNull(aString: string): string;
|
|
184
437
|
|
|
185
|
-
|
|
438
|
+
/**
|
|
439
|
+
* Removes leading and ending control characters (char <= 32) from a String and returns the result (empty String (<code>""</code>)
|
|
440
|
+
* if the string is empty or <code>null</code>).
|
|
441
|
+
*
|
|
442
|
+
* <p>
|
|
443
|
+
* The String is trimmed using <code>String.trim()</code>
|
|
444
|
+
* </p>
|
|
445
|
+
* @param aString the string that should be trimmed
|
|
446
|
+
* @return the trimmed String. Returns empty (<code>""</code>) if <code>aString</code> is <code>null</code> or the trimmed String is empty.
|
|
447
|
+
* @since Sitevision 2.6.1_04
|
|
448
|
+
*/
|
|
449
|
+
export function trimToEmpty(aString: string): string;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Flattens a multi-lined string to a trimmed single-line string.
|
|
453
|
+
*
|
|
454
|
+
* <p>
|
|
455
|
+
* This method replaces all whitespace (space, line break and such) with a space, but will never add multiple spaces.
|
|
456
|
+
* </p>
|
|
457
|
+
* @param aString the multi-lined string
|
|
458
|
+
* @return a single-line trimmed string with sequential whitespace removed, or <code>null</code> if <code>aString</code> is <code>null</code>.
|
|
459
|
+
* @since Sitevision 3.6
|
|
460
|
+
*/
|
|
461
|
+
export function flatten(aString: string): string;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Scripting utility interface that might be needed when using a limited scripting or template language (such as Velocity).
|
|
465
|
+
*
|
|
466
|
+
* <p>
|
|
467
|
+
* An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getScriptUtil()}.
|
|
468
|
+
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
|
|
469
|
+
* </p>Gets the boolean true primitive.Gets the boolean false primitive.Gets the null reference.Gets an object that is ensured not to be null.
|
|
470
|
+
*
|
|
471
|
+
* <p>
|
|
472
|
+
* This is a convenience method that can be used to avoid unnecessary subsequent method invocations in Velocity.
|
|
473
|
+
* </p>
|
|
474
|
+
*
|
|
475
|
+
* <p>
|
|
476
|
+
* Velocity ignores <code>null</code> assignments and trying to assign a null reference will be logged as a WARNING message.
|
|
477
|
+
* A common strategy to work around this is to use the the Velocity <code>#if</code> clause. It allows for easy non-null
|
|
478
|
+
* checks - a <code>null</code> object is considered to be <code>false</code>. The downside with this strategy is that it
|
|
479
|
+
* requires two subsequent method invocations. That can of course be a really bad thing if the method does costly things. This method
|
|
480
|
+
* can be used to avoid such problems.
|
|
481
|
+
* </p>
|
|
482
|
+
*
|
|
483
|
+
* <p>
|
|
484
|
+
* <strong>An example</strong><br>
|
|
485
|
+
* This Velocity code:
|
|
486
|
+
* </p>
|
|
487
|
+
* <pre><code> #if ($anObject.getPersonOrNull())
|
|
488
|
+
* #set ($person = $anObject.getPersonOrNull())
|
|
489
|
+
* $person.getName()
|
|
490
|
+
* ...
|
|
491
|
+
* #end</code></pre>
|
|
492
|
+
* Can be better utilized as:
|
|
493
|
+
* <pre><code> #set ($scriptUtil = ...)
|
|
494
|
+
*
|
|
495
|
+
* #set ($person = $scriptUtil.getNonNull(${anObject.getPersonOrNull()}))
|
|
496
|
+
* #if ($person)
|
|
497
|
+
* $person.getName()
|
|
498
|
+
* ...
|
|
499
|
+
* #end
|
|
500
|
+
* </code></pre>Gets an object that is ensured not to be null or a whitespace only string.
|
|
501
|
+
*
|
|
502
|
+
* <p>
|
|
503
|
+
* This is a convenience method that can be used to avoid unnecessary subsequent method invocations in Velocity.
|
|
504
|
+
* </p>
|
|
505
|
+
*
|
|
506
|
+
* <p>
|
|
507
|
+
* Velocity ignores <code>null</code> assignments and trying to assign a null reference will be logged as a WARNING message.
|
|
508
|
+
* A common strategy to work around this is to use the the Velocity <code>#if</code> clause. It allows for easy non-null
|
|
509
|
+
* checks - a <code>null</code> object is considered to be <code>false</code>. The downside with this strategy is that it
|
|
510
|
+
* requires two subsequent method invocations. That can of course be a really bad thing if the method does costly things. This method
|
|
511
|
+
* can be used to avoid such problems.
|
|
512
|
+
* </p>
|
|
513
|
+
*
|
|
514
|
+
* <p>
|
|
515
|
+
* <strong>An example</strong><br>
|
|
516
|
+
* This Velocity code:
|
|
517
|
+
* </p>
|
|
518
|
+
* <pre><code> #if ($anObject.getPersonNameThatCanBeNullOrEmptyOrWhitespaceOnly())
|
|
519
|
+
* #set ($name = $anObject.getPersonNameThatCanBeNullOrEmptyOrWhitespaceOnly())
|
|
520
|
+
* #if ($name.trim().length() > 0)
|
|
521
|
+
* <p>
|
|
522
|
+
* $name
|
|
523
|
+
* </p>
|
|
524
|
+
* #end
|
|
525
|
+
* #end</code></pre>
|
|
526
|
+
* Can be better utilized as:
|
|
527
|
+
* <pre><code> #set ($scriptUtil = ...)
|
|
528
|
+
*
|
|
529
|
+
* #set ($name = $scriptUtil.getNonBlank(${anObject.getPersonNameThatCanBeNullOrEmptyOrWhitespaceOnly()}))
|
|
530
|
+
* #if ($name)
|
|
531
|
+
* <p>
|
|
532
|
+
* $name
|
|
533
|
+
* </p>
|
|
534
|
+
* #end
|
|
535
|
+
* </code></pre>
|
|
536
|
+
*
|
|
537
|
+
* <p>
|
|
538
|
+
* <strong>A typical example when using {@link senselogic.sitevision.api.property.PropertyUtil} and whitespace is an issue</strong><br>
|
|
539
|
+
* This Velocity code:
|
|
540
|
+
* </p>
|
|
541
|
+
* <pre><code> #if ($propertyUtil.getString($theNode, 'thePropertyName'))
|
|
542
|
+
* #set ($propertyValue = $propertyUtil.getString($theNode, 'thePropertyName'))
|
|
543
|
+
* #if ($propertyValue.trim().length() > 0)
|
|
544
|
+
* <p>
|
|
545
|
+
* $propertyValue
|
|
546
|
+
* </p>
|
|
547
|
+
* #end
|
|
548
|
+
* #end</code></pre>
|
|
549
|
+
* Can be better utilized as:
|
|
550
|
+
* <pre><code> #set ($scriptUtil = ...)
|
|
551
|
+
*
|
|
552
|
+
* #set ($propertyValue = $scriptUtil.getNonBlank(${propertyUtil.getString($theNode, 'thePropertyName')}))
|
|
553
|
+
* #if ($propertyValue)
|
|
554
|
+
* <p>
|
|
555
|
+
* $propertyValue
|
|
556
|
+
* </p>
|
|
557
|
+
* #end
|
|
558
|
+
* </code></pre>Gets a default value if an object is null.Gets a default value if a string is null or whitespace only.Checks if a string is not null and not empty.Checks if a string is null or empty.Checks if a string is not null, not empty and not whitespace only.Checks if a string is null, empty or whitespace only.Gets a system property. This method invokes the getProperty method of the java.lang.System class, i.e <code>System.getProperty(String)</code>.
|
|
559
|
+
*
|
|
560
|
+
* <p>
|
|
561
|
+
* <strong>Important note!</strong><br>
|
|
562
|
+
* This method can be used to reveal potential sensitive information about the server.
|
|
563
|
+
* </p>
|
|
564
|
+
* <p>
|
|
565
|
+
* Allowed properties:
|
|
566
|
+
* </p>
|
|
567
|
+
* <ul>
|
|
568
|
+
* <li>"sitevision.version" (5.1)</li>
|
|
569
|
+
* <li>"sitevision.build" (5.1)</li>
|
|
570
|
+
* <li>"sitevision.environment.type" (5.2.1)</li>
|
|
571
|
+
* </ul>
|
|
572
|
+
* <p>
|
|
573
|
+
* A legacy mode that enables the API to return all properties can be enabled using the following system property:<br>
|
|
574
|
+
* <em>sitevision.api.scriptutil.legacy_system_properties=true</em>
|
|
575
|
+
* </p>
|
|
576
|
+
*
|
|
577
|
+
* <p>
|
|
578
|
+
* A tip if you need to do backward compatibility workarounds: The Sitevision version is accessible as a system property
|
|
579
|
+
* named <em>sitevision.version</em>.
|
|
580
|
+
* </p>Creates and returns an instance of a Java class.Methods that wraps an array in a <code>List</code>. Arrays are sub optimal in Velocity and JavaScript.Gets the date format pattern used in the Sitevision editor for a specific Locale.Methods that formats a date according to a <code>SimpleDateFormat</code> patternMethods that formats the date of a calendar according to a <code>SimpleDateFormat</code> patternMethods that returns a human presentable size with an appropriate byte-suffix (bytes/kB/MB/GB/TB).
|
|
581
|
+
* <p>
|
|
582
|
+
* Note! This method uses two significant digits and 1024 as base. Some examples:<br>
|
|
583
|
+
* <code>126</code> -> "<code>130 bytes</code>"<br>
|
|
584
|
+
* <code>126975</code> -> "<code>120 kB</code>"<br>
|
|
585
|
+
* <code>456456456</code> -> "<code>440 MB</code>"
|
|
586
|
+
* </p>Method that converts a string to an int.Method that converts a string to a long.Method that converts a string to a double.Method that converts a string to a float.Method that returns true for values that can be interpreted as the true value.Method that returns true for values that can be interpreted as the false value.Joins the elements of an array to a single String.
|
|
587
|
+
*
|
|
588
|
+
* <p>Some examples:</p>
|
|
589
|
+
* <pre><code>
|
|
590
|
+
* joinArray(["one", "two", "three"], ";") -> "one;two;three"
|
|
591
|
+
* joinArray(["a", myTwoInteger], "-") -> "a-2"
|
|
592
|
+
* joinArray(["", null, "three"], "-") -> "--three"
|
|
593
|
+
* joinArray([], "-") -> ""
|
|
594
|
+
* joinArray(null, "-") -> null
|
|
595
|
+
* </code></pre>Joins the items of a Collection to a single String.
|
|
596
|
+
*
|
|
597
|
+
* <p>
|
|
598
|
+
* For examples, see {@link #joinArray(Object[], String)}
|
|
599
|
+
* </p>A utility method to get a formatted string based on a pattern and some pattern arguments.
|
|
600
|
+
*
|
|
601
|
+
* <p>
|
|
602
|
+
* <strong>A Velocity example:</strong>
|
|
603
|
+
* </p>
|
|
604
|
+
* <pre><code>
|
|
605
|
+
* #set ($instanceCreatorUtil = ...)
|
|
606
|
+
* #set ($scriptUtil = ...)
|
|
607
|
+
* #set ($searchPhrase = ...)
|
|
608
|
+
*
|
|
609
|
+
* <em>## Determine pattern</em>
|
|
610
|
+
* #if ($language == 'sv')
|
|
611
|
+
* #set ($pattern = 'Din sökning {0} gav inga träffar')
|
|
612
|
+
* #else
|
|
613
|
+
* #set ($pattern = 'No hits for your search {0}')
|
|
614
|
+
* #end
|
|
615
|
+
*
|
|
616
|
+
* <em>## Set up pattern argument(s)</em>
|
|
617
|
+
* #set ($argsList = $instanceCreatorUtil.list)
|
|
618
|
+
* $scriptUtil.swallow(${argsList.add($searchPhrase)})
|
|
619
|
+
*
|
|
620
|
+
* <em>## Format and print result</em>
|
|
621
|
+
* <p>$scriptUtil.messageFormat($pattern, $argsList)</p>
|
|
622
|
+
* </code></pre>A utility method that can be used to prevent method invocation return values to be added to the Velocity output.
|
|
623
|
+
*
|
|
624
|
+
* <p>
|
|
625
|
+
* <strong>An example:</strong><br>This Velocity code:
|
|
626
|
+
* </p>
|
|
627
|
+
* <pre><code>
|
|
628
|
+
* #set ($myList = $instanceCreatorUtil.list)
|
|
629
|
+
* $myList.add("Magnus Lövgren")
|
|
630
|
+
* $myList.add("Mikael Wikblom")
|
|
631
|
+
* </code></pre>
|
|
632
|
+
* will result in the following Velocity output (the <code>add</code> method of <code>ArrayList</code> returns a <code>boolean</code>):
|
|
633
|
+
* <pre><code>true true</code></pre>
|
|
634
|
+
* <p>
|
|
635
|
+
* If a non-void method is invoked and the return value isn't handled, it will be part of the Velocity output.
|
|
636
|
+
* The <code>swallow</code> method can be used to prevent that (i.e. use it to "swallow" the result):
|
|
637
|
+
* </p>
|
|
638
|
+
* <pre><code>
|
|
639
|
+
* #set ($myList = $instanceCreatorUtil.list)
|
|
640
|
+
* $scriptUtil.swallow(${myList.add("Magnus Lövgren")})
|
|
641
|
+
* $scriptUtil.swallow(${myList.add("Mikael Wikblom")})</code></pre>
|
|
642
|
+
* <p>
|
|
643
|
+
* <em>Note! The code above is just an example that illustrates a common problem. When creating and working with a
|
|
644
|
+
* List from Velocity, you should probably use a {@link senselogic.sitevision.api.script.factory.ListWrapper} instead</em>
|
|
645
|
+
* </p>Removes leading and ending control characters (char <= 32) from a String and returns the result (<code>null</code>
|
|
646
|
+
* if the string is empty or <code>null</code>).
|
|
647
|
+
*
|
|
648
|
+
* <p>
|
|
649
|
+
* The String is trimmed using <code>String.trim()</code>
|
|
650
|
+
* </p>Removes leading and ending control characters (char <= 32) from a String and returns the result (empty String (<code>""</code>)
|
|
651
|
+
* if the string is empty or <code>null</code>).
|
|
652
|
+
*
|
|
653
|
+
* <p>
|
|
654
|
+
* The String is trimmed using <code>String.trim()</code>
|
|
655
|
+
* </p>Flattens a multi-lined string to a trimmed single-line string.
|
|
656
|
+
*
|
|
657
|
+
* <p>
|
|
658
|
+
* This method replaces all whitespace (space, line break and such) with a space, but will never add multiple spaces.
|
|
659
|
+
* </p>
|
|
660
|
+
* @author Magnus Lövgren
|
|
661
|
+
*/
|
|
662
|
+
declare namespace ScriptUtil {
|
|
186
663
|
export {
|
|
187
|
-
|
|
664
|
+
getTrue,
|
|
188
665
|
getFalse,
|
|
189
|
-
getHumanPresentableSize,
|
|
190
|
-
getList,
|
|
191
|
-
getNonBlank,
|
|
192
|
-
getNonNull,
|
|
193
666
|
getNull,
|
|
194
|
-
|
|
195
|
-
|
|
667
|
+
getNonNull,
|
|
668
|
+
getNonBlank,
|
|
669
|
+
isNotEmpty,
|
|
196
670
|
isEmpty,
|
|
197
|
-
isFalse,
|
|
198
671
|
isNotBlank,
|
|
199
|
-
|
|
672
|
+
isBlank,
|
|
673
|
+
getSystemProperty,
|
|
674
|
+
getInstance,
|
|
675
|
+
getList,
|
|
676
|
+
getFormatPattern,
|
|
677
|
+
getDateAsString,
|
|
678
|
+
getCalendarAsString,
|
|
679
|
+
getHumanPresentableSize,
|
|
680
|
+
stringToInt,
|
|
681
|
+
stringToLong,
|
|
682
|
+
stringToDouble,
|
|
683
|
+
stringToFloat,
|
|
200
684
|
isTrue,
|
|
685
|
+
isFalse,
|
|
201
686
|
joinArray,
|
|
202
687
|
joinCollection,
|
|
203
688
|
messageFormat,
|
|
204
|
-
stringToDouble,
|
|
205
|
-
stringToFloat,
|
|
206
|
-
stringToInt,
|
|
207
|
-
stringToLong,
|
|
208
689
|
swallow,
|
|
209
|
-
trimToEmpty,
|
|
210
690
|
trimToNull,
|
|
691
|
+
trimToEmpty,
|
|
692
|
+
flatten,
|
|
211
693
|
};
|
|
212
694
|
}
|
|
213
695
|
|
|
214
|
-
export default
|
|
696
|
+
export default ScriptUtil;
|