diff --git a/main/plugin-contenttypes-editor/src/org/ametys/plugins/contenttypeseditor/ContentTypeInformationsHelper.java b/main/plugin-contenttypes-editor/src/org/ametys/plugins/contenttypeseditor/ContentTypeInformationsHelper.java index bbae578..d004b1e 100644 --- a/main/plugin-contenttypes-editor/src/org/ametys/plugins/contenttypeseditor/ContentTypeInformationsHelper.java +++ b/main/plugin-contenttypes-editor/src/org/ametys/plugins/contenttypeseditor/ContentTypeInformationsHelper.java @@ -35,6 +35,7 @@ import org.apache.commons.lang3.StringUtils; import org.xml.sax.SAXException; +import org.ametys.cms.content.ContentViewProvider; import org.ametys.cms.contenttype.ContentAttributeDefinition; import org.ametys.cms.contenttype.ContentType; import org.ametys.cms.contenttype.ContentTypeExtensionPoint; @@ -77,6 +78,8 @@ /** The content type extension point instance */ protected ContentTypeExtensionPoint _contentTypeExtensionPoint; + /** The content type provider */ + protected ContentViewProvider _contentViewProvider; /** The rights extension point instance */ protected RightsExtensionPoint _rightsExtensionPoint; @@ -111,6 +114,7 @@ public void service(ServiceManager serviceManager) throws ServiceException { _contentTypeExtensionPoint = (ContentTypeExtensionPoint) serviceManager.lookup(ContentTypeExtensionPoint.ROLE); + _contentViewProvider = (ContentViewProvider) serviceManager.lookup(ContentViewProvider.ROLE); _rightsExtensionPoint = (RightsExtensionPoint) serviceManager.lookup(RightsExtensionPoint.ROLE); _i18nUtils = (I18nUtils) serviceManager.lookup(I18nUtils.ROLE); _langageManager = (LanguagesManager) serviceManager.lookup(LanguagesManager.ROLE); @@ -131,7 +135,8 @@ } ContentType cType = _contentTypeExtensionPoint.getExtension(contentTypeId); - View view = cType.getView(viewName); + View view = _contentViewProvider.getView(viewName, new String[] {contentTypeId}, new String[0]); +// View view = cType.getView(viewName); if (view == null) { throw new IllegalStateException("Unknown view '" + viewName + "' for content type '" + contentTypeId + "'"); @@ -603,7 +608,8 @@ List> views = new ArrayList<>(); for (String name : contentType.getViewNames()) { - View view = contentType.getView(name); + View view = _contentViewProvider.getView(name, new String[] {contentType.getId()}, new String[0]); +// View view = contentType.getView(name); views.add(_getViewValues(contentType, view, hideInheritedModelItems, resolveMultilingualString)); } return views;