Skip to main content
edited tags
Link
Rick Pannekoek
  • 21.4k
  • 1
  • 18
  • 30
Changed class name of embeddedLink so that helper can relate
Source Link
Chris
  • 137
  • 5

We're trying to implement Anchor Link on our existing Link Component by Enabling Anchor Feature in cd_link_conf.xml

This is our configuration looks like

<Publications OverrideDiscoveryService="true">
    <Publication Id="33">
        <Host Domain="mysite.test" Port="80" Path="" Protocol="https" />
        <Linking ComponentAnchors="true" AddComponentLinkInfo="true" />
    </Publication>
</Publications>

Link schema enter image description here

and our link model class

@Data
@EqualsAndHashCode(callSuper = true)
public class Link extends AbstractEntityModel {

    @JsonProperty("linkTekst")
    private String linkTekst;

    // url property; neem externeLink als interneLink niet bestaat.
    @SemanticProperties({
            @SemanticProperty("interneLink"),
            @SemanticProperty("externeLink")
    })
    @JsonProperty("url")
    private String url;

    @SemanticProperty("interneLink")
    private EmbeddableLinkEntityModel embeddedLink;

    @JsonProperty("alternatieveTekst")
    private String alternatieveTekst;
    @JsonProperty("linkStyle")
    private Tag linkStyle;
}

We came with 2 problems:

  • Anchor hash is not added in the url
  • url always use domain defined by cd_link_conf.xml. It's not dynamic following where the web application runs (e.g. on localhost, urls points to mysite.test domain instead of localhost)

Is there anything that I miss?

Specs:

  • Java application uses dxa 2.0.3 framework.
  • Dxa Model service 2.2.2

We're trying to implement Anchor Link on our existing Link Component by Enabling Anchor Feature in cd_link_conf.xml

This is our configuration looks like

<Publications OverrideDiscoveryService="true">
    <Publication Id="33">
        <Host Domain="mysite.test" Port="80" Path="" Protocol="https" />
        <Linking ComponentAnchors="true" AddComponentLinkInfo="true" />
    </Publication>
</Publications>

Link schema enter image description here

and our link model class

@Data
@EqualsAndHashCode(callSuper = true)
public class Link extends AbstractEntityModel {

    @JsonProperty("linkTekst")
    private String linkTekst;

    // url property; neem externeLink als interneLink niet bestaat.
    @SemanticProperties({
            @SemanticProperty("interneLink"),
            @SemanticProperty("externeLink")
    })
    @JsonProperty("url")
    private String url;

    @SemanticProperty("interneLink")
    private EmbeddableLink embeddedLink;

    @JsonProperty("alternatieveTekst")
    private String alternatieveTekst;
    @JsonProperty("linkStyle")
    private Tag linkStyle;
}

We came with 2 problems:

  • Anchor hash is not added in the url
  • url always use domain defined by cd_link_conf.xml. It's not dynamic following where the web application runs (e.g. on localhost, urls points to mysite.test domain instead of localhost)

Is there anything that I miss?

Specs:

  • Java application uses dxa 2.0.3 framework.
  • Dxa Model service 2.2.2

We're trying to implement Anchor Link on our existing Link Component by Enabling Anchor Feature in cd_link_conf.xml

This is our configuration looks like

<Publications OverrideDiscoveryService="true">
    <Publication Id="33">
        <Host Domain="mysite.test" Port="80" Path="" Protocol="https" />
        <Linking ComponentAnchors="true" AddComponentLinkInfo="true" />
    </Publication>
</Publications>

Link schema enter image description here

and our link model class

@Data
@EqualsAndHashCode(callSuper = true)
public class Link extends AbstractEntityModel {

    @JsonProperty("linkTekst")
    private String linkTekst;

    // url property; neem externeLink als interneLink niet bestaat.
    @SemanticProperties({
            @SemanticProperty("interneLink"),
            @SemanticProperty("externeLink")
    })
    @JsonProperty("url")
    private String url;

    @SemanticProperty("interneLink")
    private EntityModel embeddedLink;

    @JsonProperty("alternatieveTekst")
    private String alternatieveTekst;
    @JsonProperty("linkStyle")
    private Tag linkStyle;
}

We came with 2 problems:

  • Anchor hash is not added in the url
  • url always use domain defined by cd_link_conf.xml. It's not dynamic following where the web application runs (e.g. on localhost, urls points to mysite.test domain instead of localhost)

Is there anything that I miss?

Specs:

  • Java application uses dxa 2.0.3 framework.
  • Dxa Model service 2.2.2
