Commit 457a5637 authored by Bert Leunis's avatar Bert Leunis

ESSENTIALS-1052 Reintegrate bugfix/ESSENTIALS-1052

parents fd0432cb e6edacf5
/*
* Copyright 2014-2016 Hippo B.V. (http://www.onehippo.com)
* Copyright 2014-2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -116,7 +116,7 @@ public class ContentBeansService {
// check if directly extending compound:
final Set<String> superTypes = missingBean.getSuperTypes();
if (superTypes.size() == 1 && superTypes.iterator().next().equals(BASE_COMPOUND_TYPE)) {
createBaseBean(missingBean);
createCompoundBaseBean(missingBean);
missingBeanIterator.remove();
} else {
final String parent = findExistingParent(missingBean, existing);
......@@ -390,11 +390,11 @@ public class ContentBeansService {
}
private void createBaseBean(final HippoContentBean bean) {
private void createCompoundBaseBean(final HippoContentBean bean) {
final Path javaClass = createJavaClass(bean);
JavaSourceUtils.createHippoBean(javaClass, context.beansPackageName(), bean.getName(), bean.getName());
JavaSourceUtils.addExtendsClass(javaClass, "HippoDocument");
JavaSourceUtils.addImport(javaClass, EssentialConst.HIPPO_DOCUMENT_IMPORT);
JavaSourceUtils.addExtendsClass(javaClass, "HippoCompound");
JavaSourceUtils.addImport(javaClass, EssentialConst.HIPPO_COMPOUND_IMPORT);
}
......@@ -735,7 +735,6 @@ public class ContentBeansService {
JavaSourceUtils.createHippoBean(javaClass, context.beansPackageName(), bean.getName(), bean.getName());
final String extendsName = FilenameUtils.removeExtension(parentPath.toFile().getName());
JavaSourceUtils.addExtendsClass(javaClass, extendsName);
JavaSourceUtils.addImport(javaClass, EssentialConst.HIPPO_DOCUMENT_IMPORT);
}
......
/*
* Copyright 2014-2016 Hippo B.V. (http://www.onehippo.com)
* Copyright 2014-2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -163,8 +163,9 @@ public final class EssentialConst {
public static final String HIPPOSYSEDIT_PROTOTYPE = "hipposysedit:prototype";
public static final String HIPPOSYSEDIT_NODETYPE = "hipposysedit:nodetype";
public static final String HIPPO_COMPOUND = "hippo:compound";
public static final String HIPPO_COMPOUND_BASE_CLASS = "HippoDocument";
public static final String HIPPO_COMPOUND_BASE_CLASS = "HippoCompound";
public static final String HIPPO_DOCUMENT_IMPORT = "org.hippoecm.hst.content.beans.standard.HippoDocument";
public static final String HIPPO_COMPOUND_IMPORT = "org.hippoecm.hst.content.beans.standard.HippoCompound";
public static final String HIPPO_ITEM_IMPORT = "org.hippoecm.hst.content.beans.standard.HippoItem";
public static final String HIPPO_BEAN_IMPORT = "org.hippoecm.hst.content.beans.standard.HippoBean";
public static final String HIPPO_RELATED_DOCS_IMPORT = "org.onehippo.forge.beans.RelatedDocsBean";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment