3

I have created Schema with two XML names (fields)

  1. Text field
  2. link of type Embedded schema.

When I try to fetch the SchematicSchema from Entity/Model class, I see only text field, but not the embeded links data. Can some one help here.

Schema:

<xsd:annotation>
  <xsd:appinfo>
    <tcm:Labels xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
      <tcm:Label ElementName="headline" Metadata="false">Heading</tcm:Label>
      <tcm:Label ElementName="link" Metadata="false">Links</tcm:Label>
      <tcm:Label ElementName="linkText" Context="tcm:4">Link Text</tcm:Label
      <tcm:Label ElementName="externalLink" Context="tcm:4">External Link</tcm:Label>
      <tcm:Label ElementName="internalLink" Context="tcm:4">-- OR -- Internal Link</tcm:Label>
      <tcm:Label ElementName="alternateText" Context="tcm:4-89-8">Alternate Text</tcm:Label>
    </tcm:Labels>
  </xsd:appinfo>
</xsd:annotation>
<xsd:element name="CustomerInfo">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="headline" minOccurs="0" maxOccurs="1" type="xsd:normalizedString">
        <xsd:annotation>
          <xsd:appinfo>
            <ExtensionXml xmlns="http://www.tridion.com/ContentManager/5.0"></ExtensionXml>
          </xsd:appinfo>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="link" minOccurs="1" maxOccurs="unbounded" type="EmbeddedLink">
        <xsd:annotation>
          <xsd:appinfo>
            <ExtensionXml xmlns="http://www.tridion.com/ContentManager/5.0">
              <configuration xmlns="http://www.sdltridion.com/2011/SiteEdit">
                <field>
                  <editable>true</editable>
                </field>
              </configuration>
            </ExtensionXml>
            <tcm:EmbeddedSchema xlink:href="tcm:4" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="Link"></tcm:EmbeddedSchema>
          </xsd:appinfo>
        </xsd:annotation>

Model:

public class xxxx extends AbstractEntity {
    private String headline;

    private List<Link> links;

    public String getHeadline() {
        return headline;
    }

    public void setHeadline(String headline) {
        this.headline = headline;
    }

    public List<Link> getLinks() {
        return links;
    }

    public void setLinks(List<Link> links) {
        this.links = links;
    }

    @Override
    public String toString() {
        return "xxx{" +
                "headline='" + headline + '\'' +
                ", links=" + links +
                '}';
    }
}

final SemanticSchema semanticSchema = localization.getSemanticSchemas() .get(Long.parseLong(component.getSchema().getId().split("-")[1]));
1
  • after you modified your schema, did you republish your site settings page and did you 'refresh' your website's config settings by going to the url [website]/admin/refresh ? May 6, 2015 at 12:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.