close

  
<div><p>   
  <p>
      By default PropBox returns the first 10 topic property values. This returns all values.
    </p>
  <p>
      Returns the add form for the specified topic property.
    </p>
  <p>
      Simple authentication check before enabling editing (sort/remove) for the specified topic property.
    </p>
  <p>
      Return the PropBox content for the specified topic property.  
    </p>
  <p>
      Remove a topic property value. Depending on the nature of the property, value can be a literal value or a topic id.
    </p>
    <p>
      Example: Remove triple <code>&lt;/en/test_insance&gt; &lt;/user/daepark/default_domain/test_type/topic&gt; &lt;/en/blade_runner&gt;</code>
    </p>
<pre class="code"></pre>  
    <p>
      Example: Remove triple <code>&lt;/en/test_insance&gt; &lt;/user/daepark/default_domain/test_type/date&gt; &lt;2009-12-02&gt;</code>
    </p>      
<pre class="code"></pre>
  <p>
      Sort topic property values.
      To sort, MQL requires all the preceding values to be specified up to the item being sorted.
      The value param should be an array of these topic property values to be sorted.
    </p>
    <p>
      Example: Sort [/en/blade_runner, /en/bob_dylan]
    </p>      
<pre class="code"></pre>
  <p>
    </p>
  <p>
    </p>
  <p>
    </p>
  <p>
    </p>
  <p>
    </p>
  </p>
    
    ${c.style('http://default.freebaseapps.com/default_style')}
    ${c.style('propbox.css?_=' + time)}
    ${jq.jquery()}
    
    ${c.script('propbox.js?_=' + time)}
    <div id="header">
      ${t.signin()}
      <h1>$title</h1>
    </div>
    
    <div id="body">

      <div id="toc">
        <h2>Contents</h2>
        <ul id="toc-1"><li><a href="#desc">Description</a></li>
          <li><a href="#usage">Usage</a></li>
          <li><a href="#examples">Examples</a></li>
          <li><a href="#recipes">Recipes</a></li>
          <li><a href="#services">Services</a>
            <ul><li><a href="#%24%7Bservice%7D">/acre/form/propbox/${service}</a></li>
                </ul></li>
        </ul></div>
      
      <div class="section">
        <a name="desc"></a>
        <h2>Description</h2>
        <p>
          PropBox handles the various nuances of viewing AND editing different types of properties
          (depending on their expected types: CVTs, images, unique properties, addresses, datetime, numbers, etc.)
          along with proper formatting (for viewing) and validation (when editing).
        </p>
        <p>
          PropBox is not only a client-side library, it hosts a variety of services for reading and writing property values.
          These JSON(P) services are available to all acre apps through a special entry point/alias the acreteam has setup under <code>/acre/form/propbox</code>.
          For example, <a href="/acre/form/propbox/propbox?id=/en/blade_runner&amp;pid=/film/film/starring"><code>/acre/form/propbox/propbox</code></a> can be invoked within any acre app.
        </p>
      </div>
      
      <div class="section">
        <a name="usage"></a>
        <h2>Usage:</h2>
        In you acre template:
<pre class="code">
      
    $${c.propbox(id, pid)}    
    

]]&gt;</pre>
      </div>
      
      <div class="section">
        <a name="examples"></a>
        <h2>Examples:</h2>         
        <hr class="space"><a name="%24%7Bprop.name%7D"></a>
          ${c.propbox("/en/test_instance", prop.id)}
        </div>

      
      <div class="section">
        <a name="recipes"></a>
        <h2>Recipes:</h2>         

        <p>
          By default, topics link to http://www.freebase.com/view/<i>topic_id</i>.
          To override, create a server-side script called "helpers" with a function called "url_for".
        </p>
<pre class="code"></pre>            
        
        <p>
          Here is an alternative <a href="/view">topic view</a>:
          <a href="http://acre.freebase.com//#app=/user/daepark/propbox&amp;file=view">view the source</a>
        </p>

      </div>

                
      <div class="section">
        <a name="services"></a>
        <h2>PropBox services:</h2>         
        <p>All services return JSON results in the form</p>
<pre class="code"></pre>          
        
        <p>
          Or if authentication is required, an http status code of 401 is returned:
        </p>
<pre class="code"></pre>     
        
        
        <hr class="space"><a name="%24service"></a>
            <h3>$name</h3>
            <table class="params"><tr><td class="label">Accessible via:</td>
                <td>$name</td>
              </tr><tr><td class="label">Permits HTTP GET:</td>
                <td>$get</td>
              </tr><tr><td class="label">Permits HTTP POST:</td>
                <td>$post</td>
              </tr><tr><td class="label">Login required:</td>
                <td>$auth</td>
              </tr><tr><td class="label">Arguments:</td>
                <td>
                  <table class="args"><tr><th>name</th>
                      <th>required</th>
                    </tr><tr><td>$arg</td>
                      <td>Yes</td>
                    </tr><tr><td>$arg</td>
                      <td>No</td>
                    </tr></table></td>
              </tr></table>
              ${exports[service]()}
            </div>          
          
    </div>    
    
    
    <div id="footer">
      
      ${attribution.blanket()}
    </div>
  
</div>

Comments

Hide