fixed socket duplication 5.0
authorchris
Tue, 14 Jan 2014 18:07:58 +0100
changeset 4889efa51343ac
parent 47 f8688f6fa1ca
child 49 18a7d7eb1406
fixed socket duplication
fixed remove after run (refresh instance to avoid constraint violation on executions)
colibriweb/src/main/java/com/proclos/colibriweb/session/modules/component/ComponentModule.java
colibriweb/webapp/modules/connection/edit.xhtml
colibriweb/webapp/modules/extract/edit.xhtml
colibriweb/webapp/modules/job/edit.xhtml
colibriweb/webapp/modules/load/edit.xhtml
colibriweb/webapp/modules/transform/edit.xhtml
colibriweb/webapp/modules/transform/elements/functionEditPart.xhtml
     1.1 --- a/colibriweb/src/main/java/com/proclos/colibriweb/session/modules/component/ComponentModule.java	Tue Jan 14 16:05:16 2014 +0100
     1.2 +++ b/colibriweb/src/main/java/com/proclos/colibriweb/session/modules/component/ComponentModule.java	Tue Jan 14 18:07:58 2014 +0100
     1.3 @@ -901,6 +901,7 @@
     1.4  		setDirty();
     1.5  		try {
     1.6  			setInstance((T)instance);
     1.7 +			getEntityManager().refresh(getInstance());
     1.8  			ConfigManager.getInstance().remove(getLocator());
     1.9  			ConfigManager.getInstance().getProjectManager().remove(instance.getProject().getName());
    1.10  			clearInstance();
     2.1 --- a/colibriweb/webapp/modules/connection/edit.xhtml	Tue Jan 14 16:05:16 2014 +0100
     2.2 +++ b/colibriweb/webapp/modules/connection/edit.xhtml	Tue Jan 14 18:07:58 2014 +0100
     2.3 @@ -125,7 +125,7 @@
     2.4  							<h:panelGroup id="actions">
     2.5  								<div class="subspacer"/>
     2.6  								<div class="actions">
     2.7 -									<p:commandButton onclick="#{connectionModule.getEditorsToSave()}" type="submit" action="#{connectionModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages" global="true"/>
     2.8 +									<p:commandButton onclick="#{connectionModule.getEditorsToSave()}" type="submit" action="#{connectionModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages #{empty connectionModule.instance.id ? ':sockets' : ''}" global="true"/>
     2.9  								</div>
    2.10  								<div class="actions">
    2.11  									<p:commandButton type="submit" action="#{connectionModule.close}" value="#{messages.get('global.hide')}" immediate="true"/>
    2.12 @@ -165,11 +165,6 @@
    2.13  								</div>
    2.14  							</h:panelGroup>
    2.15  						</s:validateAll>
    2.16 -						<p:socket channel="/log#{connectionModule.pushId}" onMessage="handleMessage"> 
    2.17 -						</p:socket>
    2.18 -						<p:socket channel="/#{connectionModule.pushId}"> 
    2.19 -							<p:ajax global="false" process="@this" event="message" update=":mainform:metadata:metadataPanelContent :mainform:actions" oncomplete="document.getElementById('mainform:messageDisplay').click()"/>
    2.20 -						</p:socket>
    2.21  					</s:fragment>
    2.22  					<ui:include src="/modules/common/connectionMetadata.xhtml">
    2.23  						<ui:param name="module" value="#{connectionModule}" />
    2.24 @@ -190,6 +185,13 @@
    2.25  				</div>
    2.26  			</h:form>
    2.27  		</h:panelGroup>
    2.28 +		<h:panelGroup id="sockets">
    2.29 +			<p:socket channel="/log#{connectionModule.pushId}" onMessage="handleMessage"> 
    2.30 +			</p:socket>
    2.31 +			<p:socket channel="/#{connectionModule.pushId}"> 
    2.32 +				<p:ajax global="false" process="@this" event="message" update=":mainform:metadata:metadataPanelContent :mainform:actions" oncomplete="document.getElementById('mainform:messageDisplay').click()"/>
    2.33 +			</p:socket>
    2.34 +		</h:panelGroup>		
    2.35      </ui:define>
    2.36      
    2.37      <ui:define name="rightcontent">
     3.1 --- a/colibriweb/webapp/modules/extract/edit.xhtml	Tue Jan 14 16:05:16 2014 +0100
     3.2 +++ b/colibriweb/webapp/modules/extract/edit.xhtml	Tue Jan 14 18:07:58 2014 +0100
     3.3 @@ -149,7 +149,7 @@
     3.4  						<h:panelGroup id="actions">
     3.5  							<div class="subspacer"/>
     3.6  							<div class="actions">
     3.7 -								<p:commandButton onclick="#{extractModule.getEditorsToSave()}" type="submit" action="#{extractModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages" global="true"/>
     3.8 +								<p:commandButton onclick="#{extractModule.getEditorsToSave()}" type="submit" action="#{extractModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages #{empty extractModule.instance.id ? ':sockets' : ''}" global="true"/>
     3.9  							</div>
    3.10  							<div class="actions">
    3.11  								<p:commandButton type="submit" action="#{extractModule.close}" value="#{messages.get('global.hide')}" immediate="true"/>
    3.12 @@ -189,11 +189,6 @@
    3.13  							</div>
    3.14  						</h:panelGroup>
    3.15  						</s:validateAll>
    3.16 -						<p:socket channel="/log#{extractModule.pushId}" onMessage="handleMessage"> 
    3.17 -						</p:socket>
    3.18 -						<p:socket channel="/#{extractModule.pushId}"> 
    3.19 -							<p:ajax global="false" process="@this" event="message" update=":mainform:actions :mainform:complexFields" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>
    3.20 -						</p:socket>
    3.21  					</s:fragment>
    3.22  					<s:fragment rendered="#{not empty extractModule.instance.id}">
    3.23  						<ui:include src="/elements/flowgraph.xhtml">
    3.24 @@ -211,6 +206,13 @@
    3.25  				</div>
    3.26  			</h:form>
    3.27  		</h:panelGroup>
    3.28 +		<h:panelGroup id="sockets">
    3.29 +			<p:socket channel="/log#{extractModule.pushId}" onMessage="handleMessage"> 
    3.30 +			</p:socket>
    3.31 +			<p:socket channel="/#{extractModule.pushId}"> 
    3.32 +				<p:ajax global="false" process="@this" event="message" update=":mainform:actions :mainform:complexFields" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>
    3.33 +			</p:socket>
    3.34 +		</h:panelGroup>		
    3.35      </ui:define>
    3.36  
    3.37  	<ui:define name="rightcontent">
     4.1 --- a/colibriweb/webapp/modules/job/edit.xhtml	Tue Jan 14 16:05:16 2014 +0100
     4.2 +++ b/colibriweb/webapp/modules/job/edit.xhtml	Tue Jan 14 18:07:58 2014 +0100
     4.3 @@ -72,6 +72,7 @@
     4.4  				<div class="formwrapper">
     4.5  					<s:fragment rendered="#{not jobModule.isXmlMode()}">
     4.6  						<s:validateAll>
     4.7 +						<h:panelGroup id="data">
     4.8  						<h:panelGrid styleClass="attributeTable" columns="2" columnClasses="labelCol20, attributCol80" id="baseGrid" >
     4.9  		          			<ui:include src="/modules/common/componentHeader.xhtml">
    4.10  								<ui:param name="module" value="#{jobModule}" />
    4.11 @@ -146,6 +147,7 @@
    4.12  								<ui:param name="module" value="#{jobModule}" />
    4.13  							</ui:include>
    4.14  						</h:panelGrid>
    4.15 +						</h:panelGroup>
    4.16  						<s:decorate styleClass="inputwrapper" template="/layout/fieldvalidation.xhtml"  id="logPanel"> 
    4.17  					   		<s:fragment rendered="#{jobModule.executing or not empty jobModule.etlLogs}">
    4.18  						     	<p:tabView id="tabs">
    4.19 @@ -159,7 +161,7 @@
    4.20  		          		<h:panelGroup id="actions">
    4.21  		          			<div class="subspacer"/>
    4.22  							<div class="actions">
    4.23 -								<p:commandButton onclick="#{jobModule.getEditorsToSave()}" type="submit" action="#{jobModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages" global="true"/>
    4.24 +								<p:commandButton onclick="#{jobModule.getEditorsToSave()}" type="submit" action="#{jobModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages #{empty jobModule.instance.id ? ':sockets' : ''}" global="true"/>
    4.25  							</div>
    4.26  							<div class="actions">
    4.27  								<p:commandButton type="submit" action="#{jobModule.close}" value="#{messages.get('global.hide')}" immediate="true"/>
    4.28 @@ -199,11 +201,6 @@
    4.29  							<p:commandButton id ="messageDisplay" global="false" process="@this" value="messageDisplay" action="#{jobModule.checkMessages()}" update=":messages" style="visibility:hidden;height:1px;width:1px;"></p:commandButton>
    4.30  						</div>
    4.31  						</s:validateAll>
    4.32 -						<p:socket channel="/log#{jobModule.pushId}" onMessage="handleMessage"> 
    4.33 -						</p:socket>
    4.34 -						<p:socket channel="/#{jobModule.pushId}"> 
    4.35 -							<p:ajax global="false" process="@this" event="message" update=":mainform:actions :mainform:complexFields" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>				
    4.36 -						</p:socket>
    4.37  					</s:fragment>
    4.38  					<s:fragment rendered="#{not empty jobModule.instance.id}">
    4.39  						<ui:include src="/elements/flowgraph.xhtml">
    4.40 @@ -221,6 +218,13 @@
    4.41  				</div>
    4.42  			</h:form>
    4.43  		</h:panelGroup>
    4.44 +		<h:panelGroup id="sockets">
    4.45 +			<p:socket channel="/log#{jobModule.pushId}" onMessage="handleMessage"> 
    4.46 +			</p:socket>
    4.47 +			<p:socket channel="/#{jobModule.pushId}"> 
    4.48 +				<p:ajax global="false" process="@this" event="message" update=":mainform:actions :mainform:complexFields" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>				
    4.49 +			</p:socket>
    4.50 +		</h:panelGroup>				
    4.51      </ui:define>
    4.52      
    4.53      <ui:define name="rightcontent">
     5.1 --- a/colibriweb/webapp/modules/load/edit.xhtml	Tue Jan 14 16:05:16 2014 +0100
     5.2 +++ b/colibriweb/webapp/modules/load/edit.xhtml	Tue Jan 14 18:07:58 2014 +0100
     5.3 @@ -173,7 +173,7 @@
     5.4  		          		<h:panelGroup id="actions">
     5.5  		          			<div class="subspacer"/>
     5.6  							<div class="actions">
     5.7 -								<p:commandButton onclick="#{loadModule.getEditorsToSave()}" type="submit" action="#{loadModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages" global="true"/>
     5.8 +								<p:commandButton onclick="#{loadModule.getEditorsToSave()}" type="submit" action="#{loadModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages #{empty loadModule.instance.id ? ':sockets' : ''}" global="true"/>
     5.9  							</div>
    5.10  							<div class="actions">
    5.11  								<p:commandButton type="submit" action="#{loadModule.close}" value="#{messages.get('global.hide')}" immediate="true"/>
    5.12 @@ -216,11 +216,6 @@
    5.13  							</div>
    5.14  						</h:panelGroup>
    5.15  						</s:validateAll>
    5.16 -						<p:socket channel="/log#{loadModule.pushId}" onMessage="handleMessage"> 
    5.17 -						</p:socket>
    5.18 -						<p:socket channel="/#{loadModule.pushId}"> 
    5.19 -							<p:ajax global="false" process="@this" event="message" update=":mainform:metadata:metadataPanelContent :mainform:actions :mainform:codearea :rightform:inputList :mainform:complexFields" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>				
    5.20 -						</p:socket>
    5.21  					</s:fragment>
    5.22  					<ui:include src="/modules/common/connectionMetadata.xhtml">
    5.23  						<ui:param name="module" value="#{loadModule}" />
    5.24 @@ -241,6 +236,13 @@
    5.25  				</div>
    5.26  			</h:form>
    5.27  		</h:panelGroup>
    5.28 +		<h:panelGroup id="sockets">
    5.29 +			<p:socket channel="/log#{loadModule.pushId}" onMessage="handleMessage" autoConnect="true"> 
    5.30 +			</p:socket>
    5.31 +			<p:socket channel="/#{loadModule.pushId}"> 
    5.32 +				<p:ajax global="false" process="@this" event="message" update=":mainform:metadata:metadataPanelContent :mainform:actions :mainform:codearea :rightform:inputList :mainform:complexFields" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>				
    5.33 +			</p:socket>
    5.34 +		</h:panelGroup>			
    5.35      </ui:define>
    5.36      
    5.37      <ui:define name="rightcontent">
     6.1 --- a/colibriweb/webapp/modules/transform/edit.xhtml	Tue Jan 14 16:05:16 2014 +0100
     6.2 +++ b/colibriweb/webapp/modules/transform/edit.xhtml	Tue Jan 14 18:07:58 2014 +0100
     6.3 @@ -92,48 +92,52 @@
     6.4  				<div class="formwrapper">
     6.5  					<s:fragment rendered="#{not transformModule.isXmlMode()}">
     6.6  						<s:validateAll>
     6.7 -						<h:panelGrid styleClass="attributeTable" columns="2" columnClasses="labelCol20, attributCol80" >
     6.8 -		          			<ui:include src="/modules/common/componentHeader.xhtml">
     6.9 +						<h:panelGroup id="data">
    6.10 +							<h:panelGrid styleClass="attributeTable" columns="2" columnClasses="labelCol20, attributCol80" >
    6.11 +			          			<ui:include src="/modules/common/componentHeader.xhtml">
    6.12 +									<ui:param name="module" value="#{transformModule}" />
    6.13 +								</ui:include>
    6.14 +								 
    6.15 +								<s:fragment rendered="#{transformModule.maxSources > 0}">
    6.16 +									<span class="inputlabel">#{transformModule.maxSources == 1 ? 'Source' : 'Sources'}:#{transformModule.sourceRequired ? ' *' : ''}</span>
    6.17 +								</s:fragment>
    6.18 +								<s:fragment rendered="#{transformModule.maxSources > 0}">
    6.19 +							    	<h:panelGroup id="sourcesData">	
    6.20 +						          		<ui:include src="/elements/editComponent.xhtml" >
    6.21 +						          			<ui:param name="title" value="" />
    6.22 +						          			<ui:param name="editComponent" value="#{transformModule.sourcesEditComponent}" />
    6.23 +						          			<ui:param name="module" value="#{transformModule}" />
    6.24 +						          			<ui:param name="include" value="/modules/common/sourcesEditPart.xhtml" />
    6.25 +						          			<ui:param name="render" value=":mainform:sourcesData :rightform:inputList" />
    6.26 +						          			<ui:param name="enableCreation" value="true" />
    6.27 +						          			<ui:param name="officalCreateText" value="Add Source" />
    6.28 +						          			<ui:param name="rowStyle" value="margin: 0px 0;"/>
    6.29 +						          		</ui:include>
    6.30 +								    </h:panelGroup>	
    6.31 +								</s:fragment>
    6.32 +							</h:panelGrid>
    6.33 +							<ui:include src="/modules/common/componentSimpleFields.xhtml">
    6.34  								<ui:param name="module" value="#{transformModule}" />
    6.35 +								<ui:param name="fields" value="#{transformModule.UIFields}" />
    6.36 +								<ui:param name="rendered" value="true" />
    6.37  							</ui:include>
    6.38 -							 
    6.39 -							<s:fragment rendered="#{transformModule.maxSources > 0}">
    6.40 -								<span class="inputlabel">#{transformModule.maxSources == 1 ? 'Source' : 'Sources'}:#{transformModule.sourceRequired ? ' *' : ''}</span>
    6.41 -							</s:fragment>
    6.42 -							<s:fragment rendered="#{transformModule.maxSources > 0}">
    6.43 -						    	<h:panelGroup id="sourcesData">	
    6.44 -					          		<ui:include src="/elements/editComponent.xhtml" >
    6.45 -					          			<ui:param name="title" value="" />
    6.46 -					          			<ui:param name="editComponent" value="#{transformModule.sourcesEditComponent}" />
    6.47 -					          			<ui:param name="module" value="#{transformModule}" />
    6.48 -					          			<ui:param name="include" value="/modules/common/sourcesEditPart.xhtml" />
    6.49 -					          			<ui:param name="render" value=":mainform:sourcesData :rightform:inputList" />
    6.50 -					          			<ui:param name="enableCreation" value="true" />
    6.51 -					          			<ui:param name="officalCreateText" value="Add Source" />
    6.52 -					          			<ui:param name="rowStyle" value="margin: 0px 0;"/>
    6.53 -					          		</ui:include>
    6.54 -							    </h:panelGroup>	
    6.55 -							</s:fragment>
    6.56 -						</h:panelGrid>
    6.57 -						<ui:include src="/modules/common/componentSimpleFields.xhtml">
    6.58 -							<ui:param name="module" value="#{transformModule}" />
    6.59 -							<ui:param name="fields" value="#{transformModule.UIFields}" />
    6.60 -							<ui:param name="rendered" value="true" />
    6.61 -						</ui:include>
    6.62 -						<ui:include src="/modules/transform/elements/functionEditPart.xhtml">
    6.63 -						</ui:include>
    6.64 -						<p:dataList value="#{transformModule.getComplexRootNodes()}" var="builder" styleClass="repeat" type="none" emptyMessage="" id="complexFields">
    6.65 -							<ui:include src="/modules/common/componentComplexFields.xhtml">
    6.66 -								<ui:param name="inputList" value="#{transformModule.getComponentTypedInputList()}" />
    6.67 -								<ui:param name="render" value=":mainform:complexFields :rightform:inputList" />
    6.68 -								<ui:param name="module" value="#{transformModule}" />
    6.69 -							</ui:include>
    6.70 -						</p:dataList>	
    6.71 -						<h:panelGrid styleClass="attributeTable" columns="2" columnClasses="labelCol20, attributCol80" >
    6.72 -		          			<ui:include src="/modules/common/componentFooter.xhtml">
    6.73 -								<ui:param name="module" value="#{transformModule}" />
    6.74 -							</ui:include>
    6.75 -						</h:panelGrid> 
    6.76 +							<h:panelGroup id="functionData">
    6.77 +								<ui:include src="/modules/transform/elements/functionEditPart.xhtml">
    6.78 +								</ui:include>
    6.79 +							</h:panelGroup>
    6.80 +							<p:dataList value="#{transformModule.getComplexRootNodes()}" var="builder" styleClass="repeat" type="none" emptyMessage="" id="complexFields">
    6.81 +								<ui:include src="/modules/common/componentComplexFields.xhtml">
    6.82 +									<ui:param name="inputList" value="#{transformModule.getComponentTypedInputList()}" />
    6.83 +									<ui:param name="render" value=":mainform:complexFields :rightform:inputList" />
    6.84 +									<ui:param name="module" value="#{transformModule}" />
    6.85 +								</ui:include>
    6.86 +							</p:dataList>	
    6.87 +							<h:panelGrid styleClass="attributeTable" columns="2" columnClasses="labelCol20, attributCol80" >
    6.88 +			          			<ui:include src="/modules/common/componentFooter.xhtml">
    6.89 +									<ui:param name="module" value="#{transformModule}" />
    6.90 +								</ui:include>
    6.91 +							</h:panelGrid> 
    6.92 +						</h:panelGroup>
    6.93  						<s:decorate styleClass="inputwrapper" template="/layout/fieldvalidation.xhtml"  id="logPanel"> 
    6.94  						   		<s:fragment rendered="#{transformModule.executing or not empty transformModule.etlLogs}">
    6.95  							     	<p:tabView id="tabs">
    6.96 @@ -147,7 +151,7 @@
    6.97  						<h:panelGroup id="actions">
    6.98  							<div class="subspacer"/>
    6.99  							<div class="actions">
   6.100 -								<p:commandButton type="submit" action="#{transformModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages" global="true" onclick="#{transformModule.getEditorsToSave()}" process=":content"/>
   6.101 +								<p:commandButton type="submit" action="#{transformModule.persist}" value="#{messages.get('global.save')}" update=":content :rightform :messages #{empty transformModule.instance.id ? ':sockets' : ''}" global="true" onclick="#{transformModule.getEditorsToSave()}" process=":content"/>
   6.102  							</div> 
   6.103  							<div class="actions">
   6.104  								<p:commandButton type="submit" action="#{transformModule.close}" value="#{messages.get('global.hide')}" immediate="true" />
   6.105 @@ -187,11 +191,7 @@
   6.106  							</div>
   6.107  						</h:panelGroup>
   6.108  						</s:validateAll>
   6.109 -						<p:socket channel="/log#{transformModule.pushId}" onMessage="handleMessage"> 
   6.110 -						</p:socket>
   6.111 -						<p:socket channel="/#{transformModule.pushId}"> 
   6.112 -							<p:ajax global="false" process="@this" event="message" update=":mainform:actions :rightform:inputList :mainform:complexFields #{transformModule.hasFunctions() ? ':mainform:functionSelection' : ''}" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>				
   6.113 -						</p:socket>
   6.114 +						
   6.115  					</s:fragment>
   6.116  					<s:fragment rendered="#{not empty transformModule.instance.id}">
   6.117  						<ui:include src="/elements/flowgraph.xhtml">
   6.118 @@ -212,6 +212,13 @@
   6.119  				</div>
   6.120  			</h:form> 
   6.121  		</h:panelGroup>
   6.122 +		<h:panelGroup id="sockets">
   6.123 +			<p:socket channel="/log#{transformModule.pushId}" onMessage="handleMessage"> 
   6.124 +			</p:socket>
   6.125 +			<p:socket channel="/#{transformModule.pushId}"> 
   6.126 +				<p:ajax global="false" process="@this" event="message" update=":mainform:actions :rightform:inputList :mainform:complexFields :mainform:functionData" oncomplete="document.getElementById('mainform:messageDisplay').click();"/>				
   6.127 +			</p:socket>
   6.128 +		</h:panelGroup>		
   6.129      </ui:define>
   6.130    
   6.131      <ui:define name="rightcontent">
     7.1 --- a/colibriweb/webapp/modules/transform/elements/functionEditPart.xhtml	Tue Jan 14 16:05:16 2014 +0100
     7.2 +++ b/colibriweb/webapp/modules/transform/elements/functionEditPart.xhtml	Tue Jan 14 18:07:58 2014 +0100
     7.3 @@ -47,7 +47,7 @@
     7.4  						<ui:param name="module" value="#{functionModule}" />
     7.5  					</ui:include>
     7.6  				</p:dataList>
     7.7 -				<h:panelGrid styleClass="attributeTable" columns="2" columnClasses="labelCol20, attributCol80" id="functionContent" rendered="#{function.name.equals(functionModule.instance.name) or empty function.name}">	
     7.8 +				<h:panelGrid styleClass="attributeTable" columns="2" columnClasses="labelCol20, attributCol80" id="functionContent" rendered="#{(function.name.equals(functionModule.instance.name) or empty function.name) and functionModule.maxSources > 0}">	
     7.9  					<s:fragment rendered="#{functionModule.maxSources > 0}">
    7.10  						<span class="inputlabel">#{functionModule.maxSources == 1 ? 'Source' : 'Sources'}:#{functionModule.sourceRequired ? ' *' : ''}</span>
    7.11  					</s:fragment>