package com.celements.structEditor.pagetypes;

import java.util.Set;

import org.xwiki.component.annotation.Component;
import org.xwiki.component.annotation.Requirement;

import com.celements.pagetype.category.IPageTypeCategoryRole;
import com.celements.pagetype.java.AbstractJavaPageType;
import com.google.common.collect.Sets;

@Component(StructuredDataEditorPageType.STRUCURED_DATA_EDITOR_PAGETYPE_NAME)
public class StructuredDataEditorPageType extends AbstractJavaPageType {

  public static final String STRUCURED_DATA_EDITOR_PAGETYPE_NAME = "StrucuredDataEditor";

  @Requirement
  private IPageTypeCategoryRole pageTypeCategory;

  @Override
  public boolean displayInFrameLayout() {
    return true;
  }

  @Override
  public Set<IPageTypeCategoryRole> getCategories() {
    return Sets.newHashSet(pageTypeCategory);
  }

  @Override
  public String getName() {
    return STRUCURED_DATA_EDITOR_PAGETYPE_NAME;
  }

  @Override
  public String getRenderTemplateForRenderMode(String renderMode) {
    return "Templates.StructuredDataEditor";
  }

  @Override
  public boolean hasPageTitle() {
    return false;
  }

  @Override
  public boolean isUnconnectedParent() {
    return false;
  }

  @Override
  public boolean isVisible() {
    return true;
  }

}

@@ -993,24 +993,119 @@
 nderMode) %7B%0A
+    if (%22edit%22.equals(renderMode)) %7B%0A      return %22Templates.PresentationEdit%22;%0A    %7D else %7B%0A  
     return %22
@@ -1137,16 +1137,22 @@
 ditor%22;%0A
+    %7D%0A
   %7D%0A%0A  @

add edit template to StructuredDataEditorPageType