@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
|
@@ -0,0 +1,1157 @@
|
|
|
1
|
+
import Node from "../../hidden/javax/jcr/Node";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Updates current state.
|
|
5
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
6
|
+
* @param aFontClass the class name the link should use (class attribute for the a element)
|
|
7
|
+
* @param aText the link text
|
|
8
|
+
* @param aTitle the title of the link (title attribute for the a element)
|
|
9
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
10
|
+
*/
|
|
11
|
+
export function update(
|
|
12
|
+
aTarget: Node,
|
|
13
|
+
aFontClass: string,
|
|
14
|
+
aText: string,
|
|
15
|
+
aTitle: string
|
|
16
|
+
): void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Updates current state and removes previous title.
|
|
20
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
21
|
+
* @param aFontClass the class name the link should use (class attribute for the a element)
|
|
22
|
+
* @param aText the link text
|
|
23
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
24
|
+
*/
|
|
25
|
+
export function update(aTarget: Node, aFontClass: string, aText: string): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Updates current state and removes previous title.
|
|
29
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
30
|
+
* @param aText the link text
|
|
31
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
32
|
+
*/
|
|
33
|
+
export function update(aTarget: Node, aText: string): void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Updates current state and removes previous title and text.
|
|
37
|
+
*
|
|
38
|
+
* <p>
|
|
39
|
+
* Note. If no text exists when rendering, the target Node will be used to determine an appropriate text
|
|
40
|
+
* (e.g. the display name if the node is a page).
|
|
41
|
+
* </p>
|
|
42
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
43
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
44
|
+
*/
|
|
45
|
+
export function update(aTarget: Node): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Updates current state and removes all optional attributes.
|
|
49
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
50
|
+
* @param aFontClass the class name the link should use (class attribute for the a element)
|
|
51
|
+
* @param aText the link text
|
|
52
|
+
* @param aTitle the title of the link (title attribute for the a element)
|
|
53
|
+
* @see #clearAllOptional()
|
|
54
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
55
|
+
*/
|
|
56
|
+
export function updateClean(
|
|
57
|
+
aTarget: Node,
|
|
58
|
+
aFontClass: string,
|
|
59
|
+
aText: string,
|
|
60
|
+
aTitle: string
|
|
61
|
+
): void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Updates current state and removes all optional attributes and title.
|
|
65
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
66
|
+
* @param aFontClass the class name the link should use (class attribute for the a element)
|
|
67
|
+
* @param aText the link text
|
|
68
|
+
* @see #clearAllOptional()
|
|
69
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
70
|
+
*/
|
|
71
|
+
export function updateClean(
|
|
72
|
+
aTarget: Node,
|
|
73
|
+
aFontClass: string,
|
|
74
|
+
aText: string
|
|
75
|
+
): void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Updates current state and removes all optional attributes and title.
|
|
79
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
80
|
+
* @param aText the link text
|
|
81
|
+
* @see #clearAllOptional()
|
|
82
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
83
|
+
*/
|
|
84
|
+
export function updateClean(aTarget: Node, aText: string): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Updates current state and removes all optional attributes, title and text.
|
|
88
|
+
*
|
|
89
|
+
* <p>
|
|
90
|
+
* Note. If no text exists when rendering, the target Node will be used to determine an appropriate text
|
|
91
|
+
* (e.g. the display name if the node is a page).
|
|
92
|
+
* </p>
|
|
93
|
+
* @param aTarget the target of the link (href attribute for the a element)
|
|
94
|
+
* @see #clearAllOptional()
|
|
95
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
96
|
+
*/
|
|
97
|
+
export function updateClean(aTarget: Node): void;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Removes all optional settings.
|
|
101
|
+
* In other words - executing this method has the same effect as executing:
|
|
102
|
+
* <ul>
|
|
103
|
+
* <li><code>clearStyle()</code></li>
|
|
104
|
+
* <li><code>clearOnclick()</code></li>
|
|
105
|
+
* <li><code>clearId()</code></li>
|
|
106
|
+
* <li><code>clearTargetParameters()</code></li>
|
|
107
|
+
* <li><code>clearRel()</code></li>
|
|
108
|
+
* <li><code>clearAccessKey()</code></li>
|
|
109
|
+
* <li><code>clearOpenNewWindow()</code></li>
|
|
110
|
+
* <li><code>clearDataAttributes()</code></li>
|
|
111
|
+
* <li><code>clearUseDownload()</code></li>
|
|
112
|
+
* <li><code>clearLang()</code></li>
|
|
113
|
+
* <li><code>clearHrefLang()</code></li>
|
|
114
|
+
* </ul>
|
|
115
|
+
* @see #clearStyle()
|
|
116
|
+
* @see #clearOnclick()
|
|
117
|
+
* @see #clearId()
|
|
118
|
+
* @see #clearTargetParameters()
|
|
119
|
+
* @see #clearRel()
|
|
120
|
+
* @see #clearAccessKey()
|
|
121
|
+
* @see #clearOpenNewWindow()
|
|
122
|
+
* @see #clearDataAttributes()
|
|
123
|
+
* @see #clearUseDownload()
|
|
124
|
+
* @see #clearLang()
|
|
125
|
+
* @see #clearHrefLang()
|
|
126
|
+
*/
|
|
127
|
+
export function clearAllOptional(): void;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Builds a html link based on current state.
|
|
131
|
+
*
|
|
132
|
+
* <p>
|
|
133
|
+
* <em>Note!</em> The render method is not thread safe, see <a href="#threadnote">thread note above</a>.
|
|
134
|
+
* </p>
|
|
135
|
+
* @return a html link, ready to print out on a page
|
|
136
|
+
*/
|
|
137
|
+
export function render(): string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Sets what the link target is, i.e "what the link links to" (href attribute on the a element).
|
|
141
|
+
* The target attribute is mandatory when the result is rendered.
|
|
142
|
+
* @param aTarget a Node identifying the target
|
|
143
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
144
|
+
*/
|
|
145
|
+
export function setTarget(aTarget: Node): void;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Sets what the link target is, i.e "what the link links to" (href attribute on the a element).
|
|
149
|
+
* The target attribute is mandatory when the result is rendered.
|
|
150
|
+
* @param aTarget a String identifying the target (i.e "http://xyz.com", "?name=a&value=b", "/images/a.gif", "#anchor")
|
|
151
|
+
*/
|
|
152
|
+
export function setStringTarget(aTarget: string): void;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Checks if a Node is a renderable target or not (node type accepted).
|
|
156
|
+
*
|
|
157
|
+
* <p>
|
|
158
|
+
* This method can be used to avoid updating this renderer with nodes that can't be rendered. Since nodes that aren't
|
|
159
|
+
* renderable will be ignored, updating the renderer with such nodes will result in rendering of previous target.
|
|
160
|
+
* </p>
|
|
161
|
+
*
|
|
162
|
+
* <p>
|
|
163
|
+
* <code>LinkRenderer</code> will accept nodes with the following primary node type as targets
|
|
164
|
+
* (i.e. this method will return <code>true</code> for such nodes):
|
|
165
|
+
* </p>
|
|
166
|
+
* <ul>
|
|
167
|
+
* <li><code>sv:article</code></li>
|
|
168
|
+
* <li><code>sv:collaborationGroup</code></li>
|
|
169
|
+
* <li><code>sv:collaborationGroupPage</code></li>
|
|
170
|
+
* <li><code>sv:collaborationGroupTemplate</code></li>
|
|
171
|
+
* <li><code>sv:file</code></li>
|
|
172
|
+
* <li><code>sv:image</code></li>
|
|
173
|
+
* <li><code>sv:link</code> <em>(the actual target of the link must also be a valid target)</em></li>
|
|
174
|
+
* <li><code>sv:page</code></li>
|
|
175
|
+
* <li><code>sv:sitePage</code></li>
|
|
176
|
+
* <li><code>sv:structureLink</code> <em>(the actual target of the structure link must also be a valid target)</em></li>
|
|
177
|
+
* <li><code>sv:structurePage</code></li>
|
|
178
|
+
* <li><code>sv:systemUser</code> <em>(the system user must have a mail address)</em></li>
|
|
179
|
+
* <li><code>sv:template</code></li>
|
|
180
|
+
* <li><code>sv:user</code> <em>(the user must have a mail address)</em></li>
|
|
181
|
+
* <li><code>sv:userIdentity</code> <em>(the site must have a profile page, or backing user must have a mail address)</em></li>
|
|
182
|
+
* </ul>
|
|
183
|
+
*
|
|
184
|
+
* <p>
|
|
185
|
+
* Always use this method if you are not sure all nodes you are rendering will be accepted as targets.
|
|
186
|
+
* </p>
|
|
187
|
+
*
|
|
188
|
+
* <p>
|
|
189
|
+
* <strong>Example:</strong><br>
|
|
190
|
+
* Velocity code like this:
|
|
191
|
+
* </p>
|
|
192
|
+
* <pre><code><ul style="list-style:none">
|
|
193
|
+
* #foreach ($node in $myNodes)
|
|
194
|
+
* <em>## Update the renderer and render</em>
|
|
195
|
+
* $linkRenderer.update($node)
|
|
196
|
+
* <li>$linkRenderer.render()</li>
|
|
197
|
+
*#end
|
|
198
|
+
*</ul></code></pre>
|
|
199
|
+
* could be replaced with Velocity code like this:<pre><code><ul style="list-style:none">
|
|
200
|
+
* #foreach ($node in $myNodes)
|
|
201
|
+
* <em>## Ensure node actually can be rendered</em>
|
|
202
|
+
* #if ($linkRenderer.isRenderableTarget($node))
|
|
203
|
+
* <em>## Update the renderer and render</em>
|
|
204
|
+
* $linkRenderer.update($node)
|
|
205
|
+
* <li>$linkRenderer.render()</li>
|
|
206
|
+
* #end
|
|
207
|
+
* #end
|
|
208
|
+
* </ul></code></pre>
|
|
209
|
+
*
|
|
210
|
+
* <p>
|
|
211
|
+
* <em>Performance note!</em> Calling this method prior to calling an <code>update</code> method (or the <code>setTarget</code> method)
|
|
212
|
+
* will not have any noticeable negative performance impact. The result of this method is internally cached and the <code>update</code>
|
|
213
|
+
* methods (and the <code>setTarget</code> method) will re-use that cached data.
|
|
214
|
+
* </p>
|
|
215
|
+
* @param aNode the node to check
|
|
216
|
+
* @return <code>true</code> if <code>aNode</code> is a target that can be rendered, <code>false</code> if not
|
|
217
|
+
* @since Sitevision 3.0
|
|
218
|
+
* @see #isValidTarget(javax.jcr.Node)
|
|
219
|
+
*/
|
|
220
|
+
export function isRenderableTarget(aNode: Node): boolean;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Checks if a Node is a valid target or not (node type accepted and target is valid).
|
|
224
|
+
*
|
|
225
|
+
* <p>
|
|
226
|
+
* This method is similar to the {@link senselogic.sitevision.api.render.LinkRenderer#isRenderableTarget(javax.jcr.Node)} method,
|
|
227
|
+
* but this method does more extensive checking to ensure rendered links will be ok. <em>Note! "External" link targets (e.g.
|
|
228
|
+
* a link to "www.whatever.com") of a sv:link Node will NOT be checked.</em>
|
|
229
|
+
* </p>
|
|
230
|
+
* <p>
|
|
231
|
+
* This method can be used to avoid updating this renderer with nodes that can't be rendered or nodes that have invalid targets.
|
|
232
|
+
* An invalid target is typically an existing link that has an empty or trashed target (i.e. target is in trashcan).
|
|
233
|
+
* </p>
|
|
234
|
+
*
|
|
235
|
+
* <p>
|
|
236
|
+
* <strong>Example:</strong><br>
|
|
237
|
+
* Velocity code like this:
|
|
238
|
+
* </p>
|
|
239
|
+
* <pre><code><ul style="list-style:none">
|
|
240
|
+
* #foreach ($node in $myNodes)
|
|
241
|
+
* <em>## Update the renderer and render</em>
|
|
242
|
+
* $linkRenderer.update($node)
|
|
243
|
+
* <li>$linkRenderer.render()</li>
|
|
244
|
+
*#end
|
|
245
|
+
*</ul></code></pre>
|
|
246
|
+
* could be replaced with Velocity code like this:<pre><code><ul style="list-style:none">
|
|
247
|
+
* #foreach ($node in $myNodes)
|
|
248
|
+
* <em>## Ensure node actually can be rendered</em>
|
|
249
|
+
* #if ($linkRenderer.isValidTarget($node))
|
|
250
|
+
* <em>## Update the renderer and render</em>
|
|
251
|
+
* $linkRenderer.update($node)
|
|
252
|
+
* <li>$linkRenderer.render()</li>
|
|
253
|
+
* #end
|
|
254
|
+
* #end
|
|
255
|
+
* </ul></code></pre>
|
|
256
|
+
*
|
|
257
|
+
* <p>
|
|
258
|
+
* <em>Performance note!</em> Avoid subsequent calls to this method for same <code>Node</code>. If performance is a top
|
|
259
|
+
* priority, consider using {@link senselogic.sitevision.api.render.LinkRenderer#isRenderableTarget(javax.jcr.Node)} instead.
|
|
260
|
+
* </p>
|
|
261
|
+
* @param aNode the node to check
|
|
262
|
+
* @return <code>true</code> if <code>aNode</code> is a target that can be rendered as a functional link, <code>false</code> if not
|
|
263
|
+
* @since Sitevision 2.6.2
|
|
264
|
+
* @see #isRenderableTarget(javax.jcr.Node)
|
|
265
|
+
*/
|
|
266
|
+
export function isValidTarget(aNode: Node): boolean;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Sets the class name the link should use (class attribute on the a element).
|
|
270
|
+
* The fontClass attribute is mandatory when the result is rendered.
|
|
271
|
+
* @param aFontClass the class name of the font to use
|
|
272
|
+
*/
|
|
273
|
+
export function setFontClass(aFontClass: string): void;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Sets the class name the link should use (class attribute on an a element) based on a given font node.
|
|
277
|
+
*
|
|
278
|
+
* <p>
|
|
279
|
+
* The actual font class is extracted from aFontNode and if aFontNode is <code>null</code> or not a valid font node the
|
|
280
|
+
* font class will not be set.
|
|
281
|
+
* </p>
|
|
282
|
+
* <p>
|
|
283
|
+
* When subsequently setting the font class, use the {@link #setFontClass(String)} method instead for best performance.
|
|
284
|
+
* </p>
|
|
285
|
+
* @param aFontNode the font node that has a font class that can be extracted
|
|
286
|
+
* @see #setFontClass(String)
|
|
287
|
+
*/
|
|
288
|
+
export function setFont(aFontNode: Node): void;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Sets the text that the link should display, i.e. "the text the user clicks on".
|
|
292
|
+
* The text attribute is mandatory when the result is rendered.
|
|
293
|
+
* @param aText a link text
|
|
294
|
+
*/
|
|
295
|
+
export function setText(aText: string): void;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Sets the title the link should have (title attribute on the a element).
|
|
299
|
+
*
|
|
300
|
+
* <p>
|
|
301
|
+
* If there are no title (i.e. it is <code>null</code>) when the result is rendered, it will get the same
|
|
302
|
+
* value as text attribute if autoTitle is activated, otherwise it will be empty. Default is <code>null</code>.
|
|
303
|
+
* </p>
|
|
304
|
+
* @param aTitle a title describing the link
|
|
305
|
+
*/
|
|
306
|
+
export function setTitle(aTitle: string): void;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Removes the title, i.e. executes <code>setTitle(null)</code>
|
|
310
|
+
* @see #setTitle(String)
|
|
311
|
+
*/
|
|
312
|
+
export function removeTitle(): void;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Sets the css style the link should have (style attribute on the a element).
|
|
316
|
+
* The style attribute is optional when the result is rendered. Default is <code>null</code>.
|
|
317
|
+
* @param aStyle the style of the link
|
|
318
|
+
*/
|
|
319
|
+
export function setStyle(aStyle: string): void;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Removes the style, i.e executes <code>setStyle(null)</code>
|
|
323
|
+
* @see #setStyle(String)
|
|
324
|
+
*/
|
|
325
|
+
export function clearStyle(): void;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Sets the lang attribute on the a element (defines the language of the element).
|
|
329
|
+
* @param aLang a single language code
|
|
330
|
+
* @since Sitevision 2022.10.1
|
|
331
|
+
*/
|
|
332
|
+
export function setLang(aLang: string): void;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Removes the lang, i.e executes <code>setLang(null)</code>
|
|
336
|
+
* @see #setLang(String)
|
|
337
|
+
* @since Sitevision 2022.10.1
|
|
338
|
+
*/
|
|
339
|
+
export function clearLang(): void;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Sets the hreflang attribute on the a element (hints at the language of the linked resource).
|
|
343
|
+
* @param aHrefLang a single language code
|
|
344
|
+
* @since Sitevision 2022.10.1
|
|
345
|
+
*/
|
|
346
|
+
export function setHrefLang(aHrefLang: string): void;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Removes the hreflang, i.e executes <code>setHrefLang(null)</code>
|
|
350
|
+
* @see #setHrefLang(String)
|
|
351
|
+
* @since Sitevision 2022.10.1
|
|
352
|
+
*/
|
|
353
|
+
export function clearHrefLang(): void;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Adds target parameters (key=value) to the link target (href attribute on the a element).
|
|
357
|
+
*
|
|
358
|
+
* <p>
|
|
359
|
+
* Target parameters is optional when the result is rendered. Default is no target parameters.
|
|
360
|
+
* </p>
|
|
361
|
+
* <p>
|
|
362
|
+
* There can only be one target parameter per key (i.e. when a target parameter is added it will always replace the possibly existing
|
|
363
|
+
* target parameter that already use that key).
|
|
364
|
+
* </p>
|
|
365
|
+
* @param key the key of the target parameter
|
|
366
|
+
* @param value the value of the target parameter
|
|
367
|
+
*/
|
|
368
|
+
export function addTargetParameter(key: string, value: string): void;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Removes all existing target parameters
|
|
372
|
+
|
|
373
|
+
*/
|
|
374
|
+
export function clearTargetParameters(): void;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Should target parameters be URL encoded or not?
|
|
378
|
+
* Default is <code>true</code>.
|
|
379
|
+
* @param performParameterEncoding whether parameters should be URL encoded or not.
|
|
380
|
+
* @see senselogic.sitevision.api.text.EndecUtil#encodeURL(String)
|
|
381
|
+
* @since Sitevision 3.0
|
|
382
|
+
*/
|
|
383
|
+
export function setUseParameterEncoding(
|
|
384
|
+
performParameterEncoding: boolean
|
|
385
|
+
): void;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Utility method for executing <code>setUseParameterEncoding(true)</code>
|
|
389
|
+
* @see #setUseParameterEncoding(boolean)
|
|
390
|
+
* @since Sitevision 3.0
|
|
391
|
+
*/
|
|
392
|
+
export function forceUseParameterEncoding(): void;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Utility method for executing <code>setUseParameterEncoding(false)</code>
|
|
396
|
+
* @see #setUseParameterEncoding(boolean)
|
|
397
|
+
* @since Sitevision 3.0
|
|
398
|
+
*/
|
|
399
|
+
export function clearUseParameterEncoding(): void;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Adds an HTML5 data-* attribute to the link element.
|
|
403
|
+
* Data attributes is optional when the result is rendered. Default is no data attributes.
|
|
404
|
+
* <p>
|
|
405
|
+
* There can only be one data attribute per name (i.e. when a data attribute is added it will always replace the possibly existing
|
|
406
|
+
* data attribute that already use that name).
|
|
407
|
+
* </p>
|
|
408
|
+
*
|
|
409
|
+
* <p>
|
|
410
|
+
* Notes about names and values:
|
|
411
|
+
* </p>
|
|
412
|
+
* <ul>
|
|
413
|
+
* <li>
|
|
414
|
+
* A <strong>name</strong> that is <code>null</code> or <em>whitespace-only</em> will be completely ignored,
|
|
415
|
+
* i.e. no data attribute will be rendered.
|
|
416
|
+
* </li>
|
|
417
|
+
* <li>
|
|
418
|
+
* A <strong>name</strong> that isn't properly prefixed with <em>"data-"</em> will be prefixed when the data attribute is rendered.
|
|
419
|
+
* </li>
|
|
420
|
+
* <li>
|
|
421
|
+
* A <strong>value</strong> that is <code>null</code> or <em>whitespace-only</em> will be rendered as a data attribute without value.
|
|
422
|
+
* </li>
|
|
423
|
+
* <li>
|
|
424
|
+
* A <strong>value</strong> should not be escaped/encoded. The <em>useEncoding</em> attribute will determine what to do
|
|
425
|
+
* when the data attributes are rendered.
|
|
426
|
+
* </ul>
|
|
427
|
+
* @param aName the name of the data attribute
|
|
428
|
+
* @param aValue the value of the data attribute
|
|
429
|
+
* @since Sitevision 3.0
|
|
430
|
+
*/
|
|
431
|
+
export function addDataAttribute(aName: string, aValue: string): void;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Removes all existing data attributes
|
|
435
|
+
* @since Sitevision 3.0
|
|
436
|
+
*/
|
|
437
|
+
export function clearDataAttributes(): void;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Sets what access key the link should have (accesskey attribute on the a element)
|
|
441
|
+
* The accesskey attribute is optional when the result is rendered. Default is <code>null</code>.
|
|
442
|
+
* @param anAccessKey the access key that should be used
|
|
443
|
+
*/
|
|
444
|
+
export function setAccessKey(anAccessKey: string): void;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Removes the accesskey, i.e. executes <code>setAccessKey(null)</code>
|
|
448
|
+
* @see #setAccessKey(String)
|
|
449
|
+
*/
|
|
450
|
+
export function clearAccessKey(): void;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Sets the rel that should be used (rel attribute on the a element)
|
|
454
|
+
* The rel attribute is optional when the result is rendered. Default is <code>null</code>.
|
|
455
|
+
* @param aRel the rel that should be used. Note! If "external" is used, the rendered link will be opened in a new window via JavaScript
|
|
456
|
+
*/
|
|
457
|
+
export function setRel(aRel: string): void;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Removes the rel value, i.e executes <code>setRel(null)</code>
|
|
461
|
+
* @see #setRel(String)
|
|
462
|
+
*/
|
|
463
|
+
export function clearRel(): void;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Sets the onclick value (onclick attribute and onkeypress attribute on the a element), typically some kind of Javascript
|
|
467
|
+
* The onclick attribute is optional when the result is rendered. Default is <code>null</code>.
|
|
468
|
+
*
|
|
469
|
+
* <p><em>Note!</em> The events (onclick, onkeypress) will be added with non-obtrusive javascript when render() is called.</p>
|
|
470
|
+
* @param anOnclick the onClick value that should be used
|
|
471
|
+
*/
|
|
472
|
+
export function setOnclick(anOnclick: string): void;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Removes the onclick value, i.e executes <code>setOnclick(null)</code>
|
|
476
|
+
* @see #setOnclick(String)
|
|
477
|
+
*/
|
|
478
|
+
export function clearOnclick(): void;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Sets the id value (id attribute on the a element), most likely only needed if some kind of javascript/ajax code needs to access the
|
|
482
|
+
* rendered link via its id.
|
|
483
|
+
*
|
|
484
|
+
* <p>
|
|
485
|
+
* The id attribute is optional when the result is rendered. Default is <code>null</code>.
|
|
486
|
+
* </p>
|
|
487
|
+
* <p>
|
|
488
|
+
* This method does <em>not</em> perform any checks of the id. All values will be accepted.
|
|
489
|
+
* <em>(Note! A valid id should be unique - i.e. should not appear more than once in a html/xhtml document - and not all characters are allowed.
|
|
490
|
+
* See <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#sec-attribute-types">W3C 3.3.1 Attribute types</a>.)</em>
|
|
491
|
+
* </p>
|
|
492
|
+
* @param anId the id value that should be used
|
|
493
|
+
* @since Sitevision 3.0
|
|
494
|
+
*/
|
|
495
|
+
export function setId(anId: string): void;
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Removes the id value, i.e executes <code>setId(null)</code>
|
|
499
|
+
* @see #setId(String)
|
|
500
|
+
* @since Sitevision 3.0
|
|
501
|
+
*/
|
|
502
|
+
export function clearId(): void;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Use icons for "external", "new window" and "new window, external" according to Site's settings or not.
|
|
506
|
+
* Default is <code>true</code>.
|
|
507
|
+
* @param useLinkDecorationSettings whether or not Site's settings for link type icons should be used
|
|
508
|
+
*/
|
|
509
|
+
export function setUseLinkDecorationSettings(
|
|
510
|
+
useLinkDecorationSettings: boolean
|
|
511
|
+
): void;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Utility method for executing <code>setUseLinkDecorationSettings(true)</code>
|
|
515
|
+
* @see #setUseLinkDecorationSettings(boolean)
|
|
516
|
+
*/
|
|
517
|
+
export function forceUseLinkDecorationSettings(): void;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Utility method for executing <code>setUseLinkDecorationSettings(false)</code>
|
|
521
|
+
* @see #setUseLinkDecorationSettings(boolean)
|
|
522
|
+
*/
|
|
523
|
+
export function clearUseLinkDecorationSettings(): void;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Use icons/descriptions for known file types according to Site's settings or not.
|
|
527
|
+
* Default is <code>true</code>.
|
|
528
|
+
* @param useResourceDecorationSettings whether or not Site's settings for icons/descriptions for known file types should be used
|
|
529
|
+
*/
|
|
530
|
+
export function setUseResourceDecorationSettings(
|
|
531
|
+
useResourceDecorationSettings: boolean
|
|
532
|
+
): void;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Utility method for executing <code>setUseResourceDecorationSettings(true)</code>
|
|
536
|
+
* @see #setUseResourceDecorationSettings(boolean)
|
|
537
|
+
*/
|
|
538
|
+
export function forceUseResourceDecorationSettings(): void;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Utility method for executing <code>setUseResourceDecorationSettings(false)</code>
|
|
542
|
+
* @see #setUseResourceDecorationSettings(boolean)
|
|
543
|
+
*/
|
|
544
|
+
export function clearUseResourceDecorationSettings(): void;
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Should the link target be opened in a new window or not?
|
|
548
|
+
* Default is <code>false</code>.
|
|
549
|
+
* @param openNewWindow whether or not the link target should be opened in a new window
|
|
550
|
+
*/
|
|
551
|
+
export function setOpenNewWindow(openNewWindow: boolean): void;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Utility method for executing <code>setOpenNewWindow(true)</code>
|
|
555
|
+
* @see #setOpenNewWindow(boolean)
|
|
556
|
+
*/
|
|
557
|
+
export function forceOpenNewWindow(): void;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Utility method for executing <code>setOpenNewWindow(false)</code>
|
|
561
|
+
* @see #setOpenNewWindow(boolean)
|
|
562
|
+
*/
|
|
563
|
+
export function clearOpenNewWindow(): void;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Should the browser download the link target instead of navigating to it?
|
|
567
|
+
* Default is <code>false</code>.
|
|
568
|
+
* @param useDownload whether a browser is suggested to download the link target directly
|
|
569
|
+
* @since Sitevision 5.2
|
|
570
|
+
*/
|
|
571
|
+
export function setUseDownload(useDownload: boolean): void;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Utility method for executing <code>setUseDownload(true)</code>
|
|
575
|
+
* @see #setUseDownload(boolean)
|
|
576
|
+
* @since Sitevision 5.2
|
|
577
|
+
*/
|
|
578
|
+
export function forceUseDownload(): void;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Utility method for executing <code>setUseDownload(false)</code>
|
|
582
|
+
* @see #setUseDownload(boolean)
|
|
583
|
+
* @since Sitevision 5.2
|
|
584
|
+
*/
|
|
585
|
+
export function clearUseDownload(): void;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Should text and attributes be properly encoded or not?
|
|
589
|
+
* Default is <code>true</code>.
|
|
590
|
+
* @param performEncoding whether text should be encoded or not.
|
|
591
|
+
*/
|
|
592
|
+
export function setUseEncoding(performEncoding: boolean): void;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Utility method for executing <code>setUseEncoding(true)</code>
|
|
596
|
+
* @see #setUseEncoding(boolean)
|
|
597
|
+
*/
|
|
598
|
+
export function forceUseEncoding(): void;
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Utility method for executing <code>setUseEncoding(false)</code>
|
|
602
|
+
* @see #setUseEncoding(boolean)
|
|
603
|
+
*/
|
|
604
|
+
export function clearUseEncoding(): void;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Ensures title always will have a value. If non-existing, the title will be set to the title of the target target (or
|
|
608
|
+
* the same as the linked text if the target isn't a page or the title of the page is lacking)
|
|
609
|
+
* Default is <code>false</code>.
|
|
610
|
+
* @param useAutoTitle whether or not the link always should get the title automatically if title is missing
|
|
611
|
+
*/
|
|
612
|
+
export function setUseAutoTitle(useAutoTitle: boolean): void;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Utility method for executing <code>setUseAutoTitle(true)</code>
|
|
616
|
+
* @see #setUseAutoTitle(boolean)
|
|
617
|
+
*/
|
|
618
|
+
export function forceUseAutoTitle(): void;
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Utility method for executing <code>setUseAutoTitle(false)</code>
|
|
622
|
+
* @see #setUseAutoTitle(boolean)
|
|
623
|
+
*/
|
|
624
|
+
export function clearUseAutoTitle(): void;
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Should cross-site internal Node links be handled or not?
|
|
628
|
+
*
|
|
629
|
+
* <p>
|
|
630
|
+
* Default is <code>false</code>.
|
|
631
|
+
* </p>
|
|
632
|
+
* <p>
|
|
633
|
+
* <em>Note! For best performance: enable only if your site actually contains internal links to
|
|
634
|
+
* pages on other sites (e.g. The System user creates an internal link and selects a page
|
|
635
|
+
* on another site in the target browse tree).</em>
|
|
636
|
+
* </p>
|
|
637
|
+
* @param useCrossSiteTargetChecking whether or not to check for cross-site Node targets
|
|
638
|
+
* @since Sitevision 3.0.2
|
|
639
|
+
*/
|
|
640
|
+
export function setUseCrossSiteTargetChecking(
|
|
641
|
+
useCrossSiteTargetChecking: boolean
|
|
642
|
+
): void;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Utility method for executing <code>setUseCrossSiteTargetChecking(true)</code>
|
|
646
|
+
* @see #setUseCrossSiteTargetChecking(boolean)
|
|
647
|
+
* @since Sitevision 3.0.2
|
|
648
|
+
*/
|
|
649
|
+
export function forceUseCrossSiteTargetChecking(): void;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Utility method for executing <code>seUseCrossSiteTargetChecking(false)</code>
|
|
653
|
+
* @see #setUseCrossSiteTargetChecking(boolean)
|
|
654
|
+
* @since Sitevision 3.0.2
|
|
655
|
+
*/
|
|
656
|
+
export function clearUseCrossSiteTargetChecking(): void;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* LinkRenderer is a stateful utility interface that can be used to build valid html text links that uses link icons according to the
|
|
660
|
+
* website settings.
|
|
661
|
+
*
|
|
662
|
+
* <p>
|
|
663
|
+
* An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getLinkRenderer()}.
|
|
664
|
+
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
|
|
665
|
+
* </p>
|
|
666
|
+
*
|
|
667
|
+
* <p>
|
|
668
|
+
* LinkRenderer is very suitable when rendering more than one link (for instance when rendering a menu) or if you don't want to bother whether or not
|
|
669
|
+
* the site prescribes your link(s) should use link icons or file icons.
|
|
670
|
+
* </p>
|
|
671
|
+
*
|
|
672
|
+
* <p>
|
|
673
|
+
* LinkRenderer attributes comes in different flavors:
|
|
674
|
+
* </p>
|
|
675
|
+
* <ul>
|
|
676
|
+
* <li><strong>Mandatory</strong> (link data):
|
|
677
|
+
* <ul>
|
|
678
|
+
* <li style="margin-top:5px">
|
|
679
|
+
* <em>target</em> - The target of the link. Can be a <code>String</code> or a {@link #isRenderableTarget(javax.jcr.Node) renderable Node}.<br>
|
|
680
|
+
* Example: <code><a class="xyz" href="<strong>xyz</strong>" title="xyz">Linked text</a></code>
|
|
681
|
+
* </li>
|
|
682
|
+
* <li style="margin-top:5px">
|
|
683
|
+
* <em>fontClass</em> - The class name of the link.<br>
|
|
684
|
+
* Example: <code><a class="<strong>xyz</strong>" href="xyz" title="xyz">Linked text</a></code>
|
|
685
|
+
* </li>
|
|
686
|
+
* <li style="margin-top:5px">
|
|
687
|
+
* <em>text</em> - The text that should be linked.<br>
|
|
688
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz"><strong>Linked text</strong></a></code>
|
|
689
|
+
* </li>
|
|
690
|
+
* </ul>
|
|
691
|
+
* </li>
|
|
692
|
+
*
|
|
693
|
+
* <li style="margin-top:10px"><strong>Optional</strong> (link data):
|
|
694
|
+
* <ul>
|
|
695
|
+
* <li style="margin-top:5px">
|
|
696
|
+
* <em>title</em> - The title of the link.<br>
|
|
697
|
+
* Example: <code><a class="xyz" href="xyz" title="<strong>xyz</strong>">Linked text</a></code><br>
|
|
698
|
+
* Default is <code>null</code>
|
|
699
|
+
* </li>
|
|
700
|
+
* <li style="margin-top:5px">
|
|
701
|
+
* <em>style</em> - The style of the link.<br>
|
|
702
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz" style="<strong>xyz</strong>">Linked text</a></code><br>
|
|
703
|
+
* Default is <code>null</code>
|
|
704
|
+
* </li>
|
|
705
|
+
* <li style="margin-top:5px">
|
|
706
|
+
* <em>onclick</em> - The onclick and onkeypress of the link.<br>
|
|
707
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz" onclick="<strong>xyz</strong>"
|
|
708
|
+
* onkeypress="<strong>xyz</strong>>Linked text</a></code><br>
|
|
709
|
+
* Default is <code>null</code>
|
|
710
|
+
* </li>
|
|
711
|
+
* <li style="margin-top:5px">
|
|
712
|
+
* <em>id</em> - The id of the link.<br>
|
|
713
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz" id="<strong>xyz</strong>">Linked text</a></code><br>
|
|
714
|
+
* Default is <code>null</code>
|
|
715
|
+
* </li>
|
|
716
|
+
* <li style="margin-top:5px">
|
|
717
|
+
* <em>targetParameters</em> - Additional target parameters for the target.<br>
|
|
718
|
+
* Example: <code><a class="xyz" href="xyz<strong>?a=b&c=d</strong>" title="xyz">Linked text</a></code><br>
|
|
719
|
+
* Default is no target parameters.
|
|
720
|
+
* </li>
|
|
721
|
+
* <li style="margin-top:5px">
|
|
722
|
+
* <em>rel</em> - The rel value of the link.<br>
|
|
723
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz" rel="<strong>xyz</strong>">Linked text</a></code><br>
|
|
724
|
+
* Default is <code>null</code>
|
|
725
|
+
* </li>
|
|
726
|
+
* <li style="margin-top:5px">
|
|
727
|
+
* <em>accessKey</em> - The accesskey value of the link.<br>
|
|
728
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz" accesskey="<strong>xyz</strong>">Linked text</a></code><br>
|
|
729
|
+
* Default is <code>null</code>
|
|
730
|
+
* </li>
|
|
731
|
+
* <li style="margin-top:5px">
|
|
732
|
+
* <em>openNewWindow</em> - Whether or not the link should be opened in a new window.<br>
|
|
733
|
+
* Default is <code>false</code>
|
|
734
|
+
* </li>
|
|
735
|
+
* <li style="margin-top:5px">
|
|
736
|
+
* <em>dataAttributes</em> - Additional HTML5 data-* attributes.<br>
|
|
737
|
+
* Default is no data attributes
|
|
738
|
+
* </li>
|
|
739
|
+
* <li style="margin-top:5px">
|
|
740
|
+
* <em>download</em> - Whether or not to add the HTML5-specific <em>download</em> attribute
|
|
741
|
+
* (indication to the browser to download the link target instead of navigating to it).<br>
|
|
742
|
+
* Default is <code>false</code>
|
|
743
|
+
* </li>
|
|
744
|
+
* <li style="margin-top:5px">
|
|
745
|
+
* <em>lang</em> - Defines the language of the link element.<br>
|
|
746
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz" lang="<strong>en</strong>">Linked text</a></code><br>
|
|
747
|
+
* Default is <code>null</code>
|
|
748
|
+
* </li>
|
|
749
|
+
* <li style="margin-top:5px">
|
|
750
|
+
* <em>hreflang</em> - Hints at the language of the linked resource.<br>
|
|
751
|
+
* Example: <code><a class="xyz" href="xyz" title="xyz" hreflang="<strong>en</strong>">Linked text</a></code><br>
|
|
752
|
+
* Default is <code>null</code>
|
|
753
|
+
* </li>
|
|
754
|
+
* </ul>
|
|
755
|
+
* </li>
|
|
756
|
+
*
|
|
757
|
+
* <li style="margin-top:10px"><strong>Additional</strong> (rendering helpers/settings):
|
|
758
|
+
* <ul>
|
|
759
|
+
* <li style="margin-top:5px">
|
|
760
|
+
* <em>useAutoTitle</em> - Whether or not the title automatically should get a calculated title value (if it is null).<br>
|
|
761
|
+
* Default is <code>false</code>.
|
|
762
|
+
* </li>
|
|
763
|
+
* <li style="margin-top:5px">
|
|
764
|
+
* <em>useEncoding</em> - Whether or not all attributes should be encoded.<br>
|
|
765
|
+
* Default is <code>true</code>.
|
|
766
|
+
* </li>
|
|
767
|
+
* <li style="margin-top:5px">
|
|
768
|
+
* <em>useParameterEncoding</em> - Whether or not <em>targetParameters</em> should be encoded.<br>
|
|
769
|
+
* Default is <code>true</code>.
|
|
770
|
+
* </li>
|
|
771
|
+
* <li style="margin-top:5px">
|
|
772
|
+
* <em>useLinkDecorationSettings</em> - Whether or not to use the link type icons settings (i.e. "Show icon next to external links",
|
|
773
|
+
* "Show icon next to links that opens in a new window") of the current site.<br>
|
|
774
|
+
* Default is <code>true</code>.
|
|
775
|
+
* </li>
|
|
776
|
+
* <li style="margin-top:5px">
|
|
777
|
+
* <em>useResourceDecorationSettings</em> - Whether or not to use the file resource setting (i.e. "Show icon next to known file types" and
|
|
778
|
+
* "Show file description and size next to known file types") of the current site.<br>
|
|
779
|
+
* Default is <code>true</code>.
|
|
780
|
+
* </li>
|
|
781
|
+
* <li style="margin-top:5px">
|
|
782
|
+
* <em>useCrossSiteTargetChecking</em> - Whether or not to check Node targets for cross-site URL's.<br>
|
|
783
|
+
* Default is <code>false</code>.
|
|
784
|
+
* </li>
|
|
785
|
+
* </ul>
|
|
786
|
+
* </li>
|
|
787
|
+
* </ul>
|
|
788
|
+
*
|
|
789
|
+
* <p>
|
|
790
|
+
* ----------------------------------------------------------------------------------------------------
|
|
791
|
+
* </p>
|
|
792
|
+
*
|
|
793
|
+
* <p>
|
|
794
|
+
* Using the LinkRenderer is pretty straightforward, if you remember that it is <strong>stateful</strong>.<br>
|
|
795
|
+
* Conceptually you would typically use it like this:
|
|
796
|
+
* </p>
|
|
797
|
+
* <ol>
|
|
798
|
+
* <li>Get the LinkRenderer</li>
|
|
799
|
+
* <li>Possibly init the renderer with additional settings (useEncoding, autoTitle etc.)</li>
|
|
800
|
+
* <li>Init the renderer with mandatory attributes (text, target and fontClass)</li>
|
|
801
|
+
* <li>Possibly init the renderer with recommended attributes (title) if you need it.</li>
|
|
802
|
+
* <li>Possibly init the renderer with optional attributes (style, rel etc.)</li>
|
|
803
|
+
* <li>Do render</li>
|
|
804
|
+
* </ol>
|
|
805
|
+
* <p>
|
|
806
|
+
* When you have rendered once, you can re-use the LinkRenderer until you are done. Something like:
|
|
807
|
+
* </p>
|
|
808
|
+
* <ol>
|
|
809
|
+
* <li>Update the LinkRenderer
|
|
810
|
+
* <ul>
|
|
811
|
+
* <li>Update mandatory attributes (text, target, fontClass) that needs to be updated.</li>
|
|
812
|
+
* <li>Possibly update optional attributes and clear the ones you don't need anymore.</li>
|
|
813
|
+
* <li>Possibly update the additional settings that needs to be updated.</li>
|
|
814
|
+
* </ul>
|
|
815
|
+
* </li>
|
|
816
|
+
* <li>Do render.</li>
|
|
817
|
+
* </ol>
|
|
818
|
+
*
|
|
819
|
+
* <p>
|
|
820
|
+
* <strong>Example of how this strategy could be implemented in Velocity:</strong><br>
|
|
821
|
+
* (You want to do a simple menu, i.e. iterate the nodes in a collection/iterator "$pages", and use LinkRenderer to render links to them
|
|
822
|
+
* as a html list)
|
|
823
|
+
* </p>
|
|
824
|
+
* <pre><code>
|
|
825
|
+
* <em>## Get PropertyUtil to ease Node property fetching</em>
|
|
826
|
+
* #set ($propertyUtil = $sitevisionUtils.propertyUtil)
|
|
827
|
+
*
|
|
828
|
+
* <em>## Use font class 'normal' for all links</em>
|
|
829
|
+
* #set ($font = 'normal')
|
|
830
|
+
*
|
|
831
|
+
* <em>## Get LinkRenderer</em>
|
|
832
|
+
* #set ($linkRenderer = $sitevisionUtils.linkRenderer)
|
|
833
|
+
*
|
|
834
|
+
* <em>## Iterate through pages and render links to them</em>
|
|
835
|
+
* <ul style="list-style:none">
|
|
836
|
+
* #foreach ($page in $pages)
|
|
837
|
+
* <em>## Fetch the name of the node</em>
|
|
838
|
+
* #set ($pageName = $propertyUtil.getString($page, 'displayName', $page.toString()))
|
|
839
|
+
*
|
|
840
|
+
* <em>## Update the renderer and render</em>
|
|
841
|
+
* $linkRenderer.update($page, $font, $pageName)
|
|
842
|
+
* <li>
|
|
843
|
+
* $linkRenderer.render()
|
|
844
|
+
* </li>
|
|
845
|
+
* #end
|
|
846
|
+
* </ul>
|
|
847
|
+
* </code></pre>
|
|
848
|
+
*
|
|
849
|
+
* <p>
|
|
850
|
+
* ----------------------------------------------------------------------------------------------------
|
|
851
|
+
* </p>
|
|
852
|
+
*
|
|
853
|
+
* <p>
|
|
854
|
+
* Since LinkRenderer is stateful and likely will be used in Velocity frequently, there are some "shortcuts" that might be useful:
|
|
855
|
+
* </p>
|
|
856
|
+
* <ul>
|
|
857
|
+
* <li style="margin-top:5px">
|
|
858
|
+
* A quick way to update the mandatory attributes is to use one of the <code>update(...)</code> methods.
|
|
859
|
+
* If you at the same time want to clear all optional attributes, use one of the <code>updateClean(...)</code> methods instead.
|
|
860
|
+
* </li>
|
|
861
|
+
* <li style="margin-top:5px">
|
|
862
|
+
* A smooth way to clear all optional attributes is to call the <code>clearAllOptional()</code> method
|
|
863
|
+
* </li>
|
|
864
|
+
* <li style="margin-top:5px">
|
|
865
|
+
* Due to the lack of proper boolean support in Velocity, all the boolean attributes has corresponding force/clear methods to set the boolean
|
|
866
|
+
* to true/false. For example: <br>
|
|
867
|
+
* Executing <code>forceOpenNewWindow()</code> results in an execution of <code>setOpenNewWindow(true)</code> <br>
|
|
868
|
+
* Executing <code>clearOpenNewWindow()</code> results in an execution of <code>setOpenNewWindow(false)</code>
|
|
869
|
+
* </li>
|
|
870
|
+
* <li style="margin-top:5px">
|
|
871
|
+
* Due to the lack of proper null support in Velocity, some attributes has clear methods to set the attribute to <code>null</code>.
|
|
872
|
+
* For example: <br>
|
|
873
|
+
* Executing <code>clearAccessKey()</code> results in an execution of <code>setAccessKey(null)</code>
|
|
874
|
+
* </li>
|
|
875
|
+
* </ul>
|
|
876
|
+
*
|
|
877
|
+
* <p>
|
|
878
|
+
* <a name="threadnote"></a>
|
|
879
|
+
* <strong>Thread Note!</strong> The render method is <em>NOT</em> thread safe! If two threads simultaneously executes
|
|
880
|
+
* the render method on the <em>SAME</em> LinkRenderer instance, the rendered result is undeterminable. This is in almost
|
|
881
|
+
* all cases nothing you need to worry about, unless your portlet or servlet actually creates a separate <code>Thread</code>
|
|
882
|
+
* and starts it. If so - ensure all your created threads creates and uses their own LinkRenderer instance!
|
|
883
|
+
* </p>
|
|
884
|
+
*
|
|
885
|
+
* <p>
|
|
886
|
+
* <strong>Note/Tip!</strong> This interface helps rendering textual links. If you want to render <em>image</em> links, you would typically
|
|
887
|
+
* use the {@link senselogic.sitevision.api.render.ImageLinkRenderer} instead.
|
|
888
|
+
* </p>Updates current state.Updates current state and removes previous title.Updates current state and removes previous title.Updates current state and removes previous title and text.
|
|
889
|
+
*
|
|
890
|
+
* <p>
|
|
891
|
+
* Note. If no text exists when rendering, the target Node will be used to determine an appropriate text
|
|
892
|
+
* (e.g. the display name if the node is a page).
|
|
893
|
+
* </p>Updates current state and removes all optional attributes.Updates current state and removes all optional attributes and title.Updates current state and removes all optional attributes and title.Updates current state and removes all optional attributes, title and text.
|
|
894
|
+
*
|
|
895
|
+
* <p>
|
|
896
|
+
* Note. If no text exists when rendering, the target Node will be used to determine an appropriate text
|
|
897
|
+
* (e.g. the display name if the node is a page).
|
|
898
|
+
* </p>Removes all optional settings.
|
|
899
|
+
* In other words - executing this method has the same effect as executing:
|
|
900
|
+
* <ul>
|
|
901
|
+
* <li><code>clearStyle()</code></li>
|
|
902
|
+
* <li><code>clearOnclick()</code></li>
|
|
903
|
+
* <li><code>clearId()</code></li>
|
|
904
|
+
* <li><code>clearTargetParameters()</code></li>
|
|
905
|
+
* <li><code>clearRel()</code></li>
|
|
906
|
+
* <li><code>clearAccessKey()</code></li>
|
|
907
|
+
* <li><code>clearOpenNewWindow()</code></li>
|
|
908
|
+
* <li><code>clearDataAttributes()</code></li>
|
|
909
|
+
* <li><code>clearUseDownload()</code></li>
|
|
910
|
+
* <li><code>clearLang()</code></li>
|
|
911
|
+
* <li><code>clearHrefLang()</code></li>
|
|
912
|
+
* </ul>Builds a html link based on current state.
|
|
913
|
+
*
|
|
914
|
+
* <p>
|
|
915
|
+
* <em>Note!</em> The render method is not thread safe, see <a href="#threadnote">thread note above</a>.
|
|
916
|
+
* </p>Sets what the link target is, i.e "what the link links to" (href attribute on the a element).
|
|
917
|
+
* The target attribute is mandatory when the result is rendered.Sets what the link target is, i.e "what the link links to" (href attribute on the a element).
|
|
918
|
+
* The target attribute is mandatory when the result is rendered.Checks if a Node is a renderable target or not (node type accepted).
|
|
919
|
+
*
|
|
920
|
+
* <p>
|
|
921
|
+
* This method can be used to avoid updating this renderer with nodes that can't be rendered. Since nodes that aren't
|
|
922
|
+
* renderable will be ignored, updating the renderer with such nodes will result in rendering of previous target.
|
|
923
|
+
* </p>
|
|
924
|
+
*
|
|
925
|
+
* <p>
|
|
926
|
+
* <code>LinkRenderer</code> will accept nodes with the following primary node type as targets
|
|
927
|
+
* (i.e. this method will return <code>true</code> for such nodes):
|
|
928
|
+
* </p>
|
|
929
|
+
* <ul>
|
|
930
|
+
* <li><code>sv:article</code></li>
|
|
931
|
+
* <li><code>sv:collaborationGroup</code></li>
|
|
932
|
+
* <li><code>sv:collaborationGroupPage</code></li>
|
|
933
|
+
* <li><code>sv:collaborationGroupTemplate</code></li>
|
|
934
|
+
* <li><code>sv:file</code></li>
|
|
935
|
+
* <li><code>sv:image</code></li>
|
|
936
|
+
* <li><code>sv:link</code> <em>(the actual target of the link must also be a valid target)</em></li>
|
|
937
|
+
* <li><code>sv:page</code></li>
|
|
938
|
+
* <li><code>sv:sitePage</code></li>
|
|
939
|
+
* <li><code>sv:structureLink</code> <em>(the actual target of the structure link must also be a valid target)</em></li>
|
|
940
|
+
* <li><code>sv:structurePage</code></li>
|
|
941
|
+
* <li><code>sv:systemUser</code> <em>(the system user must have a mail address)</em></li>
|
|
942
|
+
* <li><code>sv:template</code></li>
|
|
943
|
+
* <li><code>sv:user</code> <em>(the user must have a mail address)</em></li>
|
|
944
|
+
* <li><code>sv:userIdentity</code> <em>(the site must have a profile page, or backing user must have a mail address)</em></li>
|
|
945
|
+
* </ul>
|
|
946
|
+
*
|
|
947
|
+
* <p>
|
|
948
|
+
* Always use this method if you are not sure all nodes you are rendering will be accepted as targets.
|
|
949
|
+
* </p>
|
|
950
|
+
*
|
|
951
|
+
* <p>
|
|
952
|
+
* <strong>Example:</strong><br>
|
|
953
|
+
* Velocity code like this:
|
|
954
|
+
* </p>
|
|
955
|
+
* <pre><code><ul style="list-style:none">
|
|
956
|
+
* #foreach ($node in $myNodes)
|
|
957
|
+
* <em>## Update the renderer and render</em>
|
|
958
|
+
* $linkRenderer.update($node)
|
|
959
|
+
* <li>$linkRenderer.render()</li>
|
|
960
|
+
*#end
|
|
961
|
+
*</ul></code></pre>
|
|
962
|
+
* could be replaced with Velocity code like this:<pre><code><ul style="list-style:none">
|
|
963
|
+
* #foreach ($node in $myNodes)
|
|
964
|
+
* <em>## Ensure node actually can be rendered</em>
|
|
965
|
+
* #if ($linkRenderer.isRenderableTarget($node))
|
|
966
|
+
* <em>## Update the renderer and render</em>
|
|
967
|
+
* $linkRenderer.update($node)
|
|
968
|
+
* <li>$linkRenderer.render()</li>
|
|
969
|
+
* #end
|
|
970
|
+
* #end
|
|
971
|
+
* </ul></code></pre>
|
|
972
|
+
*
|
|
973
|
+
* <p>
|
|
974
|
+
* <em>Performance note!</em> Calling this method prior to calling an <code>update</code> method (or the <code>setTarget</code> method)
|
|
975
|
+
* will not have any noticeable negative performance impact. The result of this method is internally cached and the <code>update</code>
|
|
976
|
+
* methods (and the <code>setTarget</code> method) will re-use that cached data.
|
|
977
|
+
* </p>Checks if a Node is a valid target or not (node type accepted and target is valid).
|
|
978
|
+
*
|
|
979
|
+
* <p>
|
|
980
|
+
* This method is similar to the {@link senselogic.sitevision.api.render.LinkRenderer#isRenderableTarget(javax.jcr.Node)} method,
|
|
981
|
+
* but this method does more extensive checking to ensure rendered links will be ok. <em>Note! "External" link targets (e.g.
|
|
982
|
+
* a link to "www.whatever.com") of a sv:link Node will NOT be checked.</em>
|
|
983
|
+
* </p>
|
|
984
|
+
* <p>
|
|
985
|
+
* This method can be used to avoid updating this renderer with nodes that can't be rendered or nodes that have invalid targets.
|
|
986
|
+
* An invalid target is typically an existing link that has an empty or trashed target (i.e. target is in trashcan).
|
|
987
|
+
* </p>
|
|
988
|
+
*
|
|
989
|
+
* <p>
|
|
990
|
+
* <strong>Example:</strong><br>
|
|
991
|
+
* Velocity code like this:
|
|
992
|
+
* </p>
|
|
993
|
+
* <pre><code><ul style="list-style:none">
|
|
994
|
+
* #foreach ($node in $myNodes)
|
|
995
|
+
* <em>## Update the renderer and render</em>
|
|
996
|
+
* $linkRenderer.update($node)
|
|
997
|
+
* <li>$linkRenderer.render()</li>
|
|
998
|
+
*#end
|
|
999
|
+
*</ul></code></pre>
|
|
1000
|
+
* could be replaced with Velocity code like this:<pre><code><ul style="list-style:none">
|
|
1001
|
+
* #foreach ($node in $myNodes)
|
|
1002
|
+
* <em>## Ensure node actually can be rendered</em>
|
|
1003
|
+
* #if ($linkRenderer.isValidTarget($node))
|
|
1004
|
+
* <em>## Update the renderer and render</em>
|
|
1005
|
+
* $linkRenderer.update($node)
|
|
1006
|
+
* <li>$linkRenderer.render()</li>
|
|
1007
|
+
* #end
|
|
1008
|
+
* #end
|
|
1009
|
+
* </ul></code></pre>
|
|
1010
|
+
*
|
|
1011
|
+
* <p>
|
|
1012
|
+
* <em>Performance note!</em> Avoid subsequent calls to this method for same <code>Node</code>. If performance is a top
|
|
1013
|
+
* priority, consider using {@link senselogic.sitevision.api.render.LinkRenderer#isRenderableTarget(javax.jcr.Node)} instead.
|
|
1014
|
+
* </p>Sets the class name the link should use (class attribute on the a element).
|
|
1015
|
+
* The fontClass attribute is mandatory when the result is rendered.Sets the class name the link should use (class attribute on an a element) based on a given font node.
|
|
1016
|
+
*
|
|
1017
|
+
* <p>
|
|
1018
|
+
* The actual font class is extracted from aFontNode and if aFontNode is <code>null</code> or not a valid font node the
|
|
1019
|
+
* font class will not be set.
|
|
1020
|
+
* </p>
|
|
1021
|
+
* <p>
|
|
1022
|
+
* When subsequently setting the font class, use the {@link #setFontClass(String)} method instead for best performance.
|
|
1023
|
+
* </p>Sets the text that the link should display, i.e. "the text the user clicks on".
|
|
1024
|
+
* The text attribute is mandatory when the result is rendered.Sets the title the link should have (title attribute on the a element).
|
|
1025
|
+
*
|
|
1026
|
+
* <p>
|
|
1027
|
+
* If there are no title (i.e. it is <code>null</code>) when the result is rendered, it will get the same
|
|
1028
|
+
* value as text attribute if autoTitle is activated, otherwise it will be empty. Default is <code>null</code>.
|
|
1029
|
+
* </p>Removes the title, i.e. executes <code>setTitle(null)</code>Sets the css style the link should have (style attribute on the a element).
|
|
1030
|
+
* The style attribute is optional when the result is rendered. Default is <code>null</code>.Removes the style, i.e executes <code>setStyle(null)</code>Sets the lang attribute on the a element (defines the language of the element).Removes the lang, i.e executes <code>setLang(null)</code>Sets the hreflang attribute on the a element (hints at the language of the linked resource).Removes the hreflang, i.e executes <code>setHrefLang(null)</code>Adds target parameters (key=value) to the link target (href attribute on the a element).
|
|
1031
|
+
*
|
|
1032
|
+
* <p>
|
|
1033
|
+
* Target parameters is optional when the result is rendered. Default is no target parameters.
|
|
1034
|
+
* </p>
|
|
1035
|
+
* <p>
|
|
1036
|
+
* There can only be one target parameter per key (i.e. when a target parameter is added it will always replace the possibly existing
|
|
1037
|
+
* target parameter that already use that key).
|
|
1038
|
+
* </p>Removes all existing target parametersShould target parameters be URL encoded or not?
|
|
1039
|
+
* Default is <code>true</code>.Utility method for executing <code>setUseParameterEncoding(true)</code>Utility method for executing <code>setUseParameterEncoding(false)</code>Adds an HTML5 data-* attribute to the link element.
|
|
1040
|
+
* Data attributes is optional when the result is rendered. Default is no data attributes.
|
|
1041
|
+
* <p>
|
|
1042
|
+
* There can only be one data attribute per name (i.e. when a data attribute is added it will always replace the possibly existing
|
|
1043
|
+
* data attribute that already use that name).
|
|
1044
|
+
* </p>
|
|
1045
|
+
*
|
|
1046
|
+
* <p>
|
|
1047
|
+
* Notes about names and values:
|
|
1048
|
+
* </p>
|
|
1049
|
+
* <ul>
|
|
1050
|
+
* <li>
|
|
1051
|
+
* A <strong>name</strong> that is <code>null</code> or <em>whitespace-only</em> will be completely ignored,
|
|
1052
|
+
* i.e. no data attribute will be rendered.
|
|
1053
|
+
* </li>
|
|
1054
|
+
* <li>
|
|
1055
|
+
* A <strong>name</strong> that isn't properly prefixed with <em>"data-"</em> will be prefixed when the data attribute is rendered.
|
|
1056
|
+
* </li>
|
|
1057
|
+
* <li>
|
|
1058
|
+
* A <strong>value</strong> that is <code>null</code> or <em>whitespace-only</em> will be rendered as a data attribute without value.
|
|
1059
|
+
* </li>
|
|
1060
|
+
* <li>
|
|
1061
|
+
* A <strong>value</strong> should not be escaped/encoded. The <em>useEncoding</em> attribute will determine what to do
|
|
1062
|
+
* when the data attributes are rendered.
|
|
1063
|
+
* </ul>Removes all existing data attributesSets what access key the link should have (accesskey attribute on the a element)
|
|
1064
|
+
* The accesskey attribute is optional when the result is rendered. Default is <code>null</code>.Removes the accesskey, i.e. executes <code>setAccessKey(null)</code>Sets the rel that should be used (rel attribute on the a element)
|
|
1065
|
+
* The rel attribute is optional when the result is rendered. Default is <code>null</code>.Removes the rel value, i.e executes <code>setRel(null)</code>Sets the onclick value (onclick attribute and onkeypress attribute on the a element), typically some kind of Javascript
|
|
1066
|
+
* The onclick attribute is optional when the result is rendered. Default is <code>null</code>.
|
|
1067
|
+
*
|
|
1068
|
+
* <p><em>Note!</em> The events (onclick, onkeypress) will be added with non-obtrusive javascript when render() is called.</p>Removes the onclick value, i.e executes <code>setOnclick(null)</code>Sets the id value (id attribute on the a element), most likely only needed if some kind of javascript/ajax code needs to access the
|
|
1069
|
+
* rendered link via its id.
|
|
1070
|
+
*
|
|
1071
|
+
* <p>
|
|
1072
|
+
* The id attribute is optional when the result is rendered. Default is <code>null</code>.
|
|
1073
|
+
* </p>
|
|
1074
|
+
* <p>
|
|
1075
|
+
* This method does <em>not</em> perform any checks of the id. All values will be accepted.
|
|
1076
|
+
* <em>(Note! A valid id should be unique - i.e. should not appear more than once in a html/xhtml document - and not all characters are allowed.
|
|
1077
|
+
* See <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#sec-attribute-types">W3C 3.3.1 Attribute types</a>.)</em>
|
|
1078
|
+
* </p>Removes the id value, i.e executes <code>setId(null)</code>Use icons for "external", "new window" and "new window, external" according to Site's settings or not.
|
|
1079
|
+
* Default is <code>true</code>.Utility method for executing <code>setUseLinkDecorationSettings(true)</code>Utility method for executing <code>setUseLinkDecorationSettings(false)</code>Use icons/descriptions for known file types according to Site's settings or not.
|
|
1080
|
+
* Default is <code>true</code>.Utility method for executing <code>setUseResourceDecorationSettings(true)</code>Utility method for executing <code>setUseResourceDecorationSettings(false)</code>Should the link target be opened in a new window or not?
|
|
1081
|
+
* Default is <code>false</code>.Utility method for executing <code>setOpenNewWindow(true)</code>Utility method for executing <code>setOpenNewWindow(false)</code>Should the browser download the link target instead of navigating to it?
|
|
1082
|
+
* Default is <code>false</code>.Utility method for executing <code>setUseDownload(true)</code>Utility method for executing <code>setUseDownload(false)</code>Should text and attributes be properly encoded or not?
|
|
1083
|
+
* Default is <code>true</code>.Utility method for executing <code>setUseEncoding(true)</code>Utility method for executing <code>setUseEncoding(false)</code>Ensures title always will have a value. If non-existing, the title will be set to the title of the target target (or
|
|
1084
|
+
* the same as the linked text if the target isn't a page or the title of the page is lacking)
|
|
1085
|
+
* Default is <code>false</code>.Utility method for executing <code>setUseAutoTitle(true)</code>Utility method for executing <code>setUseAutoTitle(false)</code>Should cross-site internal Node links be handled or not?
|
|
1086
|
+
*
|
|
1087
|
+
* <p>
|
|
1088
|
+
* Default is <code>false</code>.
|
|
1089
|
+
* </p>
|
|
1090
|
+
* <p>
|
|
1091
|
+
* <em>Note! For best performance: enable only if your site actually contains internal links to
|
|
1092
|
+
* pages on other sites (e.g. The System user creates an internal link and selects a page
|
|
1093
|
+
* on another site in the target browse tree).</em>
|
|
1094
|
+
* </p>Utility method for executing <code>setUseCrossSiteTargetChecking(true)</code>Utility method for executing <code>seUseCrossSiteTargetChecking(false)</code>
|
|
1095
|
+
* @author Magnus Lövgren
|
|
1096
|
+
*/
|
|
1097
|
+
declare namespace LinkRenderer {
|
|
1098
|
+
export {
|
|
1099
|
+
update,
|
|
1100
|
+
updateClean,
|
|
1101
|
+
clearAllOptional,
|
|
1102
|
+
render,
|
|
1103
|
+
setTarget,
|
|
1104
|
+
setStringTarget,
|
|
1105
|
+
isRenderableTarget,
|
|
1106
|
+
isValidTarget,
|
|
1107
|
+
setFontClass,
|
|
1108
|
+
setFont,
|
|
1109
|
+
setText,
|
|
1110
|
+
setTitle,
|
|
1111
|
+
removeTitle,
|
|
1112
|
+
setStyle,
|
|
1113
|
+
clearStyle,
|
|
1114
|
+
setLang,
|
|
1115
|
+
clearLang,
|
|
1116
|
+
setHrefLang,
|
|
1117
|
+
clearHrefLang,
|
|
1118
|
+
addTargetParameter,
|
|
1119
|
+
clearTargetParameters,
|
|
1120
|
+
setUseParameterEncoding,
|
|
1121
|
+
forceUseParameterEncoding,
|
|
1122
|
+
clearUseParameterEncoding,
|
|
1123
|
+
addDataAttribute,
|
|
1124
|
+
clearDataAttributes,
|
|
1125
|
+
setAccessKey,
|
|
1126
|
+
clearAccessKey,
|
|
1127
|
+
setRel,
|
|
1128
|
+
clearRel,
|
|
1129
|
+
setOnclick,
|
|
1130
|
+
clearOnclick,
|
|
1131
|
+
setId,
|
|
1132
|
+
clearId,
|
|
1133
|
+
setUseLinkDecorationSettings,
|
|
1134
|
+
forceUseLinkDecorationSettings,
|
|
1135
|
+
clearUseLinkDecorationSettings,
|
|
1136
|
+
setUseResourceDecorationSettings,
|
|
1137
|
+
forceUseResourceDecorationSettings,
|
|
1138
|
+
clearUseResourceDecorationSettings,
|
|
1139
|
+
setOpenNewWindow,
|
|
1140
|
+
forceOpenNewWindow,
|
|
1141
|
+
clearOpenNewWindow,
|
|
1142
|
+
setUseDownload,
|
|
1143
|
+
forceUseDownload,
|
|
1144
|
+
clearUseDownload,
|
|
1145
|
+
setUseEncoding,
|
|
1146
|
+
forceUseEncoding,
|
|
1147
|
+
clearUseEncoding,
|
|
1148
|
+
setUseAutoTitle,
|
|
1149
|
+
forceUseAutoTitle,
|
|
1150
|
+
clearUseAutoTitle,
|
|
1151
|
+
setUseCrossSiteTargetChecking,
|
|
1152
|
+
forceUseCrossSiteTargetChecking,
|
|
1153
|
+
clearUseCrossSiteTargetChecking,
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
export default LinkRenderer;
|