<?xml version="1.0" encoding="UTF-8"?>
<otrunk id="33754150-b594-11d9-9669-0800200c9a66" >
  <imports>
    <import class="org.concord.otrunk.OTSystem"/>
    <import class="org.concord.otrunk.view.OTFolderObject"/>
    <import class="org.concord.otrunk.view.OTViewEntry"/>
    <import class="org.concord.otrunk.view.OTViewMode"/>
    <import class="org.concord.otrunk.view.OTViewService"/>    
    <import class="org.concord.framework.otrunk.view.OTFrame"/>
    <import class="org.concord.otrunk.view.document.OTCompoundDoc"/>
    <import class="org.concord.otrunk.view.document.OTTextObject"/>
    <import class="org.concord.otrunk.ui.OTButton"/>
    <import class="org.concord.otrunk.ui.OTImage"/>
    <import class="org.concord.otrunk.view.OTObjectEditViewConfig"/>
    <import class="org.concord.otrunk.view.OTAuthorEmbedDefaultViewConfig"/>
    <import class="org.concord.otrunk.view.document.OTDocumentViewConfig"/>
  </imports>
  <objects>
    <OTSystem>
      <services>
        <OTViewService>
          <viewEntries>
            <OTViewEntry local_id="image_view"
              objectClass="org.concord.otrunk.ui.OTImage" 
              viewClass="org.concord.otrunk.ui.swing.OTImageView"/>
            <OTViewEntry
              objectClass="org.concord.otrunk.ui.OTButton" 
              viewClass="org.concord.otrunk.ui.swing.OTButtonView"/>
            <OTViewEntry
              objectClass="org.concord.otrunk.view.document.OTTextObject" 
              viewClass="org.concord.otrunk.view.document.OTTextObjectView"/>
              
            <!--  anonymous documents render their components in 
                 embedded-authoring mode -->
            <OTDocumentViewConfig
              objectClass="org.concord.otrunk.view.document.OTCompoundDoc" 
              viewClass="org.concord.otrunk.view.document.OTDocumentView"
              mode="embedded-authoring" />  
              
            <!--  activity views by default render their components normally -->  
            <OTDocumentViewConfig local_id="activity_view"
              objectClass="org.concord.otrunk.view.document.OTCompoundDoc" 
              viewClass="org.concord.otrunk.view.document.OTDocumentView"
            />    
            
            <!--  section views by default render their components normally -->              
            <OTDocumentViewConfig local_id="section_view"
              objectClass="org.concord.otrunk.view.document.OTCompoundDoc" 
              viewClass="org.concord.otrunk.view.document.OTDocumentView"
            />    
          	<OTViewEntry
              objectClass="org.concord.otrunk.view.OTFolderObject" 
              viewClass="org.concord.otrunk.view.OTFolderObjectEditView"/>
          </viewEntries>
          <modes>
            <OTViewMode name="embedded-authoring">
              <map>
                <!--  make the activities be rendered with an edit link -->
                <entry key="${activity_view}">
                	<OTAuthorEmbedDefaultViewConfig
                		objectClass="org.concord.framework.otrunk.OTObject"
                		viewClass="org.concord.otrunk.view.OTAuthorEmbedDefaultView"
                		popupViewMode="activity-authoring">
                		<frame>
                			<OTFrame width="500" height="600"
                				title="Edit" />
                		</frame>
                	</OTAuthorEmbedDefaultViewConfig>
                </entry>
                
                <!--  make the sections be rendered normally -->
                <entry key="${section_view}">
                	<object refid="${section_view}"/>
                </entry>
              </map>
            </OTViewMode>
            <OTViewMode name="activity-authoring">
              <map>
                <!--  make the outer activity be rendered as normal but 
                   have it render its sub object in this activity-authoring mode
                   too -->
                <entry key="${activity_view}">
                    <OTDocumentViewConfig
                        objectClass="org.concord.otrunk.view.document.OTCompoundDoc"
                        viewClass="org.concord.otrunk.view.document.OTDocumentView" 
                        mode="activity-authoring"
                        />
                </entry>
                
                <!--  make the sections be rendered as editable boxes 
                  it would be nice to have another view for this since the 
                  preview will be the main document -->
                <entry key="${section_view}">
                	<OTObjectEditViewConfig
                		objectClass="org.concord.otrunk.view.document.OTCompoundDoc"
                		viewClass="org.concord.otrunk.view.document.OTCompoundDocEditView">
                		<objectsToInsert>
                			<OTTextObject name="Text Box" />
                			<OTButton name="Button" />
                			<OTImage name="Concord Logo"
                				imageBytes="http://www.concord.org/images/logos/cc/cc-logo.gif" />
                			<OTImage name="Concord Banner"
                				imageBytes="http://www.concord.org/images/logos/cc/cc_main_banner.jpg" />
                		</objectsToInsert>
                	</OTObjectEditViewConfig>
                </entry>
              </map>
            </OTViewMode>
          </modes>
        </OTViewService>
      </services>
      <root>
		<OTCompoundDoc name="Root">
		  <bodyText>
		    Main Authoring System Page
            <div style="background-color: rgb(255, 248, 233); border: border-width: 5px; border-color: red; border-style: solid;">
		    <object refid="${activity}" viewid="${activity_view}"/>
            </div>
		  </bodyText>
		  <children>
		  	<OTCompoundDoc name="Activity" local_id="activity">
		  		<bodyText>
		  		    <h3>Section 1</h3>
		  		    <object refid="${section_1}" viewid="${section_view}"/>
		  		
		  		    <h3>Section 2</h3>
		  		    <object refid="${section_2}" viewid="${section_view}"/>

		  		    <h3>Section 3</h3>
		  		    <object refid="${section_3}" viewid="${section_view}"/>
		  		</bodyText>
		  		<children>
        		  	<OTCompoundDoc name="Section 1" local_id="section_1">
        		  	  <bodyText>change me</bodyText>
        		  	</OTCompoundDoc>
        		  	<OTCompoundDoc name="Section 1" local_id="section_2">
        		  	  <bodyText>change me</bodyText>
        		  	</OTCompoundDoc>
        		  	<OTCompoundDoc name="Section 1" local_id="section_3">
        		  	  <bodyText>change me</bodyText>
        		  	</OTCompoundDoc>
		  		</children>
		  	</OTCompoundDoc>
		  </children>
		</OTCompoundDoc>        
      </root>
    </OTSystem>
  </objects>
</otrunk>
