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