Skip to main content

UPDATED

We haven't found a solution, and we think every step is right. What are we missing??

Core Initializer: @RegisteredViewModel(viewName = "myPage",modelClass = CustomPageModelImpl.class)

CustomPageModelImpl: @SemanticEntity(entityName = "myPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl {}

myPage.jspx

JAVA ERROR: PageModelImpl cannot be cast to CustomPageModelImpl


I need to get a component included in Structure Group metadata. To have this information in the page I include the template "Add inherited metadata to page" in the page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

It returns something like this: "org.dd4t.contentmodel.impl.ComponentImpl@64d12583"

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [...] }

And using this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the component included in SG metadata? or how can I get the information of that component?


Edited: I think that my issue can be here:

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m")

I am not sure what I have to write in the "entityName" param.

I need to get a component included in Structure Group metadata. To have this information in the page I include the template "Add inherited metadata to page" in the page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

It returns something like this: "org.dd4t.contentmodel.impl.ComponentImpl@64d12583"

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [...] }

And using this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the component included in SG metadata? or how can I get the information of that component?


Edited: I think that my issue can be here:

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m")

I am not sure what I have to write in the "entityName" param.

UPDATED

We haven't found a solution, and we think every step is right. What are we missing??

Core Initializer: @RegisteredViewModel(viewName = "myPage",modelClass = CustomPageModelImpl.class)

CustomPageModelImpl: @SemanticEntity(entityName = "myPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl {}

myPage.jspx

JAVA ERROR: PageModelImpl cannot be cast to CustomPageModelImpl


I need to get a component included in Structure Group metadata. To have this information in the page I include the template "Add inherited metadata to page" in the page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [...] }

And using this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the component included in SG metadata? or how can I get the information of that component?


Edited: I think that my issue can be here:

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m")

I am not sure what I have to write in the "entityName" param.

added 204 characters in body
Source Link

I need to get a component included in Structure Group metadata. To have this information in the page I include the template "Add inherited metadata to page" in the page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

It returns something like this: "org.dd4t.contentmodel.impl.ComponentImpl@64d12583"

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [...] }

And using this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the component included in SG metadata? or how can I get the information of that component?


Edited: I think that my issue can be here:

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m")

I am not sure what I have to write in the "entityName" param.

I need to get a component included in Structure Group metadata. To have this information in the page I include the template "Add inherited metadata to page" in the page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

It returns something like this: "org.dd4t.contentmodel.impl.ComponentImpl@64d12583"

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [...] }

And using this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the component included in SG metadata? or how can I get the information of that component?

I need to get a component included in Structure Group metadata. To have this information in the page I include the template "Add inherited metadata to page" in the page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

It returns something like this: "org.dd4t.contentmodel.impl.ComponentImpl@64d12583"

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [...] }

And using this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the component included in SG metadata? or how can I get the information of that component?


Edited: I think that my issue can be here:

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m")

I am not sure what I have to write in the "entityName" param.

Tweeted twitter.com/StackTridion/status/778021764072873984
edited body
Source Link

I need to get a Componentcomponent included in Structure Group metadata. To have this information in the Pagepage I include the template Add inherited metadata to page"Add inherited metadata to page" in the Pagepage template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

${pageModel.meta["promotion"]}

It returns something like this: "org.dd4t.contentmodel.impl.ComponentImpl@64d12583"

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

org.dd4t@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [.contentmodel.impl.ComponentImpl@64d12583] }

I amAnd using DXA 1.5 Java.this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the Componentcomponent included in SG metadata? or how can I get the information of that Componentcomponent?

I need to get a Component included in Structure Group metadata. To have this information in the Page I include the template Add inherited metadata to page in the Page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

It returns something like this:

org.dd4t.contentmodel.impl.ComponentImpl@64d12583

I am using DXA 1.5 Java.

How can I get the TCM of the Component included in SG metadata? or how can I get the information of that Component?

I need to get a component included in Structure Group metadata. To have this information in the page I include the template "Add inherited metadata to page" in the page template and I can see in the JSON the value of that metadata:

MetadataFields":{"promotion":{"Name":"promotion","Values":["tcm:47-129384"],"NumericValues":[],"DateTimeValues":[],"LinkedComponentValues":...

The problem that I have is when I try to get that information in the view:

${pageModel.meta["promotion"]}

It returns something like this: "org.dd4t.contentmodel.impl.ComponentImpl@64d12583"

I am using dxa 1.5 with Java.

I tried to extend the PageModelImpl as an Entity to get the Metadata creating a "CustomPageModelImpl":

@SemanticEntity(entityName = "MyPage", vocabulary = SDL_CORE, prefix = "m") public class CustomPageModelImpl extends PageModelImpl { [...] }

And using this entity as a Bean in the Page view:

jsp:useBean id="pageModel" type="com.dxa.api.model.entity.CustomPageModelImpl" scope="request"

It returns an error when the page load:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[jsp]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: com.sdl.webapp.common.api.model.page.PageModelImpl cannot be cast to com.dxa.api.model.entity.CustomPageModelImpl

How can I get the TCM of the component included in SG metadata? or how can I get the information of that component?

added 1 character in body; edited title
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90
Loading
edited body
Source Link
Loading
edited tags
Link
Loading
Source Link
Loading