Changeset 53


Ignore:
Timestamp:
01/11/06 12:31:57 (14 years ago)
Author:
meelis
Message:

renaming activities to stories

Location:
trunk
Files:
2 added
4 deleted
4 edited
6 moved

Legend:

Unmodified
Added
Removed
  • trunk/Story.py

    r52 r53  
    3030)) 
    3131 
    32 class Activity(BaseContent): 
     32class Story(BaseContent): 
    3333    schema = schema 
    3434    actions= ( 
     
    3636    'id':'view', 
    3737    'name':'view', 
    38     'action':'string:${object_url}/activity_view', 
     38    'action':'string:${object_url}/story_view', 
    3939    'premission':('View',), 
    4040    }, 
     
    4242    'id':'edit', 
    4343    'name':'Edit', 
    44     'action':'string:${object_url}/activity_edit', 
     44    'action':'string:${object_url}/story_edit', 
    4545    'premission':('View',), 
    4646    }, 
    4747    ) 
    48     meta_type = "Activity" 
    49     archetype_name = "Activity"   
     48    meta_type = "Story" 
     49    archetype_name = "Story"   
    5050    global_allow = 1 
    5151     
     
    5959    authorObject = self.portal_membership.getMemberById(authorInfo) 
    6060    authorName = getattr(authorObject, 'fullname') 
    61     if authorName: 
     61    if authorName != None: 
    6262        return authorName 
    6363        else: 
    64         return authorObject 
     64        return str(authorObject) 
    6565     
    6666    def getLink(self): 
     
    9494        self._p_changed = 1 
    9595 
    96 registerType(Activity, PROJECTNAME) 
     96registerType(Story, PROJECTNAME) 
  • trunk/ToolboxSearchTool.py

    r48 r53  
    66from AccessControl import ClassSecurityInfo 
    77from Products.CMFCore.utils import getToolByName 
     8from ZODB.PersistentMapping import PersistentMapping 
    89import xmlrpclib 
    910from Acquisition import aq_base 
     
    1718    security = ClassSecurityInfo() 
    1819    plone_tool = 1 
     20    __allow_access_to_unprotected_subobjects__ = 1 
    1921 
    2022    def manage_afterAdd(self, item, container): 
    21         self._setProperty('remote_toolboxes', [], 'lines') 
     23        self._setProperty('enable_remotesearch', True, 'boolean') 
     24        self.remote_toolboxes = {} 
    2225 
    2326    def toolbox_search(self, REQUEST, **kw): 
     
    4346        results = [] 
    4447        local = self.local_search(REQUEST, **kw) 
    45         remote = self.remote_search(REQUEST, **kw) 
     48        remote = [] 
     49        if self.enable_remotesearch: 
     50            remote = self.remote_search(REQUEST, **kw) 
    4651        for x in local: 
    4752            results.append(x) 
     
    6469        """ 
    6570        # get remote toolbox address from somewhere 
    66         tb_locations = self.get_remote_toolboxes() 
     71        tb_locations = self.get_urls_of_remote_toolboxes() 
    6772        result = [] 
    6873        if tb_locations is None: 
     
    117122        return results 
    118123 
    119     security.declarePrivate('get_remote_toolboxes') 
     124    def get_urls_of_remote_toolboxes(self): 
     125        """ get remote toolbox locations. ie. ('http://localhost:9090/SecondToolBox',) """ 
     126        result = [] 
     127        for x in self.remote_toolboxes.values(): 
     128            print x 
     129            result.append(x['URL']) 
     130        return result 
     131 
    120132    def get_remote_toolboxes(self): 
    121         """ get remote toolbox locations. ie. ('http://localhost:9090/SecondToolBox',) """ 
    122         result = self.getProperty('remote_toolboxes') 
    123         return result 
     133        return self.remote_toolboxes 
    124134 
    125135    def ping(self, address): 
     
    139149 
    140150    security.declareProtected(MANAGE_PORTAL, 'manage_changeLocations') 
    141     def manage_setLocations(self, locations): 
    142         """ set remote search locations and protocols """ 
     151    def setNewLocation(self, location): 
     152        """ set remote search location and protocol """ 
     153        import time  
     154        timestamp = time.time() 
     155        while self.remote_toolboxes.has_key(str(int(timestamp))): 
     156            timestamp = time.time() 
     157        timestamp = str(int(timestamp)) 
     158        self.remote_toolboxes[timestamp] = {'URL': location, 'protocol': 'xmlrpc'} 
     159        self._p_changed = True 
    143160        return 0 
    144161 
     162    def setEnableRemoteSearch(self, enable): 
     163        self.enable_remotesearch = enable 
     164 
    145165InitializeClass(ToolboxSearchTool) 
  • trunk/__init__.py

    r47 r53  
    1616import Module 
    1717import SyndicatedFolder 
    18 import Activity 
     18import Story 
    1919 
    2020# Our own portal tools 
  • trunk/skins/toolbox/find_related_stories.py

    r52 r53  
    1 ## Script (Python) "find_related_activities.py" 
     1## Script (Python) "find_related_stories.py" 
    22##bind container=container 
    33##bind context=context 
     
    66##bind subpath=traverse_subpath 
    77##parameters= 
    8 ##title=Finds all related activities 
     8##title=Finds all related stories 
    99from Products.CMFCore.utils import getToolByName 
    1010keywords = context.Subject() 
     
    1616keys = keys[:-4] 
    1717query_string = {'SearchableText': {'operator': 'or', 'query': keys}, 
    18     'sort_on' : 'Date', 'sort_order' : 'descending', 'meta_type' : {'query' : 'Activity'}} 
     18    'sort_on' : 'Date', 'sort_order' : 'descending', 'meta_type' : {'query' : 'Story'}} 
    1919pcatalog = getToolByName(context, 'portal_catalog') 
    2020tmp_results = pcatalog.searchResults(query_string) 
  • trunk/skins/toolbox/related_stories.pt

    r52 r53  
    44<body> 
    55 
    6 <div metal:define-macro="related_activities"> 
    7     <fieldset tal:define="results context/find_related_activities; 
     6    <div metal:define-macro="related_stories"> 
     7        <fieldset tal:define="results context/find_related_stories; 
    88        datetime python:modules['DateTime'].DateTime" tal:condition="results"> 
    99        <legend i18n:translate="">Related Activities</legend> 
  • trunk/skins/toolbox/script_addLink.cpy.metadata

    r47 r53  
    11[actions] 
    2 action.success = redirect_to:string:activity_edit 
    3 action.failure = traverse_to:string:activity_edit 
     2action.success = redirect_to:string:story_edit 
     3action.failure = traverse_to:string:story_edit 
  • trunk/skins/toolbox/script_saveLinks.cpy.metadata

    r47 r53  
    11[actions] 
    2 action.success = redirect_to:string:activity_edit 
    3 action.failure = traverse_to:string:activity_edit 
     2action.success = redirect_to:string:story_edit 
     3action.failure = traverse_to:string:story_edit 
  • trunk/skins/toolbox/story_view.pt

    r52 r53  
    9595        <metal:use_footer use-macro="footer_macro" /> 
    9696 
    97         <div metal:use-macro="here/related_activities/macros/related_activities"> 
     97        <div metal:use-macro="here/related_stories/macros/related_stories"> 
    9898            All related activities 
    9999        </div> 
Note: See TracChangeset for help on using the changeset viewer.