Author: chatellier Date: 2008-08-29 15:20:42 +0000 (Fri, 29 Aug 2008) New Revision: 1047 Removed: trunk/topia2/.jupiter trunk/topia2/.umlproject Modified: trunk/topia2/src/java/org/codelutin/topia/event/TopiaContextListener.java trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java trunk/topia2/src/java/org/codelutin/topia/framework/TopiaFiresSupport.java Log: Add pre and post restore event on migration on TopiaContext Deleted: trunk/topia2/.jupiter =================================================================== --- trunk/topia2/.jupiter 2008-08-28 18:09:46 UTC (rev 1046) +++ trunk/topia2/.jupiter 2008-08-29 15:20:42 UTC (rev 1047) @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Property> - <Review id="DEFAULT"> - <Description>property.default.description</Description> - <Author/> - <CreationDate format="yyyy-MM-dd :: HH:mm:ss:SSS z">1970-01-01 :: 00:00:00:000 GMT-10:00</CreationDate> - <Directory>review</Directory> - <Reviewers/> - <Files/> - <FieldItems> - <FieldItem id="Type" default="item.label.unset"> - <Entry name="item.label.unset" /> - <Entry name="item.type.label.codingStandards" /> - <Entry name="item.type.label.programLogic" /> - <Entry name="item.type.label.optimization" /> - <Entry name="item.type.label.usability" /> - <Entry name="item.type.label.clarity" /> - <Entry name="item.type.label.missing" /> - <Entry name="item.type.label.irrelevant" /> - <Entry name="item.type.label.suggestion" /> - <Entry name="item.type.label.other" /> - </FieldItem> - <FieldItem id="Severity" default="item.label.unset"> - <Entry name="item.label.unset" /> - <Entry name="item.severity.label.critical" /> - <Entry name="item.severity.label.major" /> - <Entry name="item.severity.label.normal" /> - <Entry name="item.severity.label.minor" /> - <Entry name="item.severity.label.trivial" /> - </FieldItem> - <FieldItem id="Resolution" default="item.label.unset"> - <Entry name="item.label.unset" /> - <Entry name="item.resolution.label.validNeedsfixing" /> - <Entry name="item.resolution.label.validFixlater" /> - <Entry name="item.resolution.label.validDuplicate" /> - <Entry name="item.resolution.label.validWontfix" /> - <Entry name="item.resolution.label.invalidWontfix" /> - <Entry name="item.resolution.label.unsureValidity" /> - </FieldItem> - <FieldItem id="Status" default="item.status.label.open"> - <Entry name="item.status.label.open" /> - <Entry name="item.status.label.resolved" /> - <Entry name="item.status.label.closed" /> - <Entry name="item.status.label.reopened" /> - </FieldItem> - </FieldItems> - <Filters> - <Phase name="phase.individual" enabled="true"> - <Filter name="Interval" value="7" enabled="false" /> - <Filter name="Reviewer" value="item.reviewer.label.automatic" enabled="true" /> - <Filter name="Type" value="item.label.unset" enabled="false" /> - <Filter name="Severity" value="item.label.unset" enabled="false" /> - <Filter name="AssignedTo" value="" enabled="false" /> - <Filter name="Resolution" value="item.label.unset" enabled="false" /> - <Filter name="Status" value="item.status.label.open" enabled="false" /> - <Filter name="File" value="" enabled="false" /> - </Phase> - <Phase name="phase.team" enabled="true"> - <Filter name="Interval" value="7" enabled="false" /> - <Filter name="Reviewer" value="" enabled="false" /> - <Filter name="Type" value="item.label.unset" enabled="false" /> - <Filter name="Severity" value="item.label.unset" enabled="false" /> - <Filter name="AssignedTo" value="" enabled="false" /> - <Filter name="Resolution" value="item.label.unset" enabled="true" /> - <Filter name="Status" value="item.status.label.open" enabled="false" /> - <Filter name="File" value="" enabled="false" /> - </Phase> - <Phase name="phase.rework" enabled="true"> - <Filter name="Interval" value="7" enabled="false" /> - <Filter name="Reviewer" value="" enabled="false" /> - <Filter name="Type" value="item.label.unset" enabled="false" /> - <Filter name="Severity" value="item.label.unset" enabled="false" /> - <Filter name="AssignedTo" value="item.reviewer.label.automatic" enabled="true" /> - <Filter name="Resolution" value="item.label.unset" enabled="false" /> - <Filter name="Status" value="item.status.label.open" enabled="true" /> - <Filter name="File" value="" enabled="false" /> - </Phase> - </Filters> - </Review> -</Property> \ No newline at end of file Deleted: trunk/topia2/.umlproject =================================================================== --- trunk/topia2/.umlproject 2008-08-28 18:09:46 UTC (rev 1046) +++ trunk/topia2/.umlproject 2008-08-29 15:20:42 UTC (rev 1047) @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<properties:ProjectDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:properties="properties.xmi" modelDir="model" libraryDir="libraries" profileDir="profiles" templateDir="templates"> - <profiles id="org.eclipse.uml2.resources.BasicProfile" description="Basic Profile" uri="platform:/plugin/org.eclipse.uml2.resources/profiles/Basic.profile.uml2" exported="false" kind="system"/> - <profiles id="org.eclipse.uml2.resources.IntermediateProfile" description="Intermediate Profile" uri="platform:/plugin/org.eclipse.uml2.resources/profiles/Intermediate.profile.uml2" exported="false" kind="system"/> - <profiles id="org.eclipse.uml2.resources.CompleteProfile" description="Complete Profile" uri="platform:/plugin/org.eclipse.uml2.resources/profiles/Complete.profile.uml2" exported="false" kind="system"/> - <profiles id="com.omondo.uml.core.JavaProfile" description="Java Profile" uri="platform:/plugin/com.omondo.uml.core/profiles/Java.profile.uml2" exported="false" kind="system"/> - <profiles id="com.omondo.uml2.core.OmondoProfile" description="Omondo Profile" uri="platform:/plugin/com.omondo.uml.core/profiles/Omondo.profile.uml2" exported="false" kind="system"/> - <profiles id="com.omondo.uml2.core.ArchetypeProfile" description="Archetype Profile" uri="platform:/plugin/com.omondo.uml.core/profiles/Archetype.profile.uml2" exported="false" kind="system"/> -</properties:ProjectDescription> Modified: trunk/topia2/src/java/org/codelutin/topia/event/TopiaContextListener.java =================================================================== --- trunk/topia2/src/java/org/codelutin/topia/event/TopiaContextListener.java 2008-08-28 18:09:46 UTC (rev 1046) +++ trunk/topia2/src/java/org/codelutin/topia/event/TopiaContextListener.java 2008-08-29 15:20:42 UTC (rev 1047) @@ -59,4 +59,16 @@ * @param event event */ public void postUpdateSchema(TopiaContextEvent event); + + /** + * Called after updateSchema call + * @param event event + */ + public void preRestoreSchema(TopiaContextEvent event); + + /** + * Called after updateSchema call + * @param event event + */ + public void postRestoreSchema(TopiaContextEvent event); } Modified: trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java =================================================================== --- trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java 2008-08-28 18:09:46 UTC (rev 1046) +++ trunk/topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java 2008-08-29 15:20:42 UTC (rev 1047) @@ -1057,6 +1057,9 @@ * @see org.codelutin.topia.TopiaContext#restore(java.io.File) */ public void restore(File file) throws TopiaException { + // send event + getFiresSupport().firePreRestoreSchema(this); + checkClosed("Ce contexte a ete ferme, impossible d'effectuer le restore"); String sql = null; try { Modified: trunk/topia2/src/java/org/codelutin/topia/framework/TopiaFiresSupport.java =================================================================== --- trunk/topia2/src/java/org/codelutin/topia/framework/TopiaFiresSupport.java 2008-08-28 18:09:46 UTC (rev 1046) +++ trunk/topia2/src/java/org/codelutin/topia/framework/TopiaFiresSupport.java 2008-08-29 15:20:42 UTC (rev 1047) @@ -637,7 +637,7 @@ } /** - * Notify topia context listeners for create schema post operation + * Notify topia context listeners for create schema pre operation * @param context topia context */ public void firePreUpdateSchema(TopiaContext context) { @@ -671,6 +671,42 @@ } } } + + /** + * Notify topia context listeners for schema restore pre operation + * @param context topia context + */ + public void firePreRestoreSchema(TopiaContext context) { + if (log.isDebugEnabled()) { + log.debug("firePreRestoreSchema"); + } + TopiaContextEvent event = new TopiaContextEvent(context); + for(Iterator<TopiaContextListener> l=topiaContextListeners.iterator(); l.hasNext();) { + try { + l.next().preRestoreSchema(event); + } catch (Exception eee) { + throw new TopiaVetoException(eee); + } + } + } + + /** + * Notify topia context listeners for schema restore post operation + * @param context topia context + */ + public void firePostRestoreSchema(TopiaContext context) { + if (log.isDebugEnabled()) { + log.debug("firePostRestoreSchema"); + } + TopiaContextEvent event = new TopiaContextEvent(context); + for(Iterator<TopiaContextListener> l=topiaContextListeners.iterator(); l.hasNext();) { + try { + l.next().postRestoreSchema(event); + } catch (Exception eee) { + throw new TopiaVetoException(eee); + } + } + } /** * Notify entities listeners for load operation
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org