MMBase

Generic event handler to execute some SQL immediately after datasource is up.

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.5
  • Component/s: Core
  • Description:
    This could be used to make some alter tables, if that may be needed (e.g. if a field was added).

Activity

Repository Revision Date User Message
MMBase SVN #43447 Fri Sep 24 17:17:18 CEST 2010 michiel MMB-1985
Files Changed
ADD /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/util/SqlExecutor.java
Repository Revision Date User Message
MMBase SVN #43449 Fri Sep 24 17:18:43 CEST 2010 michiel MMB-1985
Files Changed
ADD /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/core/event/SqlExecutorListener.java
Michiel Meeuwissen made changes - 2010-09-24 17:18
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Hide
Michiel Meeuwissen added a comment - 2010-09-24 17:19
E.g. place a file WEB-INF/config/eventmanager.xml

with the following
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE eventmanager PUBLIC "-//MMBase//DTD eventmanager config 1.0//EN" "http://www.mmbase.org/dtd/eventmanager_1_0.dtd">
<!--
    This config file allows you to configure what event brokers will be loaded
when mmbase starts up. For more information on event brokers read the apidoc
for org.mmbase.core.event.EventBroker.

-->
<eventmanager>
<listeners>
    <listener class="org.mmbase.core.event.SqlExecutorListener">
      <param name="update">alter table $PREFIX_images add height integer</param>
      <param name="ignoreException">.*already exists.*</param>
    </listener>
    <listener class="org.mmbase.core.event.SqlExecutorListener">
      <param name="update">alter table $PREFIX_images add width integer</param>
      <param name="ignoreException">.*already exists.*</param>
    </listener>
    <listener class="org.mmbase.core.event.SqlExecutorListener">
      <param name="update">alter table $PREFIX_icaches add height integer</param>
      <param name="ignoreException">.*already exists.*</param>
    </listener>
    <listener class="org.mmbase.core.event.SqlExecutorListener">
      <param name="update">alter table $PREFIX_icaches add width integer</param>
      <param name="ignoreException">.*already exists.*</param>
    </listener>
    <listener class="org.mmbase.core.event.SqlExecutorListener">
      <param name="update">alter table $PREFIX_icaches add itype integer</param>
      <param name="ignoreException">.*already exists.*</param>
    </listener>
    <listener class="org.mmbase.core.event.SqlExecutorListener">
      <param name="update">alter table $PREFIX_mmbaseusers add itype integer</param>
      <param name="ignoreException">.*already exists.*</param>
    </listener>
  </listeners>
</eventmanager>
Show
Michiel Meeuwissen added a comment - 2010-09-24 17:19 E.g. place a file WEB-INF/config/eventmanager.xml with the following <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE eventmanager PUBLIC "-//MMBase//DTD eventmanager config 1.0//EN" "http://www.mmbase.org/dtd/eventmanager_1_0.dtd"> <!--     This config file allows you to configure what event brokers will be loaded when mmbase starts up. For more information on event brokers read the apidoc for org.mmbase.core.event.EventBroker. --> <eventmanager> <listeners>     <listener class="org.mmbase.core.event.SqlExecutorListener">       <param name="update">alter table $PREFIX_images add height integer</param>       <param name="ignoreException">.*already exists.*</param>     </listener>     <listener class="org.mmbase.core.event.SqlExecutorListener">       <param name="update">alter table $PREFIX_images add width integer</param>       <param name="ignoreException">.*already exists.*</param>     </listener>     <listener class="org.mmbase.core.event.SqlExecutorListener">       <param name="update">alter table $PREFIX_icaches add height integer</param>       <param name="ignoreException">.*already exists.*</param>     </listener>     <listener class="org.mmbase.core.event.SqlExecutorListener">       <param name="update">alter table $PREFIX_icaches add width integer</param>       <param name="ignoreException">.*already exists.*</param>     </listener>     <listener class="org.mmbase.core.event.SqlExecutorListener">       <param name="update">alter table $PREFIX_icaches add itype integer</param>       <param name="ignoreException">.*already exists.*</param>     </listener>     <listener class="org.mmbase.core.event.SqlExecutorListener">       <param name="update">alter table $PREFIX_mmbaseusers add itype integer</param>       <param name="ignoreException">.*already exists.*</param>     </listener>   </listeners> </eventmanager>
Repository Revision Date User Message
MMBase SVN #43457 Fri Sep 24 17:33:28 CEST 2010 michiel MMB-1985
Files Changed
ADD /mmbase/trunk/utils/src/main/java/org/mmbase/util/SqlExecutor.java (from /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/util/SqlExecutor.java)
Repository Revision Date User Message
MMBase SVN #43459 Fri Sep 24 17:35:44 CEST 2010 michiel MMB-1985
Files Changed
MODIFY /mmbase/trunk/utils/src/main/java/org/mmbase/core/event/SystemEvent.java
MODIFY /mmbase/trunk/utils/src/main/java/org/mmbase/core/event
ADD /mmbase/trunk/utils/src/main/java/org/mmbase/core/event/SqlExecutorListener.java (from /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/core/event/SqlExecutorListener.java)
Repository Revision Date User Message
MMBase SVN #43471 Mon Sep 27 16:33:07 CEST 2010 michiel MMB-1985
Files Changed
MODIFY /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/util/xml/ParentBuilderReader.java
MODIFY /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/util/xml/BuilderReader.java
ADD /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/util/xml/applicationdata/SqlExecutor.java
MODIFY /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/util/xml/AbstractBuilderReader.java
MODIFY /mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/util/SqlExecutor.java

People

Dates

  • Created:
    2010-09-24 17:12
    Updated:
    2010-09-24 17:19
    Resolved:
    2010-09-24 17:18