adding action to startup schema view. this action enables to 894685124c68
authorLaure Bourgois <Laure.Bourgois@logilab.fr>
Thu, 02 Apr 2009 15:19:43 +0200
branch894685124c68
changeset 1213 06789a89f91f
parent 1200 0d12d4371d11
child 1214 25480a710422
adding action to startup schema view. this action enables to download owl view
web/views/actions.py
--- a/web/views/actions.py	Wed Apr 01 17:26:36 2009 +0200
+++ b/web/views/actions.py	Thu Apr 02 15:19:43 2009 +0200
@@ -8,7 +8,7 @@
 
 from cubicweb.common.selectors import (searchstate_accept, match_user_group, yes,
                                        one_line_rset, two_lines_rset, one_etype_rset,
-                                       authenticated_user,
+                                       authenticated_user, none_rset,
                                        match_search_state, chainfirst, chainall)
 
 from cubicweb.web.action import Action, EntityAction,  LinkToEntityAction
@@ -82,7 +82,6 @@
 class ModifyAction(EntityAction):
     category = 'mainactions'
     __selectors__ = (one_line_rset, searchstate_accept)
-    #__selectors__ = searchstate_accept,
     schema_action = 'update'
     order = 10
     
@@ -314,3 +313,14 @@
         login = self.rset.get_entity(self.row or 0, self.col or 0).login
         return self.build_url('euser/%s'%login, vid='epropertiesform')
 
+# schema view action
+
+class DownloadOWLSchemaAction(Action):
+    category = 'mainactions'
+    id = 'download_as_owl'
+    title = _('download schema as owl')
+    __selectors__ = none_rset,
+   
+    def url(self):
+        return self.build_url('view', vid='owl')
+