<?xml version="1.0" encoding="utf-8"?>
<KScriptSetting>
  <Name>TextRepository</Name>
  <Description>The repository that contains Text Objects such as Layout and View</Description>
  <Example> <![CDATA[
  <script engine="kscript">

      var view = k.site.views.get("viewname");
      
      var layout = k.site.layouts.get("layoutname"); 
      
      //...... 

    </script>
	]]>

  </Example>
  <Props />
  <Methods> 
    <Method>
      <Name>all</Name>
      <Description>Return an array of the SiteObjects</Description>
      <Example>

        <![CDATA[
  <script engine="kscript">

      var allitems = k.site.views.all(); 

    </script>
	]]>
      
      </Example>
      <Params />
      <ReturnType>array</ReturnType>
    </Method>
    <Method>
      <Name>updateBody</Name>
      <Description>Update the text value of the body property</Description>
      <Example> 
        <![CDATA[
  <script engine="kscript">

      var view = k.site.views.get("viewname");
      k.site.views.updateBody(view.name, "new page body");

    </script>
	]]> 
      </Example>
      <Params>
        <Param>
          <Name>nameOrId</Name>
          <Description>NameOrId</Description>
          <Type>object</Type>
        </Param>
        <Param>
          <Name>newbody</Name>
          <Description>New body text</Description>
          <Type>string</Type>
        </Param>
      </Params>
    </Method>
    <Method>
      <Name>get</Name>
      <Description>Get an item based on Name or Id</Description>
      <Example> 
        <![CDATA[
<script engine="kscript">
     
   var view = k.site.views.get("viewname"); 
  
</script> 
	]]>
      </Example>
      <Params>
        <Param>
          <Name>nameOrId</Name>
          <Description>nameOrId</Description>
          <Type>object</Type>
        </Param>
      </Params>
      <ReturnType>SiteObject</ReturnType>
    </Method>


    <Method>
      <Name>update</Name>
      <Description>update the text object</Description>
      <Example>
        <![CDATA[
<script engine="kscript">
     
    var view = k.site.views.get("viewname"); 
    view.body = "new body"; 
    k.site.views.update(view);   
    
</script> 
	]]> 
      </Example>
      <Params>
        <Param>
          <Name>siteObject</Name>
          <Description>Update the SiteOject property values</Description>
          <Type>SiteObject</Type>
        </Param>
      </Params> 
    </Method>  
    
    <Method>
      <Name>delete</Name>
      <Description>Delete an item</Description>
      <Example>
        <![CDATA[
<script engine="kscript"> 

    var view = k.site.views.get("viewname"); 
   
    k.site.views.delete(view.id);   
    
</script> 
	]]>

      </Example>
      <Params>
        <Param>
          <Name>nameOrId</Name>
          <Description>nameOrId</Description>
          <Type>object</Type>
        </Param>
      </Params> 
    </Method>



    <Method>
      <Name>add</Name>
      <Description>add an item</Description>
      <Example>
        <![CDATA[
<script engine="kscript">
  var view = {};
  view.name = "newview";
  view.body = "new view body";
  k.site.views.add(view);
</script>
	]]>

      </Example>
      <Params>
        <Param>
          <Name>object</Name>
          <Description>The SiteOject values</Description>
          <Type>object</Type>
        </Param>
      </Params>
    </Method>
    
    
    
  </Methods>
</KScriptSetting>


