Changeset 1377

Show
Ignore:
Timestamp:
09/02/08 16:54:23 (3 months ago)
Author:
sgillies
Message:

Add workspace collection type and management form

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pleiades.workspace/trunk/pleiades/workspace/browser/configure.zcml

    r1373 r1377  
    1616    image="workspace_icon.gif" 
    1717    /> 
    18          
     18 
     19  <browser:resource 
     20    name="collection_icon.gif" 
     21    image="collection_icon.gif" 
     22    /> 
     23 
    1924  <browser:page 
    2025    for="..interfaces.IWorkspace" 
     
    6065    /> 
    6166 
    62   <!--browser:page 
    63     for="..interfaces.IWorkspace
    64     name="import-xml-form" 
    65     class=".xml.XMLImportForm" 
    66     permission="zope2.View
    67     /--
     67  <browser:page 
     68    for="..interfaces.IWorkspaceCollection
     69    name="manage-collection-form" 
     70    class=".manage.ManageCollectionForm" 
     71    permission="cmf.ModifyPortalContent
     72    /
    6873 
    6974  <browser:page 
    70     for="Products.PleiadesEntity.content.interfaces.IName
    71     name="manage-workspaces
    72     class=".manage.ManageWorkspaces
    73     permission="cmf.AddPortalContent" 
     75    for="..interfaces.IWorkspaceCollection
     76    name="manage-collection
     77    class=".manage.ManageCollection
     78    permission="cmf.ModifyPortalContent" 
    7479    /> 
    7580 
  • pleiades.workspace/trunk/pleiades/workspace/browser/import_kml_form.pt

    r1289 r1377  
    99 
    1010<metal:main fill-slot="main"> 
    11     <tal:main-macro metal:define-macro="main" 
    12            tal:define="text context/text;"> 
     11  <tal:main-macro 
     12    metal:define-macro="main" 
     13    tal:define="text context/text;" 
     14    > 
    1315 
    14         <form action="import-kml" enctype="multipart/form-data" method="post"> 
    15           <p>KML File: <input name="file" type="file"/></p> 
    16           <p><input name="submit" type="submit" value="Import"/></p> 
    17         </form> 
     16    <div tal:replace="structure provider:plone.abovecontenttitle" /> 
     17 
     18    <h1 class="documentFirstHeading">Upload Data From KML</h1> 
     19 
     20    <!--div class="documentDescription"> 
     21      <span 
     22        metal:use-macro="python:context.widget('description', mode='view')" 
     23        /> 
     24    </div--> 
     25 
     26    <!--div tal:replace="structure provider:plone.abovecontentbody" /--> 
     27 
     28    <p>Select an uncompressed KML document (.kml) from your filesystem and post 
     29    it using the form below. One feature and one place will be created for each 
     30    placemark element in the document; one name will be created for each 
     31    placemark title; one location will be created for each geometry. 
     32    </p> 
     33 
     34    <form  
     35      action="import-kml" 
     36      enctype="multipart/form-data" 
     37      method="post" 
     38      > 
     39      <p>KML File: <input name="file" type="file"/></p> 
     40      <p><input name="submit" type="submit" value="Upload"/></p> 
     41    </form> 
    1842     
    19     </tal:main-macro> 
     43  </tal:main-macro> 
    2044</metal:main> 
    2145 
  • pleiades.workspace/trunk/pleiades/workspace/browser/kml.py

    r1374 r1377  
    6767 
    6868        transaction.commit() 
    69         return "Success" 
     69         
     70        # Redirect to the workspace 
     71        response.setStatus(201) 
     72        response.setHeader( 
     73            'Location',  
     74            '%s/drafting' % self.context.absolute_url() 
     75            ) 
     76        response.redirect('%s/drafting' % self.context.absolute_url()) 
    7077 
    7178 
  • pleiades.workspace/trunk/pleiades/workspace/browser/workspace.css

    r1374 r1377  
    1 table { 
     1div.ws-dashboard { 
     2  border: solid orange 1px; 
     3  padding: 1em; 
     4  } 
     5 
     6table.ws-dashboard { 
    27  text-align: left; 
    38  border-spacing: 1em; 
    4 
     9 
    510 
  • pleiades.workspace/trunk/pleiades/workspace/browser/workspace.pt

    r1374 r1377  
    3434        <div tal:replace="structure provider:plone.abovecontentbody" /> 
    3535 
    36         <p tal:condition="python: not text and is_editable" 
    37            i18n:translate="no_body_text" 
    38            class="discreet"> 
    39             This item does not have any body text, click the edit tab to change it. 
    40         </p> 
     36        <div class="ws-dashboard"> 
     37          <p>Current status of data by type is shown in the table below. Count of items in each collection is shown in a link. Alternate representations of the data collections appear in square brackets.</p> 
     38          <table class="ws-dashboard"> 
     39            <tr> 
     40              <th>Type/Status</th> 
     41              <th>Drafting</th> 
     42              <th>Pending</th> 
     43              <th>Published</th> 
     44              <th>All</th> 
     45            </tr> 
     46            <tr tal:repeat="tname python:['locations', 'names', 'features', 'places']"> 
     47              <tal:row tal:define="row python:view.collections_data()[tname]"> 
     48              <th tal:content="python:tname.capitalize()">NAME</th> 
     49              <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published', 'all')]"> 
     50                <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a>,&nbsp;<a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 
     51              </td> 
     52              </tal:row> 
     53            </tr> 
     54            <tr tal:define="row python:view.collections_data()['all']"> 
     55              <th>All</th> 
     56              <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published')]"> 
     57                <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a>&nbsp; 
     58                <a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 
     59              </td> 
     60            </tr> 
     61          </table> 
     62        </div> 
    4163 
    42         <div tal:condition="text" metal:use-macro="python:context.widget('text', mode='view')" /> 
    43          
    44         <tal:collections> 
    45             <h2 i18n:translate="title_workspace_collections">Data Dashboard</h2> 
    46             <table class="workspace-dashboard"> 
    47               <tr> 
    48                 <th>Type</th> 
    49                 <th>Drafting</th> 
    50                 <th>Pending</th> 
    51                 <th>Published</th> 
    52                 <th>All</th> 
    53               </tr> 
    54               <tr tal:repeat="tname python:['locations', 'names', 'features', 'places']"> 
    55                 <tal:row tal:define="row python:view.collections_data[tname]"> 
    56                 <th tal:content="python:tname.capitalize()">NAME</th> 
    57                 <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published', 'all')]"> 
    58                   <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a>,&nbsp;<a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 
    59                 </td> 
    60                 </tal:row> 
    61               </tr> 
    62               <tr tal:define="row python:view.collections_data['all']"> 
    63                 <th>All</th> 
    64                 <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published')]"> 
    65                   <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a>&nbsp; 
    66                   <a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 
    67                 </td> 
    68               </tr> 
    69             </table> 
    70         </tal:collections> 
    71          
     64        <h3>Importing Data</h3> 
     65        <p>New data can be created by <a href="@@import-kml-form">posting a KML file</a> or by <a href="@@import-xml-form">importing a Pleiades XML file</a>.</p> 
     66 
    7267        <div metal:use-macro="context/document_relateditems/macros/relatedItems"> 
    7368            show related items if they exist 
  • pleiades.workspace/trunk/pleiades/workspace/content/workspace.py

    r1374 r1377  
    3131    implements(IWorkspaceCollection) 
    3232    portal_type = "Workspace Collection" 
     33 
     34    @property 
     35    def members(self): 
     36        for brain in self.queryCatalog(): 
     37            yield brain.getObject() 
    3338 
    3439 
  • pleiades.workspace/trunk/pleiades/workspace/interfaces.py

    r1374 r1377  
    1414 
    1515    contains('pleiades.workspace.interfaces.IWorkspaceCollection') 
     16 
     17    members = Attribute("""Iterator over members of the collection.""") 
    1618 
    1719 
  • pleiades.workspace/trunk/pleiades/workspace/profiles/default/types/Workspace_Folder.xml

    r1327 r1377  
    1010    i18n:translate="" 
    1111    >A folder for content development workspaces</property> 
    12   <!--property name="content_icon">++resource++workspace_icon.gif</property--
     12  <property name="content_icon">++resource++workspace_icon.gif</property
    1313  <property name="content_meta_type">Workspace Folder</property> 
    1414  <property name="product">pleiades.workspace</property> 
    1515  <property name="factory">addWorkspaceFolder</property> 
    16   <property name="immediate_view">atct_edit</property> 
     16  <property name="immediate_view">folder_listing</property> 
    1717  <property name="global_allow">False</property> 
    1818  <property name="filter_content_types">True</property> 
    1919  <property name="allowed_content_types"> 
    2020    <element value="Workspace" /> 
    21     <element value="Document" /> 
    2221  </property> 
    2322  <property name="allow_discussion">False</property> 
    24   <property name="default_view">view</property> 
     23  <property name="default_view">folder_listing</property> 
    2524  <property name="view_methods"> 
    26     <element value="view"/> 
    2725    <element value="folder_summary_view"/> 
    2826    <element value="folder_tabular_view"/> 
     27    <element value="atct_album_view"/> 
    2928    <element value="folder_listing"/> 
    30   </property> 
     29  </property> 
    3130  <alias from="(Default)" to="(dynamic view)"/> 
    3231  <alias from="edit" to="atct_edit"/>