From ca12053a04fa1c68f2aded9691453702bbcd6b1e Mon Sep 17 00:00:00 2001 From: Simon Urli Date: Tue, 19 Nov 2024 18:34:29 +0100 Subject: [PATCH] XWIKI-22571: Backlinks update changes an absolute reference to the moved page into one relative to the current wiki * Provide relative EntityResourceReference resolvers for ResourceReference and use those to determine if an entity reference contains a wiki part or not * WIP: need to check / improve actual implem of the resolvers and add test / doc --- .../internal/ResourceReferenceRenamer.java | 9 +- ...ourceReferenceEntityReferenceResolver.java | 59 ++++++++++++ ...ourceReferenceEntityReferenceResolver.java | 51 +++++++++++ ...ourceReferenceEntityReferenceResolver.java | 51 +++++++++++ ...ourceReferenceEntityReferenceResolver.java | 52 +++++++++++ ...ourceReferenceEntityReferenceResolver.java | 51 +++++++++++ ...ourceReferenceEntityReferenceResolver.java | 91 +++++++++++++++++++ ...ourceReferenceEntityReferenceResolver.java | 51 +++++++++++ .../main/resources/META-INF/components.txt | 6 ++ 9 files changed, 419 insertions(+), 2 deletions(-) create mode 100644 xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/AbstractRelativeResourceReferenceEntityReferenceResolver.java create mode 100644 xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeAttachmentResourceReferenceEntityReferenceResolver.java create mode 100644 xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeDocumentResourceReferenceEntityReferenceResolver.java create mode 100644 xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageAttachmentResourceReferenceEntityReferenceResolver.java create mode 100644 xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageResourceReferenceEntityReferenceResolver.java create mode 100644 xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeResourceReferenceEntityReferenceResolver.java create mode 100644 xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeSpaceResourceReferenceEntityReferenceResolver.java diff --git a/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/src/main/java/org/xwiki/refactoring/internal/ResourceReferenceRenamer.java b/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/src/main/java/org/xwiki/refactoring/internal/ResourceReferenceRenamer.java index 8b2c52222628..8d672d573ef5 100644 --- a/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/src/main/java/org/xwiki/refactoring/internal/ResourceReferenceRenamer.java +++ b/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/src/main/java/org/xwiki/refactoring/internal/ResourceReferenceRenamer.java @@ -59,6 +59,10 @@ public class ResourceReferenceRenamer @Inject private EntityReferenceResolver entityReferenceResolver; + @Inject + @Named("relative") + private EntityReferenceResolver relativeEntityReferenceResolver; + @Inject @Named("compact") private EntityReferenceSerializer compactEntityReferenceSerializer; @@ -206,9 +210,10 @@ private boolean updateAbsoluteResourceReference(ResourceReference resourceRefere private String getNewTargetReference(ResourceReference resourceReference, EntityReference newTargetReference, EntityReference currentReference) { + EntityReference entityReference = + this.relativeEntityReferenceResolver.resolve(resourceReference, null, (Object) null); // If the reference contains the wiki name, then we should keep the absolute serialization. - // TODO: This regex feels really fragile, I'm not sure how we should check presence of a wiki here. - if (resourceReference.getReference().matches("^\\w+:\\w.*$")) { + if (entityReference.extractReference(EntityType.WIKI) != null) { return this.defaultEntityReferenceSerializer.serialize(newTargetReference, currentReference); } else { return this.compactEntityReferenceSerializer.serialize(newTargetReference, currentReference); diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/AbstractRelativeResourceReferenceEntityReferenceResolver.java b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/AbstractRelativeResourceReferenceEntityReferenceResolver.java new file mode 100644 index 000000000000..7d94b7b9fd86 --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/AbstractRelativeResourceReferenceEntityReferenceResolver.java @@ -0,0 +1,59 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.rendering.internal.resolver; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.xwiki.model.EntityType; +import org.xwiki.model.reference.EntityReference; +import org.xwiki.model.reference.EntityReferenceResolver; +import org.xwiki.rendering.listener.reference.ResourceReference; +import org.xwiki.rendering.listener.reference.ResourceType; + +/** + * Convert document resource reference into entity reference. + * + * @version $Id$ + * @since 17.0.0RC1 + */ +public abstract class AbstractRelativeResourceReferenceEntityReferenceResolver + extends AbstractResourceReferenceEntityReferenceResolver +{ + @Inject + @Named("relative") + private EntityReferenceResolver relativeReferenceResolver; + + /** + * Default constructor. + */ + public AbstractRelativeResourceReferenceEntityReferenceResolver(ResourceType type) + { + super(type); + } + + @Override + protected EntityReference resolveTyped(ResourceReference resourceReference, EntityReference baseReference) + { + return this.relativeReferenceResolver.resolve(resourceReference.getReference(), getEntityType()); + } + + public abstract EntityType getEntityType(); +} diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeAttachmentResourceReferenceEntityReferenceResolver.java b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeAttachmentResourceReferenceEntityReferenceResolver.java new file mode 100644 index 000000000000..e0ec7b137943 --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeAttachmentResourceReferenceEntityReferenceResolver.java @@ -0,0 +1,51 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.rendering.internal.resolver; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.xwiki.component.annotation.Component; +import org.xwiki.model.EntityType; +import org.xwiki.rendering.listener.reference.ResourceType; + +/** + * Convert attachment resource reference into entity reference. + * + * @version $Id$ + * @since 17.0.0RC1 + */ +@Component +@Named("relative/attach") +@Singleton +public class RelativeAttachmentResourceReferenceEntityReferenceResolver + extends AbstractRelativeResourceReferenceEntityReferenceResolver +{ + public RelativeAttachmentResourceReferenceEntityReferenceResolver() + { + super(ResourceType.ATTACHMENT); + } + + @Override + public EntityType getEntityType() + { + return EntityType.ATTACHMENT; + } +} diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeDocumentResourceReferenceEntityReferenceResolver.java b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeDocumentResourceReferenceEntityReferenceResolver.java new file mode 100644 index 000000000000..59f055ede35c --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeDocumentResourceReferenceEntityReferenceResolver.java @@ -0,0 +1,51 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.rendering.internal.resolver; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.xwiki.component.annotation.Component; +import org.xwiki.model.EntityType; +import org.xwiki.rendering.listener.reference.ResourceType; + +/** + * Convert document resource reference into entity reference. + * + * @version $Id$ + * @since 17.0.0RC1 + */ +@Component +@Named("relative/doc") +@Singleton +public class RelativeDocumentResourceReferenceEntityReferenceResolver + extends AbstractRelativeResourceReferenceEntityReferenceResolver +{ + public RelativeDocumentResourceReferenceEntityReferenceResolver() + { + super(ResourceType.DOCUMENT); + } + + @Override + public EntityType getEntityType() + { + return EntityType.DOCUMENT; + } +} diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageAttachmentResourceReferenceEntityReferenceResolver.java b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageAttachmentResourceReferenceEntityReferenceResolver.java new file mode 100644 index 000000000000..e53bc17cc309 --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageAttachmentResourceReferenceEntityReferenceResolver.java @@ -0,0 +1,52 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.rendering.internal.resolver; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.xwiki.component.annotation.Component; +import org.xwiki.model.EntityType; +import org.xwiki.rendering.listener.reference.ResourceType; + +/** + * Convert attachment resource reference into entity reference. + * + * @version $Id$ + * @since 13.10.5 + * @since 17.0.0RC1 + */ +@Component +@Named("relative/pageAttach") +@Singleton +public class RelativePageAttachmentResourceReferenceEntityReferenceResolver + extends AbstractRelativeResourceReferenceEntityReferenceResolver +{ + public RelativePageAttachmentResourceReferenceEntityReferenceResolver() + { + super(ResourceType.PAGE_ATTACHMENT); + } + + @Override + public EntityType getEntityType() + { + return EntityType.PAGE_ATTACHMENT; + } +} diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageResourceReferenceEntityReferenceResolver.java b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageResourceReferenceEntityReferenceResolver.java new file mode 100644 index 000000000000..53502f775b5b --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativePageResourceReferenceEntityReferenceResolver.java @@ -0,0 +1,51 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.rendering.internal.resolver; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.xwiki.component.annotation.Component; +import org.xwiki.model.EntityType; +import org.xwiki.rendering.listener.reference.ResourceType; + +/** + * Convert page resource reference into entity reference. + * + * @version $Id$ + * @since 17.0.0RC1 + */ +@Component +@Named("relative/page") +@Singleton +public class RelativePageResourceReferenceEntityReferenceResolver + extends AbstractRelativeResourceReferenceEntityReferenceResolver +{ + public RelativePageResourceReferenceEntityReferenceResolver() + { + super(ResourceType.PAGE); + } + + @Override + public EntityType getEntityType() + { + return EntityType.PAGE; + } +} diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeResourceReferenceEntityReferenceResolver.java b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeResourceReferenceEntityReferenceResolver.java new file mode 100644 index 000000000000..3e34f7d355d3 --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeResourceReferenceEntityReferenceResolver.java @@ -0,0 +1,91 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.rendering.internal.resolver; + +import java.lang.reflect.ParameterizedType; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; +import javax.inject.Singleton; + +import org.xwiki.component.annotation.Component; +import org.xwiki.component.manager.ComponentLookupException; +import org.xwiki.component.manager.ComponentManager; +import org.xwiki.component.util.DefaultParameterizedType; +import org.xwiki.model.EntityType; +import org.xwiki.model.reference.EntityReference; +import org.xwiki.model.reference.EntityReferenceResolver; +import org.xwiki.rendering.listener.reference.ResourceReference; + +/** + * Default entry point to convert a resource reference into an entity reference. + * + * @version $Id$ + * @since 17.0.0RC1 + */ +@Component +@Named("relative") +@Singleton +public class RelativeResourceReferenceEntityReferenceResolver implements EntityReferenceResolver +{ + /** + * Type instance for EntityReferenceResolver. + */ + public static final ParameterizedType TYPE_RESOURCEREFERENCE = + new DefaultParameterizedType(null, EntityReferenceResolver.class, ResourceReference.class); + + private static final String RELATIVE_HINT = "relative/%s"; + + @Inject + @Named("context") + private Provider componentManagerProvider; + + @Override + public EntityReference resolve(ResourceReference resourceReference, EntityType type, Object... parameters) + { + if (resourceReference == null) { + return null; + } + + if (this.componentManagerProvider.get().hasComponent(TYPE_RESOURCEREFERENCE, + getRelativeHint(resourceReference))) { + EntityReferenceResolver resolver; + try { + resolver = this.componentManagerProvider.get().getInstance(TYPE_RESOURCEREFERENCE, + getRelativeHint(resourceReference)); + } catch (ComponentLookupException e) { + throw new RuntimeException( + String.format("Unknown error when trying to load resolver for reference [%s]", resourceReference), + e); + } + + return resolver.resolve(resourceReference, type, parameters); + } + + // Unsupported resource reference type + return null; + } + + private String getRelativeHint(ResourceReference resourceReference) + { + return String.format(RELATIVE_HINT, resourceReference.getType().getScheme()); + } +} diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeSpaceResourceReferenceEntityReferenceResolver.java b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeSpaceResourceReferenceEntityReferenceResolver.java new file mode 100644 index 000000000000..640299f6cb4b --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/resolver/RelativeSpaceResourceReferenceEntityReferenceResolver.java @@ -0,0 +1,51 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.rendering.internal.resolver; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.xwiki.component.annotation.Component; +import org.xwiki.model.EntityType; +import org.xwiki.rendering.listener.reference.ResourceType; + +/** + * Convert space resource reference into entity reference. + * + * @version $Id$ + * @since 17.0.0RC1 + */ +@Component +@Named("relative/space") +@Singleton +public class RelativeSpaceResourceReferenceEntityReferenceResolver + extends AbstractRelativeResourceReferenceEntityReferenceResolver +{ + public RelativeSpaceResourceReferenceEntityReferenceResolver() + { + super(ResourceType.SPACE); + } + + @Override + public EntityType getEntityType() + { + return EntityType.SPACE; + } +} diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/resources/META-INF/components.txt b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/resources/META-INF/components.txt index a1627d0569eb..b73c2c8b79c5 100644 --- a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/resources/META-INF/components.txt +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/src/main/resources/META-INF/components.txt @@ -12,6 +12,12 @@ org.xwiki.rendering.internal.resolver.DefaultResourceReferenceEntityReferenceRes org.xwiki.rendering.internal.resolver.DocumentResourceReferenceEntityReferenceResolver org.xwiki.rendering.internal.resolver.PageAttachmentResourceReferenceEntityReferenceResolver org.xwiki.rendering.internal.resolver.PageResourceReferenceEntityReferenceResolver +org.xwiki.rendering.internal.resolver.RelativeAttachmentResourceReferenceEntityReferenceResolver +org.xwiki.rendering.internal.resolver.RelativeDocumentResourceReferenceEntityReferenceResolver +org.xwiki.rendering.internal.resolver.RelativePageAttachmentResourceReferenceEntityReferenceResolver +org.xwiki.rendering.internal.resolver.RelativePageResourceReferenceEntityReferenceResolver +org.xwiki.rendering.internal.resolver.RelativeSpaceResourceReferenceEntityReferenceResolver +org.xwiki.rendering.internal.resolver.RelativeResourceReferenceEntityReferenceResolver org.xwiki.rendering.internal.resolver.SpaceResourceReferenceEntityReferenceResolver org.xwiki.rendering.script.RenderingScriptService org.xwiki.rendering.internal.parser.LinkParser