Model.json
I want my custom page properties to include in the json.model ootb page
How can I do that?
I already create a new field in dialog , and try to expose them but still don't works.
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Exporter;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
import com.adobe.cq.export.json.ComponentExporter;
import com.adobe.cq.export.json.ExporterConstants;
@Model(
adaptables = SlingHttpServletRequest.class,
adapters = ComponentExporter.class,
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
resourceType = "core/wcm/components/page/v3/page"
)
@Exporter(
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
extensions = ExporterConstants.SLING_MODEL_EXTENSION
)
public class ContentPageModel implements ComponentExporter {
static final String RESOURCE_TYPE = "core/wcm/components/page/v3/page";
// Custom properties
@ValueMapValue
private String pageTitleContentPage;
@ValueMapValue
private String pageDescription;
@ValueMapValue
private String titleTag;
@ValueMapValue
private String date;
public String getPageTitleContentPage() {
return pageTitleContentPage;
}
public String getPageDescription() {
return pageDescription;
}
public String getTitleTag() {
return titleTag;
}
public void setPageTitleContentPage(String pageTitleContentPage) {
this.pageTitleContentPage = pageTitleContentPage;
}
public void setPageDescription(String pageDescription) {
this.pageDescription = pageDescription;
}
public void setTitleTag(String titleTag) {
this.titleTag = titleTag;
}
public void setDate(String date) {
this.date = date;
}
public String getDate() {
return date;
}
@Override
public String getExportedType() {
return "core/wcm/components/page/v3/page";
}
}
My Expectation is it included in here
My Expectation is it included in here