format changes to the text
Source Link
Marko Milic
  • 8.9k
  • 3
  • 24
  • 60

We're trying to Implementimplement Anchor Link on Our Existingour existing Link Component by Enabling Anchor Feature in cd_link_conf.xml

This is our configuration looks like

<Publications OverrideDiscoveryService="true">
    <Publication Id="33">
        <Host Domain="mysite.test" Port="80" Path="" Protocol="https" />
        <Linking ComponentAnchors="true" AddComponentLinkInfo="true" />
    </Publication>
</Publications>

Link schema enter image description here

and our link model class

@Data
@EqualsAndHashCode(callSuper = true)
public class Link extends AbstractEntityModel {

    @JsonProperty("linkTekst")
    private String linkTekst;

    // url property; neem externeLink als interneLink niet bestaat.
    @SemanticProperties({
            @SemanticProperty("interneLink"),
            @SemanticProperty("externeLink")
    })
    @JsonProperty("url")
    private String url;

    @SemanticProperty("interneLink")
    private EmbeddableLink embeddedLink;

    @JsonProperty("alternatieveTekst")
    private String alternatieveTekst;
    @JsonProperty("linkStyle")
    private Tag linkStyle;
}

We came with 2 problems:

  • Anchor hash is not added in the url
  • url always use domain defined by cd_link_conf.xml. It's not dynamic following where the web application runs (e.g. on localhost, urls points to mysite.test domain instead of localhost)

Is there anything that I miss?

Specs:

  • Java application uses dxa 2.0.3 framework.
  • Dxa Model service 2.2.2

We're trying to Implement Anchor Link on Our Existing Link Component by Enabling Anchor Feature in cd_link_conf.xml

This is our configuration looks like

<Publications OverrideDiscoveryService="true">
    <Publication Id="33">
        <Host Domain="mysite.test" Port="80" Path="" Protocol="https" />
        <Linking ComponentAnchors="true" AddComponentLinkInfo="true" />
    </Publication>
</Publications>

Link schema enter image description here

and our link model class

@Data
@EqualsAndHashCode(callSuper = true)
public class Link extends AbstractEntityModel {

    @JsonProperty("linkTekst")
    private String linkTekst;

    // url property; neem externeLink als interneLink niet bestaat.
    @SemanticProperties({
            @SemanticProperty("interneLink"),
            @SemanticProperty("externeLink")
    })
    @JsonProperty("url")
    private String url;

    @SemanticProperty("interneLink")
    private EmbeddableLink embeddedLink;

    @JsonProperty("alternatieveTekst")
    private String alternatieveTekst;
    @JsonProperty("linkStyle")
    private Tag linkStyle;
}

We came with 2 problems:

  • Anchor hash is not added in the url
  • url always use domain defined by cd_link_conf.xml. It's not dynamic following where the web application runs (e.g. on localhost, urls points to mysite.test domain instead of localhost)

Is there anything that I miss?

Specs:

  • Java application uses dxa 2.0.3 framework.
  • Dxa Model service 2.2.2

We're trying to implement Anchor Link on our existing Link Component by Enabling Anchor Feature in cd_link_conf.xml

This is our configuration looks like

<Publications OverrideDiscoveryService="true">
    <Publication Id="33">
        <Host Domain="mysite.test" Port="80" Path="" Protocol="https" />
        <Linking ComponentAnchors="true" AddComponentLinkInfo="true" />
    </Publication>
</Publications>

Link schema enter image description here

and our link model class

@Data
@EqualsAndHashCode(callSuper = true)
public class Link extends AbstractEntityModel {

    @JsonProperty("linkTekst")
    private String linkTekst;

    // url property; neem externeLink als interneLink niet bestaat.
    @SemanticProperties({
            @SemanticProperty("interneLink"),
            @SemanticProperty("externeLink")
    })
    @JsonProperty("url")
    private String url;

    @SemanticProperty("interneLink")
    private EmbeddableLink embeddedLink;

    @JsonProperty("alternatieveTekst")
    private String alternatieveTekst;
    @JsonProperty("linkStyle")
    private Tag linkStyle;
}

We came with 2 problems:

  • Anchor hash is not added in the url
  • url always use domain defined by cd_link_conf.xml. It's not dynamic following where the web application runs (e.g. on localhost, urls points to mysite.test domain instead of localhost)

Is there anything that I miss?

Specs:

  • Java application uses dxa 2.0.3 framework.
  • Dxa Model service 2.2.2
Source Link
Chris
  • 137
  • 5
Loading