﻿<ElementStructure xmlns="http://www.composite.net/ns/management/trees/treemarkup/1.0" xmlns:f="http://www.composite.net/ns/function/1.0">

  <ElementStructure.AutoAttachments>
    <NamedParent Name="Data" Position="Top"/>
  </ElementStructure.AutoAttachments>

  <ElementRoot>
    <Children>
      <Element Label="Movies" Id="MoviesRoot">
        <Children>
          <DataElements Type="Demo.IGenre, Movies" Label="${C1:Data:Demo.IGenre:Name}" Icon="folder-open">
            <Actions>
              <EditDataAction Label="Edit Genre" CustomFormMarkupPath="~/App_Data/Composite/DynamicTypeForms/GenreForm.xml" />
              <DeleteDataAction Label="Delete Genre"/>
              <ConfirmAction ConfirmMessage="Are you sure you want to delete all movies of this genre?" ConfirmTitle="Delete Movies" Label="Delete Movies Here">
                <f:function name="Demo.DeleteMovies">
                  <f:param name="Guid" value="${C1:Data:Demo.IGenre:Id}"/>
                </f:function>
              </ConfirmAction>
              <AddDataAction Label="Add Movie" Type="Demo.IMovie" CustomFormMarkupPath="~/App_Data/Composite/DynamicTypeForms/MovieForm.xml"/>
            
            </Actions>
            <Children>
              <DataElements Type="Demo.IMovie, Movies" Label="${C1:Data:Demo.IMovie:Title}" Icon="page-publication">
                <Actions>
                  <EditDataAction Label="Edit Movie" CustomFormMarkupPath="~/App_Data/Composite/DynamicTypeForms/MovieForm.xml" />
                  <DeleteDataAction Label="Delete Movie"/>
                  <ReportFunctionAction Label="Show As Cover">
                    <f:function name="Demo.ShowFormatted">
                      <f:param name="Guid" value="${C1:Data:Demo.IMovie:Id}"/>
                    </f:function>
                  </ReportFunctionAction>
                </Actions>
                <Filters>
                  <ParentIdFilter ParentType="Demo.IGenre, Movies" ReferenceFieldName="Genre"/>
                </Filters>
              </DataElements>

            </Children>
          </DataElements>
        </Children>
        <Actions>
          <AddDataAction Label="Add Genre" Type="Demo.IGenre" CustomFormMarkupPath="~/App_Data/Composite/DynamicTypeForms/GenreForm.xml"/>
        </Actions>
      </Element>

    </Children>

  </ElementRoot>
</ElementStructure>
