Conjunto de mudanças 1114 no repositório publico


Ignorar:
Timestamp:
01/11/2005 15:31:20 (13 anos atrás)
Autor:
rafahelabazzanella
Mensagem:

Tirado PloneMaintenance? como dependencia, setado ZopeScheduler? e scripts na raiz do site

Localização:
ILPortalCasas/trunk
Arquivos:
4 editados

Legenda:

Não Modificado
Adicionado
Removido
  • ILPortalCasas/trunk/Extensions/AppInstall.py

    r1071 r1114  
    22from Products.CMFPlone.utils import _createObjectByType
    33from Products.ExternalMethod.ExternalMethod import manage_addExternalMethod
    4 from Products.PloneMaintenance.MaintenanceTask import addMaintenanceTask
    54from Products.ILPortalCasas.config import *
    65from Acquisition import aq_base
    7 
    86import sys, os
    97
     
    2523'''
    2624
    27 SAAP = '''<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
    28       lang="en"
    29       i18n:domain="plone">
    30 <script language="JavaScript1.2">
    31     function poponload() {
    32         openwindow = window.open("http://saapdemo.interlegis.gov.br/saap/index_saap_html", "saap", "location=0, status=1, scrollbars=0, width=750, height=600");
    33         openwindow.moveTo(200,200);
    34     }
    35 </script>
    36 <body onload="javascript: poponload()">
    37     <p>Sera aberta uma janela com o sistema. Se esta nao for aberta, clique <a href="javascript:poponload()">aqui</a>.</p>
    38     <p>Se vc clicar no link acima e nao for aberta a janela, va no menu do seu browser e desabilite a opcao "Bloquear janelas popup".</p>
    39 
    40 </body>
    41 </html>
    42 
    43 '''
    44 
    4525ARQUIVO = '''[channels]
    4626zopept=1h:http://rss.groups.yahoo.com/group/zope-pt/rss
     
    5030'''
    5131
    52 def install(self,reinstall=0):
     32def install(self):
    5333    portal = self
    5434    setupWorkflow(portal)
     
    8363    setupCssmanager(portal)
    8464    setupGroups(portal)
    85     setupMaintenance(portal)
     65    setupScriptsBackup(portal)
    8666    setupMemberdata(portal)
    8767#    setupMembership(portal)
     
    9878    setupTipo(portal)
    9979    addBackup(portal)
     80    addScheduler(portal)
    10081
    10182def setupWorkflow(portal):
     
    441422    portal.invokeFactory('Folder', id='saap', title='SAAP', excludeFromNav=1)
    442423    saap = getattr(portal, 'saap', None)
    443     saap.manage_addProduct['PageTemplates'].manage_addPageTemplate('index_html', '', SAAP)
     424    saap.invokeFactory('DisplayPage', id='index_html', title='SAAP', remote_url='http://saapdemo.interlegis.gov.br/saap/index_saap_html')
    444425
    445426def addSaal(portal):
     
    536517    portal_groups.toggleGroupWorkspacesCreation()
    537518
    538 def setupMaintenance(portal):
    539     portal_maintenance = getToolByName(portal, 'portal_maintenance')
    540 
    541     pm_scripts = portal_maintenance.scripts
    542     manage_addExternalMethod(pm_scripts,'backupFile',
    543                              'Backup zope.conf e products',
    544                              PROJECTNAME+'.BackupPortalModelo',
    545                              'backupFile')
    546 
    547     manage_addExternalMethod(pm_scripts,'moveBackup',
    548                              'Move Data.fs.old',
    549                              PROJECTNAME+'.BackupPortalModelo',
    550                              'moveBackup')
    551 
    552     portal_maintenance.tasks.manage_addProduct['PloneMaintenance'].addMaintenanceTask('um')
    553     subscription_task = portal_maintenance.tasks
    554     subscription_task.um._updateProperty('title', 'Pack Data.fs')
    555     subscription_task.um._updateProperty('script_name', 'packDB')
    556 
    557     portal_maintenance.tasks.manage_addProduct['PloneMaintenance'].addMaintenanceTask('tres')
    558     subscription_task = portal_maintenance.tasks
    559     subscription_task.tres._updateProperty('title', 'Backup zope.conf and Products')
    560     subscription_task.tres._updateProperty('script_name', 'backupFiles')
    561 
    562     portal_maintenance.tasks.manage_addProduct['PloneMaintenance'].addMaintenanceTask('quatro')
    563     subscription_task = portal_maintenance.tasks
    564     subscription_task.quatro._updateProperty('title', 'Move Data.fs.old')
    565     subscription_task.quatro._updateProperty('script_name', 'moveBackup')
    566 
     519def setupScriptsBackup(portal):
     520    portal.manage_addProduct['OFSP'].manage_addFolder('scripts_backup')
     521    scripts_backup = getattr(portal, 'scripts_backup', None)
     522    scripts_backup.manage_addProduct['ExternalMethod'].manage_addExternalMethod('backupFile','Backup zope.conf e products', PROJECTNAME+'.BackupPortalModelo', 'backupFile')
     523    scripts_backup.manage_addProduct['ExternalMethod'].manage_addExternalMethod('packDB','Pack Data.fs', PROJECTNAME+'.BackupPortalModelo', 'packDB')
     524    scripts_backup.manage_addProduct['ExternalMethod'].manage_addExternalMethod('moveBackup','Move Data.fs para iretorio backup', PROJECTNAME+'.BackupPortalModelo', 'moveBackup')
    567525
    568526def setupMemberdata(portal):
     
    701659    os.system('mkdir backup')
    702660
     661def addScheduler(portal):
     662    portal.manage_addProduct['ZopeScheduler'].manage_addZopeScheduler()
     663    zope_scheduler = getattr(portal, 'zope_scheduler', None)
     664    zope_scheduler.manage_addTask('scripts_backup/packDB', ('0',), ('8',), ('2,3,4,5'), [3,4,5,6,], ('11',))
     665    zope_scheduler.manage_addTask('scripts_backup/moveBackup', ('40',), ('8',), ('2,3,4,5'), [3,4,5,6,], ('11',))
     666    zope_scheduler.manage_addTask('scripts_backup/backupFile', ('20',), ('8',), ('2,3,4,5'), [3,4,5,6,], ('11',))
     667
     668#Seg=1 Terca=2 Quarta=3 Quinta=4 Sexta=5 Sabado=6 Domingo=7
     669
    703670
    704671
  • ILPortalCasas/trunk/Extensions/BackupPortalModelo.py

    r1036 r1114  
    22from StringIO import StringIO
    33from os import listdir, sys
     4
     5
     6############################################################
     7#   Faz o pack do Data.fs                                  #
     8############################################################
     9
     10def packDB(self, dbname='main', days=0):
     11
     12    out = StringIO()
     13
     14    dbs = self.Control_Panel.Database
     15    if dbname in dbs.getDatabaseNames():
     16        try:
     17            dbs[dbname].manage_pack(days=days)
     18        except:
     19            # FIXME - Add exception handling
     20            pass
     21        print >> out, "Zope database '%s' has been packed" % dbname
     22
     23    return out.getvalue()
    424
    525
     
    3050    # faz copia do etc/zope.conf para o diretorio backup na raiz da instancia
    3151    os.system('cp %s %s' % (ZOPE_CONF, BKP_ZOPE_CONF))
    32     return 'Listado conteudo do diretorio Products no arquivo backup.txt e copiado etc/zope.conf para diretorio backup'
     52    print >> out, "Listado conteudo do diretorio Products no arquivo backup.txt e copiado etc/zope.conf para diretorio backup"
    3353   
    3454
     
    3858
    3959def moveBackup(self):
     60    out = StringIO()
     61
    4062    DATA_OLD = INSTANCE_HOME+'/var/Data.fs.old'
    4163    BKP = INSTANCE_HOME+'/backup'
     
    4668        os.system('mv %s.gz %s' % (DATA_OLD, BKP_DATA))
    4769        os.system('mv %s %s' % (BKP_DATA, BKP))
    48         return 'Compactado Data.fs.old, renomeado e movido para o diretorio backup'
     70        print >> out, "Compactado Data.fs.old, renomeado e movido para o diretorio backup"
    4971
    5072    else:
    51         return 'Arquivo Data.fs.old nao existe. Gere o arquivo, dando pack no Data.fs e rode a rotina novamente.'
     73        print >> out, "Arquivo Data.fs.old nao existe. Gere o arquivo, dando pack no Data.fs e rode a rotina novamente."
    5274
  • ILPortalCasas/trunk/config.py

    r1048 r1114  
    2222
    2323##code-section config-bottom #fill in your manual code here
    24 DEPENDENCIES = ['Archetypes','Ploneboard','CMFDisplayPage','CMFPublicator','CMFSin','CalendarX','CSSManager','PloneGazette','PloneWebMail','PloneMaintenance','PlonePopoll','PloneOmbudsman']
     24DEPENDENCIES = ['Archetypes','Ploneboard','CMFDisplayPage','CMFPublicator','CMFSin','CalendarX','CSSManager','PloneGazette','PloneWebMail','PlonePopoll','PloneOmbudsman']
    2525##/code-section config-bottom
    2626
Note: Veja TracChangeset para ajuda no uso do visualizador de conjunto de mudanças.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.