comsuite-svn Mailing List for Communications Suite (Page 5)
                
                Brought to you by:
                
                    zduniak
                    
                
            
            
        
        
        
    You can subscribe to this list here.
| 2006 | Jan | Feb | Mar | Apr | May | Jun | Jul (10) | Aug (16) | Sep (48) | Oct (47) | Nov (4) | Dec (1) | 
|---|
| 
      
      
      From: <sku...@us...> - 2006-08-30 19:50:33
      
     | 
| Revision: 120
          http://svn.sourceforge.net/comsuite/?rev=120&view=rev
Author:   skuzniak
Date:     2006-08-30 12:49:57 -0700 (Wed, 30 Aug 2006)
Log Message:
-----------
all services switched to singletons, additional field in sapinstancedef added.
Modified Paths:
--------------
    trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java
    trunk/code/CSMiddleware/src/org/commsuite/dao/SAPInstanceDefDao.java
    trunk/code/CSMiddleware/src/org/commsuite/dao/hibernate/SAPInstanceDefDaoImpl.java
    trunk/code/CSMiddleware/src/org/commsuite/managers/SAPInstanceDefManager.java
    trunk/code/CSMiddleware/src/org/commsuite/managers/impl/SAPInstanceDefManagerImpl.java
    trunk/code/CSMiddleware/src/org/commsuite/sap/ISAPComm.java
    trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java
    trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java
    trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java
    trunk/code/CSMiddleware/src/org/commsuite/ws/services/ActionsService.java
    trunk/code/CSMiddleware/src/org/commsuite/ws/services/GroupsService.java
    trunk/code/CSMiddleware/src/org/commsuite/ws/services/RolesService.java
    trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java
Modified: trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java
===================================================================
--- trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -183,6 +183,8 @@
     public Collection<WSRole> getRolesForGroup(String id) throws WebServiceException;
 
     public Collection<WSGroup> getGroupsByUser(String name) throws WebServiceException;
+    
+    public void deactivateServer(String id, boolean mode) throws WebServiceException ;
 
     /**
      * This method allows test server with known ID
Modified: trunk/code/CSMiddleware/src/org/commsuite/dao/SAPInstanceDefDao.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/dao/SAPInstanceDefDao.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/dao/SAPInstanceDefDao.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -45,5 +45,7 @@
     public void deleteSAPInstanceDef(SAPInstanceDef sapInstanceDef);
     
 	public SAPInstanceDef getSAPInstanceDefByMessageId(Long long1);
+	
+	public void deactivateInstance(String id, boolean mode);
 
 }
Modified: trunk/code/CSMiddleware/src/org/commsuite/dao/hibernate/SAPInstanceDefDaoImpl.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/dao/hibernate/SAPInstanceDefDaoImpl.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/dao/hibernate/SAPInstanceDefDaoImpl.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -138,5 +138,11 @@
 		logger.debug("SIZE OF INSTANCES MATCHING TO GIVES PATTERN: " + list.size());
 		return list;
 	}
+	
+	public void deactivateInstance(String id, boolean mode) {
+		SAPInstanceDef instance = getSAPInstanceDef(Long.getLong(id).longValue());
+		instance.setActiveInstance(mode);
+		getHibernateTemplate().saveOrUpdate(id, instance);
+	}
 
 }
Modified: trunk/code/CSMiddleware/src/org/commsuite/managers/SAPInstanceDefManager.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/managers/SAPInstanceDefManager.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/managers/SAPInstanceDefManager.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -45,5 +45,7 @@
 	public void deleteSAPInstanceDef(SAPInstanceDef sapInstanceDef);
     
 	public SAPInstanceDef getSAPInstanceDefByMessageId(String string);
+	
+	public void deactivateInstance(String id, boolean mode);
 
 }
Modified: trunk/code/CSMiddleware/src/org/commsuite/managers/impl/SAPInstanceDefManagerImpl.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/managers/impl/SAPInstanceDefManagerImpl.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/managers/impl/SAPInstanceDefManagerImpl.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -88,5 +88,7 @@
 		return dao.getSAPInstanceDefByMessageId(Long.valueOf(messageId));
 	}
 
-
+	public void deactivateInstance(String id, boolean mode) {
+		dao.deactivateInstance(id, mode);
+	}
 }
Modified: trunk/code/CSMiddleware/src/org/commsuite/sap/ISAPComm.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/sap/ISAPComm.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/sap/ISAPComm.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -56,6 +56,8 @@
     public abstract String getName();
     
     public abstract IJCOServer getServer();
+    
+    public abstract boolean isActiveInstance();
 
     public String toString();
 }
Modified: trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -582,5 +582,9 @@
     public boolean isHandlingRequest() {
         return handlingRequest;
     }
+    
+    public boolean isActiveInstance() {
+    	return this.instanceDef.isActiveInstance();
+    }
 
 }
Modified: trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -127,21 +127,23 @@
 
         final Collection<ISAPComm> clonnedSapComms = new FastTable<ISAPComm>(sapComms.values());
         for (final ISAPComm sapComm : clonnedSapComms) {
-            logger.info("Initiating: " + sapComm);
-            try {
-                sapComm.startServer();
-            } catch (Throwable t) {
-                logger.fatal("Error during starting SAPComm: " + sapComm, t);
-                // stop partially started SAPComm:
-                try {
-                    sapComm.destroy();
-                } catch (Throwable ignore) {
-                    // Ignore
-                }
-                // remove error prone SAPComm from oryginal collection:
-                // REVIEW: maybe it is not good idea to remove sap instance from collection ?
-                // sapComms.remove(sapComm.getName());
-            }
+        	if (sapComm.isActiveInstance()) {
+	            logger.info("Initiating: " + sapComm);
+	            try {
+	                sapComm.startServer();
+	            } catch (Throwable t) {
+	                logger.fatal("Error during starting SAPComm: " + sapComm, t);
+	                // stop partially started SAPComm:
+	                try {
+	                    sapComm.destroy();
+	                } catch (Throwable ignore) {
+	                    // Ignore
+	                }
+	                // remove error prone SAPComm from oryginal collection:
+	                // REVIEW: maybe it is not good idea to remove sap instance from collection ?
+	                // sapComms.remove(sapComm.getName());
+	            }
+        	}
         }
     }
 
Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -318,7 +318,7 @@
 
     public Collection<WSAction> getActionsAvailable() throws WebServiceException {
         try {
-            ActionsService service = new ActionsService();
+            ActionsService service = ActionsService.getInstance();
             return service.getActionsAvailable();
         } catch (Throwable t) {
             logger.fatal("error in getActionsAvailable method", t);
@@ -328,7 +328,7 @@
 
     public Collection<WSAction> getActionsByRole(String id) throws WebServiceException {
         try {
-            ActionsService service = new ActionsService();
+            ActionsService service = ActionsService.getInstance();
             return service.getActionsByRole(id);
         } catch (Throwable t) {
             logger.fatal("error in getActionsByRole method", t);
@@ -340,7 +340,7 @@
     // do zapisywania zmian przy edycji juz istniejacych akcji ? nazwa tej metody jest odpowiednia ?
     public WSAction addActionToDatabase(WSAction action) throws WebServiceException {
         try {
-            ActionsService service = new ActionsService();
+            ActionsService service = ActionsService.getInstance();
             return service.addActionToDatabase(action);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("duplicate action name");
@@ -354,7 +354,7 @@
     // TODO: [SK] czy ta metoda nie powinna zwracac obiektu typu WSAction ?
     public Action getActionById(String id) throws WebServiceException {
         try {
-            ActionsService service = new ActionsService();
+            ActionsService service = ActionsService.getInstance();
             return service.getActionById(id);
         } catch (Throwable t) {
             logger.fatal("error in getActionById method", t);
@@ -364,7 +364,7 @@
 
     public WSAction getWSActionById(String id) throws WebServiceException {
         try {
-            ActionsService service = new ActionsService();
+            ActionsService service = ActionsService.getInstance();
             return service.getWSActionById(id);
         } catch (Throwable t) {
             logger.fatal("error in getActionById method", t);
@@ -374,7 +374,7 @@
 
     public void deleteActionFromDatabase(String id) throws WebServiceException {
         try {
-            ActionsService service = new ActionsService();
+            ActionsService service = ActionsService.getInstance();
             service.deleteActionFromDatabase(id);
         } catch (DataIntegrityViolationException diva) {
             logger.fatal("This action is assigned.");
@@ -387,7 +387,7 @@
 
     public Collection<WSAction> getActionsByName(String name) throws WebServiceException {
         try {
-            ActionsService service = new ActionsService();
+            ActionsService service = ActionsService.getInstance();
             return service.getActionsByName(name);
         } catch (Throwable t) {
             logger.fatal("error in addActionToDatabase method", t);
@@ -397,7 +397,7 @@
 
     public WSRole updateRole(WSRole wsRole) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.updateRole(wsRole);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Duplicate name error");
@@ -410,7 +410,7 @@
 
     public WSRole updateActionsForRole(WSRole wsRole, String[] ids) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.updateActionsForRole(wsRole, ids);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Duplicate name error");
@@ -424,7 +424,7 @@
     public WSRole updateUsersForRole(WSRole wsRole, String[] idsToAdd, String[] idsToDelete)
             throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.updateUsersForRole(wsRole, idsToAdd, idsToDelete);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Duplicate name error");
@@ -437,7 +437,7 @@
 
     public void deleteRoleFromDatabase(String id) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             service.deleteRoleFromDatabase(id);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Something is assigned to this role");
@@ -450,7 +450,7 @@
 
     public Collection<WSRole> getAllRoles() throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.getAllRoles();
         } catch (Throwable t) {
             logger.fatal("error in getAllRoles method", t);
@@ -471,7 +471,7 @@
 
     public Collection<WSGroup> getAllGroups() throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             return service.getAllGroups();
         } catch (Throwable t) {
             logger.fatal("error in getAllGroups method", t);
@@ -481,7 +481,7 @@
 
     public WSGroup updateGroup(WSGroup wsGroup) throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             return service.updateGroup(wsGroup);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Duplicate name error");
@@ -494,7 +494,7 @@
 
     public WSGroup updateRolesForGroup(WSGroup wsGroup, String[] ids) throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             return service.updateRolesForGroup(wsGroup, ids);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Duplicate name error");
@@ -508,7 +508,7 @@
     public WSGroup updateUsersForGroup(WSGroup wsGroup, String[] idsToAdd, String[] idsToDelete)
             throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             return service.updateUsersForGroup(wsGroup, idsToAdd, idsToDelete);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Duplicate name error");
@@ -521,7 +521,7 @@
 
     public void deleteGroupFromDatabase(String id) throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             service.deleteGroupFromDatabase(id);
         } catch (DataIntegrityViolationException dive) {
             logger.fatal("Something is assigned to this group");
@@ -554,7 +554,7 @@
 
     public WSRole getRoleById(String id) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.getRoleById(id);
         } catch (Throwable t) {
             logger.fatal("error in getRoleById method", t);
@@ -564,7 +564,7 @@
 
     public WSGroup getGroupById(String id) throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             return service.getGroupById(id);
         } catch (Throwable t) {
             logger.fatal("error in getGroupById method", t);
@@ -574,7 +574,7 @@
 
     public Collection<WSRole> getRolesByName(String name) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.getRolesByName(name);
         } catch (Throwable t) {
             logger.fatal("error in getAllRoles method", t);
@@ -584,7 +584,7 @@
 
     public Collection<WSGroup> getGroupsByName(String name) throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             return service.getGroupsByName(name);
         } catch (Throwable t) {
             logger.fatal("error in getAllGroups method", t);
@@ -614,7 +614,7 @@
 
     public Collection<WSRole> getRolesForGroup(String id) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.getRolesForGroup(id);
         } catch (Throwable t) {
             logger.fatal("Exception while getting roles for group: " + id, t);
@@ -634,7 +634,7 @@
 
     public Collection<WSRole> getRolesByUser(String id) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.getRolesByUser(id);
         } catch (Throwable t) {
             logger.fatal("Exception while getting roles for user: " + id, t);
@@ -644,7 +644,7 @@
 
     public Collection<WSGroup> getGroupsByUser(String id) throws WebServiceException {
         try {
-            GroupsService service = new GroupsService();
+            GroupsService service = GroupsService.getInstance();
             return service.getGroupsByUser(id);
         } catch (Throwable t) {
             logger.fatal("Exception while getting groups for user: " + id, t);
@@ -654,7 +654,7 @@
 
     public Collection<WSRole> getRoleByActionId(String id) throws WebServiceException {
         try {
-            RolesService service = new RolesService();
+            RolesService service = RolesService.getInstnce();
             return service.getRoleByActionId(id);
         } catch (Throwable t) {
             logger.fatal("Exception while getting roles for action: " + id, t);
@@ -701,5 +701,15 @@
             throw new WebServiceException(t);
         }
     }
+    
+    public void deactivateServer(String id, boolean mode) throws WebServiceException {
+    	try {
+    		ServersService service = ServersService.getInstance();
+    		service.deactivateServer(id, mode);
+    	} catch(Throwable t) {
+    		logger.fatal("error while deactivating server", t);
+    		throw new WebServiceException(t);
+    	}
+    }
 
 }
\ No newline at end of file
Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/ActionsService.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/ws/services/ActionsService.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/ActionsService.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -41,6 +41,19 @@
 public class ActionsService {
 
     private static final Logger logger = Logger.getLogger(ActionsService.class);
+    
+    private static ActionsService instance;
+    
+    private ActionsService() {
+    	
+    }
+    
+    public synchronized static ActionsService getInstance() {
+    	if (null == instance) {
+    		instance = new ActionsService();
+    	}
+    	return instance;
+    }
 
     public Collection<WSAction> getActionsAvailable() throws WebServiceException {
         try {
Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/GroupsService.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/ws/services/GroupsService.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/GroupsService.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -47,6 +47,19 @@
 	
 	private static final Logger logger = Logger.getLogger(GroupsService.class);
 	
+	private static GroupsService instance;
+	
+	private GroupsService() {
+		
+	}
+	
+	public synchronized static GroupsService getInstance() {
+		if (null == instance) {
+			instance = new GroupsService();
+		}
+		return instance;
+	}
+	
 	public Collection<WSGroup> getAllGroups() throws WebServiceException {
         try {
             GroupManager groupManager = (GroupManager) SpringMiddlewareContext.getGroupManager();
Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/RolesService.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/ws/services/RolesService.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/RolesService.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -50,6 +50,19 @@
 	
 	private static final Logger logger = Logger.getLogger(RolesService.class);
 	
+	private static RolesService instance;
+	
+	private RolesService() {
+		
+	}
+	
+	public static synchronized RolesService getInstnce() {
+		if (null == instance) {
+			instance = new RolesService();
+		}
+		return instance;
+	}
+	
 	public WSRole updateRole(WSRole wsRole) throws WebServiceException {
         Role role;
         try {
Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java
===================================================================
--- trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java	2006-08-21 19:09:35 UTC (rev 119)
+++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java	2006-08-30 19:49:57 UTC (rev 120)
@@ -421,5 +421,16 @@
             throw new WebServiceException(t);
     	}
 	}
+	
+	public void deactivateServer(String id, boolean mode) throws WebServiceException {
+		/*try {
+			final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext
+    				.getSAPInstanceDefManager();
+			instManager.deactivateInstance(id, mode);
+		} catch(Throwable t) {
+			logger.fatal("error in deactivateServer method", t);
+            throw new WebServiceException(t);
+		}*/
+	}
 
 }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <sku...@us...> - 2006-08-21 19:10:01
      
     | 
| Revision: 119 Author: skuzniak Date: 2006-08-21 12:09:35 -0700 (Mon, 21 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=119&view=rev Log Message: ----------- 403 message upgraded Modified Paths: -------------- trunk/code/CSAdminPanel/WebContent/error403.jsp Modified: trunk/code/CSAdminPanel/WebContent/error403.jsp =================================================================== --- trunk/code/CSAdminPanel/WebContent/error403.jsp 2006-08-19 12:28:14 UTC (rev 118) +++ trunk/code/CSAdminPanel/WebContent/error403.jsp 2006-08-21 19:09:35 UTC (rev 119) @@ -8,7 +8,7 @@ href="<%=request.getContextPath()%>/pages/css/mainStyle.css" /> </head> <body> - <img src="#{pageContext.request.contextPath}/pages/files/gif/dialog-warning96.gif" /> + <img src="<%=request.getContextPath()%>/pages/files/gif/dialog-warning96.gif" /> <h1> Zas\xF3b chroniony </h1> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-08-19 12:28:21
      
     | 
| Revision: 118 Author: skuzniak Date: 2006-08-19 05:28:14 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=118&view=rev Log Message: ----------- 403 white screen fixed Modified Paths: -------------- trunk/code/CSAdminPanel/WebContent/WEB-INF/web.xml Modified: trunk/code/CSAdminPanel/WebContent/WEB-INF/web.xml =================================================================== --- trunk/code/CSAdminPanel/WebContent/WEB-INF/web.xml 2006-08-19 11:49:54 UTC (rev 117) +++ trunk/code/CSAdminPanel/WebContent/WEB-INF/web.xml 2006-08-19 12:28:14 UTC (rev 118) @@ -117,7 +117,7 @@ </session-config> <error-page> <error-code>403</error-code> - <location>/error403.html</location> + <location>/error403.jsp</location> </error-page> <mime-mapping> <extension>wsdl</extension> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-08-19 11:50:05
      
     | 
| Revision: 117 Author: skuzniak Date: 2006-08-19 04:49:54 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=117&view=rev Log Message: ----------- back button in detailed messages view provided, styles corrected Modified Paths: -------------- trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css trunk/code/CSAdminPanel/WebContent/pages/messages/CSMessagesDetails.jsp Modified: trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css =================================================================== --- trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css 2006-08-19 10:55:13 UTC (rev 116) +++ trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css 2006-08-19 11:49:54 UTC (rev 117) @@ -29,7 +29,7 @@ } .header-menu-banner{ - background-image:url(../files/background/banner_2.gif); + background-image:url(../files/gif/background/banner_2.gif); width:1000px; height:80px; display:block; @@ -72,7 +72,7 @@ } .menu{ - background-image:url(../files/background/tlo_2.gif); + background-image:url(../files/gif/background/tlo_2.gif); width:205px; height:435px; display:block; Modified: trunk/code/CSAdminPanel/WebContent/pages/messages/CSMessagesDetails.jsp =================================================================== --- trunk/code/CSAdminPanel/WebContent/pages/messages/CSMessagesDetails.jsp 2006-08-19 10:55:13 UTC (rev 116) +++ trunk/code/CSAdminPanel/WebContent/pages/messages/CSMessagesDetails.jsp 2006-08-19 11:49:54 UTC (rev 117) @@ -19,7 +19,7 @@ </h:panelGrid> <h:panelGrid columns="1" styleClass="menu-right"> <h:form id="showMessages"> - <f:facet name="header"> + <%--<f:facet name="header">--%> <h:panelGrid columns="2"> <h:outputText value="#{Locale.MESSAGES_DETAILS_TITLE}" styleClass="view-header" /> @@ -30,7 +30,7 @@ </h:panelGrid> </h:commandLink> </h:panelGrid> - </f:facet> + <%--</f:facet>--%> <h:panelGrid columns="1" styleClass="viewTable" id="messagesList"> <h:messages /> <h:panelGrid columns="1" styleClass="listView-header"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-08-19 10:56:44
      
     | 
| Revision: 116 Author: skuzniak Date: 2006-08-19 03:55:13 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=116&view=rev Log Message: ----------- this library was used Added Paths: ----------- trunk/code/CSAdminPanel/WebContent/WEB-INF/lib/tomahawk.jar Added: trunk/code/CSAdminPanel/WebContent/WEB-INF/lib/tomahawk.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/WEB-INF/lib/tomahawk.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-08-19 10:49:27
      
     | 
| Revision: 115 Author: skuzniak Date: 2006-08-19 03:49:17 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=115&view=rev Log Message: ----------- unused library deleted Removed Paths: ------------- trunk/code/CSAdminPanel/WebContent/WEB-INF/lib/tomahawk.jar Deleted: trunk/code/CSAdminPanel/WebContent/WEB-INF/lib/tomahawk.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-08-19 10:37:30
      
     | 
| Revision: 114 Author: skuzniak Date: 2006-08-19 03:36:10 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=114&view=rev Log Message: ----------- images moved from css catalog, to files, active field added to cs_sap_servers table Modified Paths: -------------- trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css trunk/code/CSMiddleware/import.sql trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.hbm.xml trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.java trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java Added Paths: ----------- trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/ trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_1.gif trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_2.gif trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_bez_logo.gif trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/menu-background.jpg trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/page-background.jpg trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/pasek_1.gif trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/pasek_2.gif trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/tlo_1.gif trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/tlo_2.gif Removed Paths: ------------- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/JSPHandlerServlet.java trunk/code/CSAdminPanel/WebContent/pages/css/banner_1.gif trunk/code/CSAdminPanel/WebContent/pages/css/banner_2.gif trunk/code/CSAdminPanel/WebContent/pages/css/banner_bez_logo.gif trunk/code/CSAdminPanel/WebContent/pages/css/menu-background.jpg trunk/code/CSAdminPanel/WebContent/pages/css/page-background.jpg trunk/code/CSAdminPanel/WebContent/pages/css/pasek_1.gif trunk/code/CSAdminPanel/WebContent/pages/css/pasek_2.gif trunk/code/CSAdminPanel/WebContent/pages/css/tlo_1.gif trunk/code/CSAdminPanel/WebContent/pages/css/tlo_2.gif Deleted: trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/JSPHandlerServlet.java =================================================================== --- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/JSPHandlerServlet.java 2006-08-17 18:03:48 UTC (rev 113) +++ trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/JSPHandlerServlet.java 2006-08-19 10:36:10 UTC (rev 114) @@ -1,19 +0,0 @@ -/** - * - */ -package org.commsuite.web.servlet; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author Szymon Kuzniak - * - */ -public class JSPHandlerServlet extends HttpServlet { - - public void doService(HttpServletRequest req, HttpServletResponse res) { - - } -} Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/banner_1.gif =================================================================== (Binary files differ) Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/banner_2.gif =================================================================== (Binary files differ) Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/banner_bez_logo.gif =================================================================== (Binary files differ) Modified: trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css =================================================================== --- trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css 2006-08-17 18:03:48 UTC (rev 113) +++ trunk/code/CSAdminPanel/WebContent/pages/css/mainStyle.css 2006-08-19 10:36:10 UTC (rev 114) @@ -29,7 +29,7 @@ } .header-menu-banner{ - background-image:url(../css/banner_2.gif); + background-image:url(../files/background/banner_2.gif); width:1000px; height:80px; display:block; @@ -72,7 +72,7 @@ } .menu{ - background-image:url(../css/tlo_2.gif); + background-image:url(../files/background/tlo_2.gif); width:205px; height:435px; display:block; Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/menu-background.jpg =================================================================== (Binary files differ) Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/page-background.jpg =================================================================== (Binary files differ) Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/pasek_1.gif =================================================================== (Binary files differ) Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/pasek_2.gif =================================================================== (Binary files differ) Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/tlo_1.gif =================================================================== (Binary files differ) Deleted: trunk/code/CSAdminPanel/WebContent/pages/css/tlo_2.gif =================================================================== (Binary files differ) Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_1.gif =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_1.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_2.gif =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_2.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_bez_logo.gif =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/banner_bez_logo.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/menu-background.jpg =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/menu-background.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/page-background.jpg =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/page-background.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/pasek_1.gif =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/pasek_1.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/pasek_2.gif =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/pasek_2.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/tlo_1.gif =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/tlo_1.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/tlo_2.gif =================================================================== (Binary files differ) Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files/gif/background/tlo_2.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/code/CSMiddleware/import.sql =================================================================== --- trunk/code/CSMiddleware/import.sql 2006-08-17 18:03:48 UTC (rev 113) +++ trunk/code/CSMiddleware/import.sql 2006-08-19 10:36:10 UTC (rev 114) @@ -1,5 +1,5 @@ --DO NOT ADD ROWS WITH ID GREATER THEN 99 -INSERT INTO cs_sap_servers (id, adm_email, client, gw_host, gw_Serv, host, load_balancing, name, user_password, prog_id, system_number, unicode, user_name, default_instance, max_connections_in_pool, group_name, r3_name) VALUES (123456,'mar...@bc...','100','bcz.bcc.com.pl','sapgw44','bcz.bcc.com.pl',FALSE,'BCC_BCZ_100_DB','changeme','ZTESTJCO','44',FALSE,'cstest',TRUE,5,'',''); +INSERT INTO cs_sap_servers (id, active_instance, adm_email, client, gw_host, gw_Serv, host, load_balancing, name, user_password, prog_id, system_number, unicode, user_name, default_instance, max_connections_in_pool, group_name, r3_name) VALUES (123456, 'true', 'mar...@bc...','100','bcz.bcc.com.pl','sapgw44','bcz.bcc.com.pl',FALSE,'BCC_BCZ_100_DB','changeme','ZTESTJCO','44',FALSE,'cstest',TRUE,5,'',''); INSERT INTO cs_actions (id, name, description) VALUES (1, 'Action_JMX_UseJmx', 'Using JMX'); INSERT INTO cs_actions (id, name, description) VALUES (2, 'Action_RemoteClient_UseRemoteClient', 'Using RemoteClient'); Modified: trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.hbm.xml =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.hbm.xml 2006-08-17 18:03:48 UTC (rev 113) +++ trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.hbm.xml 2006-08-19 10:36:10 UTC (rev 114) @@ -10,6 +10,7 @@ <param name="parameters">INCREMENT BY 1 START WITH 100</param> </generator> </id> + <property name="activeInstance" not-null="true" type="boolean" column="ACTIVE_INSTANCE"/> <property name="adminEmail" not-null="true" length="250" column="ADM_EMAIL"/> <property name="client" not-null="true" length="30" column="CLIENT"/> <property name="group" length="30" column="GROUP_NAME"/> Modified: trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.java 2006-08-17 18:03:48 UTC (rev 113) +++ trunk/code/CSMiddleware/src/org/commsuite/model/SAPInstanceDef.java 2006-08-19 10:36:10 UTC (rev 114) @@ -79,6 +79,8 @@ * SAP logon client (so-called mandant). */ private String client; + + private boolean activeInstance = true; // /** // * SAP logon language. This field is not obligatory. @@ -145,6 +147,17 @@ private String adminEmail; /** + * @hibernate.property column="ACTIVE_INSTANCE" not-null="true" type="boolean" + */ + public boolean isActiveInstance() { + return activeInstance; + } + + public void setActiveInstance(boolean activeInstance) { + this.activeInstance = activeInstance; + } + + /** * Default constructor. */ public SAPInstanceDef() { Modified: trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java 2006-08-17 18:03:48 UTC (rev 113) +++ trunk/code/CSMiddleware/src/org/commsuite/sap/SAPCommManager.java 2006-08-19 10:36:10 UTC (rev 114) @@ -230,8 +230,9 @@ logger.info("Destroying instance: " + instanceName); checkExistenceOfSAPInstance(instanceName); final ISAPComm instance = sapComms.get(instanceName); + logger.debug("INSTANCE: "+ instance); + sapComms.remove(instance.getName()); instance.destroy(); - sapComms.remove(instance.getName()); logger.info("Instance destroyed: " + instanceName); } Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-08-17 18:03:48 UTC (rev 113) +++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-08-19 10:36:10 UTC (rev 114) @@ -36,6 +36,9 @@ import org.commsuite.ws.WebServiceException; /** + * This class provides all functionality connected with servers. It contains adding, + * and modyfing servers, deleting servers, and receiving servers list. + * * @since 1.0 * @author Szymon Kuzniak * @author Marcin Zduniak @@ -57,6 +60,18 @@ return instance; } + /** + * Returns servers list size. If def argument is null, then returns number + * of all servers, othrwise returns number of servers that matches def + * object + * + * @param def pattern for matching + * @param defaultSearch whether the default property should be contained in pattern + * @param loadSearch wether the loadBalancing propert should be contained in pattern + * @param unicodeSearch whether the unicode property should be contained in pattern + * @return number of servers matching criteria + * @throws WebServiceException when something goes wrong + */ public int getInstancesSize(WSSAPInstanceDef def, boolean defaultSearch, boolean loadSearch, boolean unicodeSearch) throws WebServiceException { try { @@ -73,6 +88,13 @@ } } + /** + * returns subset of all servers. subset contains instances from begin index to end + * @param begin index to start creating subset + * @param end index to end creatind subset + * @return list of servers from begin to end + * @throws WebServiceException when something goes wrong + */ public Collection<WSSAPInstanceDef> getInstancesSubset(int begin, int end) throws WebServiceException { try { final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext @@ -90,6 +112,11 @@ } } + /** + * returns all server instances + * @return list of SAPInstanceDef objects + * @throws WebServiceException when something goes wrong + */ public Collection<WSSAPInstanceDef> getAllInstances() throws WebServiceException { try { final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext @@ -107,6 +134,16 @@ } } + /** + * returns instances that matches pattern(def) + * + * @param def pattern for matching + * @param defaultSearch whether the default property should be contained in pattern + * @param loadSearch wether the loadBalancing propert should be contained in pattern + * @param unicodeSearch whether the unicode property should be contained in pattern + * @return list of SAPServerDef object that matches criteria + * @throws WebServiceException when something goes wrong + */ public Collection<WSSAPInstanceDef> getSelectedInstances(WSSAPInstanceDef def, boolean defaultSearch, boolean loadSearch, boolean unicodeSearch) throws WebServiceException { try { @@ -127,6 +164,18 @@ } + /** + * returns subset of instances that matches pattern(def). + * + * @param def pattern for matching + * @param defaultSearch whether the default property should be contained in pattern + * @param loadSearch wether the loadBalancing propert should be contained in pattern + * @param unicodeSearch whether the unicode property should be contained in pattern + * @param begin index to start creating subset + * @param end index to end creatind subset + * @return list of selected instances + * @throws WebServiceException when something goes wrong + */ public Collection<WSSAPInstanceDef> getSelectedInstancesSubset(WSSAPInstanceDef def, boolean defaultSearch, boolean loadSearch, boolean unicodeSearch, int begin, int end) throws WebServiceException { @@ -148,6 +197,12 @@ } + /** + * saves instance to database via SAPInstanceDefManager + * @param wsInstance instance to save + * @return saved instance + * @throws WebServiceException when something goes wrong + */ public WSSAPInstanceDef saveNewInstance(WSSAPInstanceDef wsInstance) throws WebServiceException { try { final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext @@ -174,6 +229,12 @@ } } + /** + * test instance + * @param serverName name of instance to test + * @return true if test is OK, false otherwise + * @throws WebServiceException when something goes wrong(ie. no instance found) + */ public boolean testServer(String serverName) throws WebServiceException { try { final ISAPCommManager sapMgr = SpringMiddlewareContext.getSAPCommManager(); @@ -191,6 +252,12 @@ } } + /** + * returns instance by id + * @param id id of desired instance + * @return instance of given id, if instance is not present returns null + * @throws WebServiceException when something goes wrong + */ public WSSAPInstanceDef getInstanceById(String id) throws WebServiceException { try { final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext @@ -203,6 +270,11 @@ } } + /** + * checks if all fields are properly filled + * @param def instance to validate + * @return true of fields are filled properly, false otherwise + */ private boolean validateInstance(WSSAPInstanceDef def) { boolean result = true; @@ -255,6 +327,12 @@ return result; } + /** + * tests if server isworking currently + * @param serverName name of serber to test + * @return true if server os working, false otherwise + * @throws WebServiceException when something goes wrong + */ public boolean isSapServerWorking(String serverName) throws WebServiceException { try { final ISAPCommManager sapMgr = SpringMiddlewareContext.getSAPCommManager(); @@ -268,6 +346,11 @@ } } + /** + * starts server if is stopped + * @param serverName server name to start + * @throws WebServiceException when something goes wrong + */ public void startSapServer(String serverName) throws WebServiceException { try { final ISAPCommManager sapMgr = SpringMiddlewareContext.getSAPCommManager(); @@ -278,6 +361,11 @@ } } + /** + * stops server if is working + * @param serverName server name to stop + * @throws WebServiceException when something goes wrong + */ public void stopSapServer(String serverName) throws WebServiceException { try { final ISAPCommManager sapMgr = SpringMiddlewareContext.getSAPCommManager(); @@ -288,6 +376,11 @@ } } + /** + * sets attributes for server + * @param wsInstance instance from attributes are taken + * @param instance instance to set attributes + */ private void setServerAttrs(WSSAPInstanceDef wsInstance, SAPInstanceDef instance) { instance.setAdminEmail(wsInstance.getAdminEmail()); instance.setClient(wsInstance.getClient()); @@ -307,15 +400,24 @@ instance.setUser(wsInstance.getUser()); } + /** + * deletes server from database + * @param id server id to delete + * @throws WebServiceException when something goes wrong + */ public void deletServer(String id) throws WebServiceException{ try { final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext .getSAPInstanceDefManager(); -// final ISAPCommManager sapMgr = SpringMiddlewareContext.getSAPCommManager(); -// sapMgr.destroyInstance(instManager.getSAPInstanceDef(id).getName()); + logger.debug("destroy instance, id: "+ id); + final ISAPCommManager sapMgr = SpringMiddlewareContext.getSAPCommManager(); + SAPInstanceDef instance = instManager.getSAPInstanceDef(id); + + sapMgr.destroyInstance(instance.getName()); + logger.debug("destroy successfull, serverId: "+ id); instManager.deleteSAPInstanceDef(id); } catch(Throwable t) { - logger.fatal("error in getInstancesSize method", t); + logger.fatal("error in deleteServer method", t); throw new WebServiceException(t); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-08-17 18:12:12
      
     | 
| Revision: 113 Author: skuzniak Date: 2006-08-17 11:03:48 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=113&view=rev Log Message: ----------- password issue in servers edition fixed. Modified Paths: -------------- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/AddSapServerBean.java trunk/code/CSAdminPanel/WebContent/pages/menus/CSMenuServers.jsp trunk/code/CSAdminPanel/WebContent/pages/servers/CSServerEdit.jsp trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java Modified: trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/AddSapServerBean.java =================================================================== --- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/AddSapServerBean.java 2006-08-17 16:26:50 UTC (rev 112) +++ trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/AddSapServerBean.java 2006-08-17 18:03:48 UTC (rev 113) @@ -69,9 +69,7 @@ instance.setGwserv(this.gwserv); instance.setHost(this.host); instance.setLoadBalancing(this.loadBalancing); - logger.debug("setting maxconnectionsinpool"); instance.setMaxConnectionsInPool(this.maxConnectionsInPool); - logger.debug("after setting maxconnectionsinpool"); instance.setName(this.name); instance.setPassword(this.password); instance.setProgid(this.progid); @@ -80,7 +78,9 @@ instance.setUnicode(this.unicode); instance.setUser(this.user); - if (!this.confPassword.equals(this.password)) throw new IllegalArgumentException(PASSWORD_ERROR_CODE); + if (null == this.password) { + if (!this.confPassword.equals(this.password)) throw new IllegalArgumentException(PASSWORD_ERROR_CODE); + } if (this.isLoadBalancing() && (null == this.group || "".equals(this.group))) { return null; @@ -119,7 +119,9 @@ instance.setUnicode(this.unicode); instance.setUser(this.user); - if (!this.confPassword.equals(this.password)) throw new IllegalArgumentException(PASSWORD_ERROR_CODE); + if (null == this.password) { + if (!this.confPassword.equals(this.password)) throw new IllegalArgumentException(PASSWORD_ERROR_CODE); + } if (this.isLoadBalancing() && (null == this.group || "".equals(this.group))) { return null; @@ -165,7 +167,7 @@ return componentName; } } catch (WebServiceException wse) { - logger.fatal("Exception while adding user to database", wse); + logger.fatal("Exception while adding server to database", wse); componentName = (null == this.serverId ? BeansUtils.ADD_SERVER_NAVIGATION : BeansUtils.EDIT_SERVER_NAVIGATION); LanguageSelectionBean.showMessage(BeansUtils.MESSAGE_ERROR_DATABASE, BeansUtils.MESSAGE_SERVER_ERROR_ADD, @@ -216,4 +218,21 @@ } } + public String addNewServer() { + this.serverId = null; + this.setAdminEmail(""); + this.setClient(""); + this.setGroup(""); + this.setGwhost(""); + this.setGwserv(""); + this.setHost(""); + this.setMaxConnectionsInPool(0); + this.setName(""); + this.setPassword(""); + this.setProgid(""); + this.setR3name(""); + this.setSystemNumber(""); + this.setUser(""); + return BeansUtils.ADD_SERVER_NAVIGATION; + } } Modified: trunk/code/CSAdminPanel/WebContent/pages/menus/CSMenuServers.jsp =================================================================== --- trunk/code/CSAdminPanel/WebContent/pages/menus/CSMenuServers.jsp 2006-08-17 16:26:50 UTC (rev 112) +++ trunk/code/CSAdminPanel/WebContent/pages/menus/CSMenuServers.jsp 2006-08-17 18:03:48 UTC (rev 113) @@ -8,7 +8,8 @@ <h:outputText value="Menu" styleClass="view-header"/> </f:facet> <h:panelGrid columns="1" width="100%"> - <h:commandLink value="#{Locale.MENU_ADD_INSTANCE}" action="addServer" styleClass="header-command" /> + <h:commandLink value="#{Locale.MENU_ADD_INSTANCE}" action="#{addSapServerBean.addNewServer}" + styleClass="header-command" /> </h:panelGrid> <h:panelGrid columns="1" width="100%"> <h:commandLink value="#{Locale.MENU_LIST_INSTANCES}" action="searchServers" styleClass="header-command"/> Modified: trunk/code/CSAdminPanel/WebContent/pages/servers/CSServerEdit.jsp =================================================================== --- trunk/code/CSAdminPanel/WebContent/pages/servers/CSServerEdit.jsp 2006-08-17 16:26:50 UTC (rev 112) +++ trunk/code/CSAdminPanel/WebContent/pages/servers/CSServerEdit.jsp 2006-08-17 18:03:48 UTC (rev 113) @@ -148,7 +148,6 @@ </h:panelGrid> <h:inputSecret id="userPassword" value="#{addSapServerBean.password}"> <f:validator validatorId="shortLenghtValidator" /> - <f:converter converterId="emptyFieldValidatorConverter" /> </h:inputSecret> <h:panelGrid columns="1"> @@ -157,7 +156,6 @@ </h:panelGrid> <h:inputSecret value="#{addSapServerBean.confPassword}"> <f:validator validatorId="shortLenghtValidator" /> - <f:converter converterId="emptyFieldValidatorConverter" /> </h:inputSecret> <h:panelGrid columns="1"> Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-08-17 16:26:50 UTC (rev 112) +++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-08-17 18:03:48 UTC (rev 113) @@ -160,9 +160,10 @@ } else { instance = instManager.getSAPInstanceDef(wsInstance.getId().toString()); setServerAttrs(wsInstance, instance); + sapCommManager.setSapInstance(instance); } - if (valiedateInstance(instance)) { + if (validateInstance(instance)) { return instManager.saveSAPInstanceDef(instance); } else { throw new WebServiceException(CommunicateUtils.DATA_INTEGRITY_VIOLATION_SERVER); @@ -202,12 +203,12 @@ } } - private boolean valiedateInstance(WSSAPInstanceDef def) { + private boolean validateInstance(WSSAPInstanceDef def) { boolean result = true; if (null == def.getUser() || "".equals(def.getUser()) || null == def.getProgid() || "".equals(def.getProgid()) - || null == def.getPassword() || "".equals(def.getPassword()) +// || null == def.getPassword() || "".equals(def.getPassword()) || null == def.getClient() || "".equals(def.getClient()) || null == def.getName() || "".equals(def.getName()) || null == def.getHost() || "".equals(def.getHost()) @@ -215,6 +216,11 @@ result = false; } + if (null == def.getId() && + (null == def.getPassword() || "".equals(def.getPassword()))) { + result = false; + } + if (def.getAdminEmail().length() > CommunicateUtils.MAX_LENGHT_BIGGER || def.getClient().length() > CommunicateUtils.MAX_LENGHT_LOWER || def.getGroup().length() > CommunicateUtils.MAX_LENGHT_LOWER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-08-17 16:27:21
      
     | 
| Revision: 112 Author: skuzniak Date: 2006-08-17 09:26:50 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=112&view=rev Log Message: ----------- showing content of messages foxed Modified Paths: -------------- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/FilePresentator.java trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java Property Changed: ---------------- trunk/code/CSAdminPanel/WebContent/pages/files/ trunk/code/CSMiddleware/lib/ Modified: trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/FilePresentator.java =================================================================== --- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/FilePresentator.java 2006-08-07 18:57:07 UTC (rev 111) +++ trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/servlet/FilePresentator.java 2006-08-17 16:26:50 UTC (rev 112) @@ -100,7 +100,7 @@ // prevent file caching: res.setHeader("Pragma", "no-cache"); res.setHeader("Expires", "0"); - res.setContentType("text/html"); +// res.setContentType("text/html"); res.setCharacterEncoding("UTF-8"); } Property changes on: trunk/code/CSAdminPanel/WebContent/pages/files ___________________________________________________________________ Name: svn:ignore - Nowy folder + Nowy folder Thumbs.db Property changes on: trunk/code/CSMiddleware/lib ___________________________________________________________________ Name: svn:ignore + sapjco.jar Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-08-07 18:57:07 UTC (rev 111) +++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-08-17 16:26:50 UTC (rev 112) @@ -305,6 +305,8 @@ try { final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext .getSAPInstanceDefManager(); +// final ISAPCommManager sapMgr = SpringMiddlewareContext.getSAPCommManager(); +// sapMgr.destroyInstance(instManager.getSAPInstanceDef(id).getName()); instManager.deleteSAPInstanceDef(id); } catch(Throwable t) { logger.fatal("error in getInstancesSize method", t); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <ma...@us...> - 2006-08-07 18:57:27
      
     | 
| Revision: 111 Author: marasm Date: 2006-08-07 11:57:07 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=111&view=rev Log Message: ----------- middleware no longer depends on cstest message mapping corrected Modified Paths: -------------- trunk/code/CSMiddleware/build.xml trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml trunk/code/CSMiddleware/src/org/commsuite/model/Message.java Modified: trunk/code/CSMiddleware/build.xml =================================================================== --- trunk/code/CSMiddleware/build.xml 2006-08-03 06:00:35 UTC (rev 110) +++ trunk/code/CSMiddleware/build.xml 2006-08-07 18:57:07 UTC (rev 111) @@ -223,7 +223,6 @@ </copy> <!-- SQL --> <copy file="${sql.middleware.import}" tofile="${tmp.sql.middleware.import}" failonerror="true" overwrite="true" /> - <copy file="${sql.unit-tests.import}" tofile="${tmp.sql.unit-tests.import}" failonerror="true" overwrite="true" /> <antcall target="compile:middleware:javac" /> <copy todir="${tmp.build.middleware.dir}" filtering="true"> @@ -280,6 +279,7 @@ <target name="build:unit-tests" description="Compile main source tree java files for Unit-tests project into class files, generate jar files. You MUST manually invoke 'init' task."> <!-- Copying files (firstly: common ones, then project-specific) --> <!-- SRC --> + <copy file="${sql.unit-tests.import}" tofile="${tmp.sql.unit-tests.import}" failonerror="true" overwrite="true" /> <copy todir="${tmp.src.unit-tests.dir}"> <fileset dir="${src.common.dir}" /> </copy> Modified: trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml 2006-08-03 06:00:35 UTC (rev 110) +++ trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml 2006-08-07 18:57:07 UTC (rev 111) @@ -7,7 +7,7 @@ <id name="id"> <generator class="native"> <param name="sequence">CS_MESSAGES_SEQ</param> - <param name="parameters">INCREMENT BY 1 START</param> + <param name="parameters">INCREMENT BY 1 START WITH 100</param> </generator> </id> <property name="creationDate" not-null="true" type="timestamp" column="CREATION_DATE"/> Modified: trunk/code/CSMiddleware/src/org/commsuite/model/Message.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/Message.java 2006-08-03 06:00:35 UTC (rev 110) +++ trunk/code/CSMiddleware/src/org/commsuite/model/Message.java 2006-08-07 18:57:07 UTC (rev 111) @@ -196,8 +196,7 @@ /** * @hibernate.id generator-class="native" * @hibernate.generator-param name="sequence" value="CS_MESSAGES_SEQ" - * @hibernate.generator-param name="parameters" value="INCREMENT BY 1 START - * WITH 100" + * @hibernate.generator-param name="parameters" value="INCREMENT BY 1 START WITH 100" */ public Long getId() { return super.id; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <zd...@us...> - 2006-08-03 06:00:58
      
     | 
| Revision: 110 Author: zduniak Date: 2006-08-02 23:00:35 -0700 (Wed, 02 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=110&view=rev Log Message: ----------- UncaughtExceptions handler added to SAP JCo threads Modified Paths: -------------- trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java Modified: trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java 2006-08-02 21:43:23 UTC (rev 109) +++ trunk/code/CSMiddleware/src/org/commsuite/sap/SAPComm.java 2006-08-03 06:00:35 UTC (rev 110) @@ -20,6 +20,7 @@ */ package org.commsuite.sap; +import java.lang.Thread.UncaughtExceptionHandler; import java.util.Date; import java.util.Properties; @@ -34,6 +35,7 @@ import org.commsuite.notification.Notification; import org.commsuite.util.SpringMiddlewareBeansConstants; import org.commsuite.util.SpringMiddlewareContext; +import org.hibernate.hql.ast.tree.UnaryOperatorNode; import com.sap.mw.jco.IRepository; import com.sap.mw.jco.JCO; @@ -95,7 +97,7 @@ /** * Inner definition of JCO-based server. */ - /* package scope */class JCOServer extends JCO.Server implements IJCOServer { + /* package scope */class JCOServer extends JCO.Server implements IJCOServer, UncaughtExceptionHandler { private final Logger logger = Logger.getLogger(SAPComm.JCOServer.class); @@ -104,6 +106,7 @@ /* package scope */JCOServer() { super(SAPComm.this.getLogonProperties(), SAPComm.this.repository); logger.info("Server registering properties: " + SAPComm.this.getLogonProperties()); + super.getThread().setUncaughtExceptionHandler(this); JCO.Client client = null; try { client = SAPComm.this.getJCOClient(); @@ -177,7 +180,17 @@ public void serverErrorOccurred(JCO.Server server, Error error) { logger.fatal("Error in server: " + SAPComm.this.instanceDef.getName() + "[ProgID: " + server.getProgID() + "]", error); + + // TODO: consider stopping SAP server in exceptional situation: + // stopServer(); } + + public void uncaughtException(Thread t, Throwable e) { + logger.fatal("UncaughtException in server: " + SAPComm.this.instanceDef.getName(), e); + + // TODO: consider stopping SAP server in exceptional situation: + // stopServer(); + } } public IJCOServer getServer() { @@ -554,6 +567,7 @@ /** * @see java.lang.Object#toString() */ + @Override public String toString() { return new ToStringBuilder(this).append("name", this.getName()).append(" initiated", this.initiated).append(" default", this.isDefault()).append( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <ma...@us...> - 2006-08-02 22:41:24
      
     | 
| Revision: 109 Author: marasm Date: 2006-08-02 14:43:23 -0700 (Wed, 02 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=109&view=rev Log Message: ----------- Mimetypes can be detected now Modified Paths: -------------- trunk/code/CSRemoteClient/src/org/commsuite/client/GUI.java trunk/code/CSRemoteClient/src/org/commsuite/client/MessagePanel.java trunk/code/CSRemoteClient/src/org/commsuite/client/RemoteClientAppContext.java trunk/code/CSRemoteClient/src/remoteClientContext.xml Added Paths: ----------- trunk/code/CSRemoteClient/src/org/commsuite/utils/CSMimeTypesMap.java Modified: trunk/code/CSRemoteClient/src/org/commsuite/client/GUI.java =================================================================== --- trunk/code/CSRemoteClient/src/org/commsuite/client/GUI.java 2006-08-01 12:34:28 UTC (rev 108) +++ trunk/code/CSRemoteClient/src/org/commsuite/client/GUI.java 2006-08-02 21:43:23 UTC (rev 109) @@ -39,7 +39,6 @@ import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; -import javax.activation.MimetypesFileTypeMap; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; @@ -95,16 +94,16 @@ private JCheckBox addFile; private JScrollPane scroll; - + private JLabel sizeLabel; private JTextField serverAddress; private JTextField login; - private JPasswordField password; + private JPasswordField password; - private JTextField receiverAddress; + private JTextField receiverAddress; private JTextArea path; @@ -114,7 +113,7 @@ private JComboBox typeList, serverList; - private JProgressBar progress; + private JProgressBar progress; private String mimeType; @@ -123,33 +122,33 @@ private ArrayList serverStrings = new ArrayList(); private int isFrame = 0; - + private JFrame frame; - + private String valueServer; - - private String valueReceiver; - - private String valueLogin; - + + private String valueReceiver; + + private String valueLogin; + private String valuePassword; - + private String key; - + private JMenuItem messagesMenu; byte[] serverTextCombo; - + private boolean isRunning = false; private String fileName; - + public MessageFrame messagesFrame = null; - + Preferences prefs; - + List messages; - + public GUI(JFrame owner) { this.owner = owner; owner.setPreferredSize(new Dimension(400, 400)); @@ -164,6 +163,7 @@ /** * Initialize graphic interface + * * @throws Exception */ private void init() throws Exception { @@ -281,7 +281,7 @@ c.gridx = 0; c.gridy = 0; smsPanel.add(scroll, c); - + addFile = new JCheckBox("add file"); c.ipady = 1; c.gridx = 0; @@ -291,13 +291,13 @@ JPanel openPanel = new JPanel(); openPanel.setPreferredSize(new Dimension(400, 20)); openPanel.setLayout(new GridBagLayout()); - + openButton = new JButton("Open file"); c.weightx = 0.5; c.gridx = 0; c.gridy = 0; openPanel.add(openButton, c); - + path = new JTextArea(); path.setEditable(false); path.setLineWrap(true); @@ -306,7 +306,7 @@ c.gridx = 1; c.gridy = 0; openPanel.add(path, c); - + if (typeList.getSelectedItem().equals("SMS")) { smsText.setVisible(true); scroll.setVisible(true); @@ -326,29 +326,30 @@ JPanel progressPanel = new JPanel(); progressPanel.setPreferredSize(new Dimension(400, 20)); progressPanel.setLayout(new BoxLayout(progressPanel, BoxLayout.X_AXIS)); - + progress = new JProgressBar(); - progress.setPreferredSize( new Dimension( 300, 20 ) ); - progress.setMinimum( 0 ); - progress.setMaximum( 20 ); - progress.setValue( 0 ); - progress.setBounds( 20, 35, 260, 20 ); + progress.setPreferredSize(new Dimension(300, 20)); + progress.setMinimum(0); + progress.setMaximum(20); + progress.setValue(0); + progress.setBounds(20, 35, 260, 20); progress.setIndeterminate(true); progress.setVisible(false); - progressPanel.add( progress ); - + progressPanel.add(progress); + JMenuBar menuBar = new JMenuBar(); JMenu menu = new JMenu("Configuration"); menu.setMnemonic(KeyEvent.VK_C); menuBar.add(menu); - - JMenuItem menuItem = new JMenuItem("Add new configuration", KeyEvent.VK_A); + + JMenuItem menuItem = new JMenuItem("Add new configuration", + KeyEvent.VK_A); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.ALT_MASK)); menuItem.addActionListener(log); menu.add(menuItem); - - // clear + + // clear menuItem = new JMenuItem("Delete configuration"); menuItem.setMnemonic(KeyEvent.VK_T); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, @@ -356,7 +357,7 @@ menuItem.addActionListener(clear); menu.add(menuItem); - //quit + // quit menuItem = new JMenuItem("Quit"); menuItem.setMnemonic(KeyEvent.VK_Q); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, @@ -364,11 +365,11 @@ menuItem.addActionListener(quit); menu.addSeparator(); menu.add(menuItem); - + menu = new JMenu("Messages"); menu.setMnemonic(KeyEvent.VK_M); menuBar.add(menu); - + messagesMenu = new JMenuItem("Show messages", KeyEvent.VK_S); messagesMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.ALT_MASK)); @@ -404,37 +405,44 @@ message = "Port out of range"; } else if (t instanceof ConnectException) { message = "Problem with connection"; - } + } } else { if (t instanceof WebServiceException) { - message = ((WebServiceException)t).getFaultString(); - } + message = ((WebServiceException) t).getFaultString(); + } } - } else if (t instanceof DatabaseException || t instanceof UnsupportedEncodingException) { + } else if (t instanceof DatabaseException + || t instanceof UnsupportedEncodingException) { message = "Error with database occured"; } else if (t instanceof ServiceException) { message = "Unknown protocol"; } + if (t.getMessage() != null && t.getMessage().indexOf("RC:") == 0) { + message = t.getMessage().substring(3); + } + if (message.equals("Unknown error")) { logger.fatal("CAN'T RECOGNIZE THIS EXCEPTION: ", t); } - JOptionPane.showMessageDialog(owner, message, "Error", JOptionPane.ERROR_MESSAGE); + + JOptionPane.showMessageDialog(owner, message, "Error", + JOptionPane.ERROR_MESSAGE); } /** * Creates new window depending on value of isFrame - * + * */ public JFrame makeNewWindow() { Point lastLocation = null; int maxX = 500; int maxY = 500; - + if (isFrame == 0) { frame = new LoginFrame(this); } else { - if (isFrame == 1){ - frame = new MessageFrame(this,messages); + if (isFrame == 1) { + frame = new MessageFrame(this, messages); } else { frame = new ClearFrame(this); } @@ -455,7 +463,7 @@ /** * Updates ComboBox in main frame and adds new configuration - * + * */ public void configure() { prefs = Preferences.userNodeForPackage(getClass()); @@ -474,16 +482,16 @@ if (-1 != index) { key = keys[i].substring(0, index); int indexPlus = keys[i].indexOf("+"); - if (-1 != indexPlus){ - comboKey = keys[i].substring(0,indexPlus); - if (comboKey.equals(key+"/serverText")){ + if (-1 != indexPlus) { + comboKey = keys[i].substring(0, indexPlus); + if (comboKey.equals(key + "/serverText")) { serverStrings.add(key); } } } } serverList.removeAllItems(); - for(int i = 0; i < serverStrings.size(); i++) { + for (int i = 0; i < serverStrings.size(); i++) { serverList.addItem(serverStrings.get(i)); } } catch (BackingStoreException e1) { @@ -492,8 +500,6 @@ } } - - ActionListener log = new ActionListener() { public void actionPerformed(ActionEvent e) { isFrame = 0; @@ -514,18 +520,20 @@ owner.dispose(); } }; - + ActionListener clear = new ActionListener() { public void actionPerformed(ActionEvent e) { try { - if (prefs.keys().length == 0){ - JOptionPane.showMessageDialog(null, "You didn't save any configuration", "Info", JOptionPane.INFORMATION_MESSAGE); + if (prefs.keys().length == 0) { + JOptionPane.showMessageDialog(null, + "You didn't save any configuration", "Info", + JOptionPane.INFORMATION_MESSAGE); } else { isFrame = 2; frameRun(); if (!isRunning) { makeNewWindow(); - } + } } } catch (BackingStoreException e1) { // TODO Auto-generated catch block @@ -547,10 +555,13 @@ if (-1 != index) { key = keys[i].substring(0, index); if (selected != null && selected.equals(key)) { - valueServer = prefs.get(key + "/serverText+", "value"); + valueServer = prefs.get(key + "/serverText+", + "value"); valueLogin = prefs.get(key + "/loginText", "value"); - valuePassword = prefs.get(key + "/passwordText", "value"); - valueReceiver = prefs.get(key + "/receiverText", "value"); + valuePassword = prefs.get(key + "/passwordText", + "value"); + valueReceiver = prefs.get(key + "/receiverText", + "value"); } } } @@ -583,7 +594,6 @@ } }; - ItemListener newFile = new ItemListener() { public void itemStateChanged(ItemEvent e) { if (typeList.getSelectedItem().equals("SMS")) { @@ -611,7 +621,6 @@ } } }; - ItemListener format = new ItemListener() { public void itemStateChanged(ItemEvent e) { @@ -639,24 +648,54 @@ ActionListener open = new ActionListener() { public void actionPerformed(ActionEvent e) { + fileName = null; + path.setText(""); + data = null; + mimeType = null; JFileChooser fc = new JFileChooser(); fc.showOpenDialog(owner); if (fc.getSelectedFile() != null) { + String tempFileName = fc.getSelectedFile().getName(); + + mimeType = RemoteClientAppContext.getMimetypesMap() + .getContentType(fc.getSelectedFile()); + + if (mimeType.equals("application/octet-stream")) { + showException(new Exception("RC:Format of file \"" + + tempFileName + "\" is not supported")); + fc.setSelectedFile(null); + mimeType = null; + return; + } + + if (typeList.getSelectedIndex() == 1 + && !mimeType.equals("text/plain")) { + showException(new Exception("RC:Format of file \"" + + tempFileName + + "\" is not supported for sending SMS")); + fc.setSelectedFile(null); + return; + } + data = IOUtil.readFile(fc.getSelectedFile().getPath()); path.setText(fc.getSelectedFile().getPath()); - fileName = fc.getSelectedFile().getName(); + fileName = tempFileName; long sizeOfFile = fc.getSelectedFile().length(); NumberFormat formater = new DecimalFormat("0.##"); if (sizeOfFile < 1024) { size.setText(String.valueOf(sizeOfFile) + " B"); } else { if (sizeOfFile < 1048576) { - size.setText(String.valueOf(formater.format(sizeOfFile / 1024.0)) + " KB"); + size.setText(String.valueOf(formater + .format(sizeOfFile / 1024.0)) + + " KB"); } else { - size.setText(String.valueOf(formater.format(sizeOfFile / 1048576.0)) + " MB"); + size.setText(String.valueOf(formater + .format(sizeOfFile / 1048576.0)) + + " MB"); } } - mimeType = new MimetypesFileTypeMap().getContentType(fc.getSelectedFile()); + } } @@ -674,7 +713,9 @@ if (!addFile.isSelected()) { data = smsText.getText().getBytes(); if (data == null || data.length == 0) { - JOptionPane.showMessageDialog(null, "You can't send empty messages", "Info", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, + "You can't send empty messages", "Info", + JOptionPane.INFORMATION_MESSAGE); return; } mimeType = "text/plain"; @@ -684,40 +725,61 @@ } if ((serverText.equals("")) || (loginText.equals("")) || (passwordText.equals("")) || (receiverText.equals(""))) { - JOptionPane.showMessageDialog(owner, "You haven't filled all required fields", "Error", + JOptionPane.showMessageDialog(owner, + "You haven't filled all required fields", "Error", JOptionPane.ERROR_MESSAGE); } else { - if (!mimeType.equals("text/plain") && (formatType == FormatType.SMS)) { - JOptionPane.showMessageDialog(owner, "You can't send this file in SMS message", "Error", + if (null == mimeType) { + JOptionPane.showMessageDialog(owner, + "Please select file to send", "Error", JOptionPane.ERROR_MESSAGE); + } else if (!mimeType.equals("text/plain") + && (formatType == FormatType.SMS)) { + JOptionPane.showMessageDialog(owner, + "You can't send this file in SMS message", "Error", + JOptionPane.ERROR_MESSAGE); } else { new Thread(new Runnable() { public void run() { progress.setVisible(true); sendButton.setEnabled(false); messagesMenu.setEnabled(false); - RemoteClientMessage rcMessage = new RemoteClientMessage(serverText, loginText, passwordText, receiverText, data, mimeType); + RemoteClientMessage rcMessage = new RemoteClientMessage( + serverText, loginText, passwordText, + receiverText, data, mimeType); rcMessage.setFileName(fileName); logger.info("New thread sending message started"); logger.info("Message: " + rcMessage.toString()); try { - String messageServerId = CommunicateUtil.sendMessage(rcMessage, formatType); - logger.info("MESSAGE SENT! ID RECEIVED: " + messageServerId); + String messageServerId = CommunicateUtil + .sendMessage(rcMessage, formatType); + logger.info("MESSAGE SENT! ID RECEIVED: " + + messageServerId); rcMessage.setMessageServerId(messageServerId); - rcMessage = MessageSavingUtil.saveMessage(rcMessage); - logger.info("Message saved to db after sending successfully"); + rcMessage = MessageSavingUtil + .saveMessage(rcMessage); + logger + .info("Message saved to db after sending successfully"); logger.info("Message: " + rcMessage.toString()); progress.setVisible(false); sendButton.setEnabled(true); messagesMenu.setEnabled(true); - JOptionPane.showMessageDialog(null, "Message processed successfully", "Info", JOptionPane.INFORMATION_MESSAGE); - } catch (Throwable e){ - logger.error("Error while sending message - connection error", e); + JOptionPane + .showMessageDialog( + null, + "Message processed successfully", + "Info", + JOptionPane.INFORMATION_MESSAGE); + } catch (Throwable e) { + logger + .error( + "Error while sending message - connection error", + e); progress.setVisible(false); sendButton.setEnabled(true); messagesMenu.setEnabled(true); showException(e); - } + } } }).start(); @@ -726,15 +788,16 @@ } }; - + /** * Checks if any frame is visible + * * @return isRunning true if frame is visible */ - + public boolean frameRun() { - if (frame instanceof JFrame){ - if (frame.isShowing()){ + if (frame instanceof JFrame) { + if (frame.isShowing()) { isRunning = true; } else { isRunning = false; @@ -742,7 +805,7 @@ } return isRunning; } - + public void reloadMessagesFrame() { try { messages = MessageSavingUtil.loadMessages(); @@ -754,17 +817,18 @@ if (null != messagesFrame) { messagesFrame.setVisible(false); messagesFrame.dispose(); - } + } if (messages.size() == 0) { - JOptionPane.showMessageDialog(null, "No messages saved", "Info", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, "No messages saved", "Info", + JOptionPane.INFORMATION_MESSAGE); return; } isFrame = 1; frameRun(); - messagesFrame = (MessageFrame)makeNewWindow(); - + messagesFrame = (MessageFrame) makeNewWindow(); + } - + final ActionListener check = new ActionListener() { public void actionPerformed(ActionEvent e) { reloadMessagesFrame(); Modified: trunk/code/CSRemoteClient/src/org/commsuite/client/MessagePanel.java =================================================================== --- trunk/code/CSRemoteClient/src/org/commsuite/client/MessagePanel.java 2006-08-01 12:34:28 UTC (rev 108) +++ trunk/code/CSRemoteClient/src/org/commsuite/client/MessagePanel.java 2006-08-02 21:43:23 UTC (rev 109) @@ -142,7 +142,7 @@ } private String dateToString(Date date) { - SimpleDateFormat formatter = new SimpleDateFormat("d MMM yyyy H:mm:ss"); + SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy H:mm:ss"); return formatter.format(date); } Modified: trunk/code/CSRemoteClient/src/org/commsuite/client/RemoteClientAppContext.java =================================================================== --- trunk/code/CSRemoteClient/src/org/commsuite/client/RemoteClientAppContext.java 2006-08-01 12:34:28 UTC (rev 108) +++ trunk/code/CSRemoteClient/src/org/commsuite/client/RemoteClientAppContext.java 2006-08-02 21:43:23 UTC (rev 109) @@ -20,6 +20,8 @@ */ package org.commsuite.client; +import javax.activation.MimetypesFileTypeMap; + import org.commsuite.model.RemoteClientMessageDao; import org.commsuite.remotews.IMessagingWSLocator; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -47,5 +49,9 @@ public static RemoteClientMessageDao getMessageDao() { return (RemoteClientMessageDao) appCtx.getBean("messageDao"); } + + public static MimetypesFileTypeMap getMimetypesMap() { + return (MimetypesFileTypeMap) appCtx.getBean("mimetypeMap"); + } } Added: trunk/code/CSRemoteClient/src/org/commsuite/utils/CSMimeTypesMap.java =================================================================== --- trunk/code/CSRemoteClient/src/org/commsuite/utils/CSMimeTypesMap.java (rev 0) +++ trunk/code/CSRemoteClient/src/org/commsuite/utils/CSMimeTypesMap.java 2006-08-02 21:43:23 UTC (rev 109) @@ -0,0 +1,15 @@ +package org.commsuite.utils; + +import java.util.List; + +import javax.activation.MimetypesFileTypeMap; + +public class CSMimeTypesMap extends MimetypesFileTypeMap { + + public CSMimeTypesMap(List mimetypes) { + super(); + for (int i = 0; i < mimetypes.size(); i++) { + addMimeTypes((String)mimetypes.get(i)); + } + } +} Modified: trunk/code/CSRemoteClient/src/remoteClientContext.xml =================================================================== --- trunk/code/CSRemoteClient/src/remoteClientContext.xml 2006-08-01 12:34:28 UTC (rev 108) +++ trunk/code/CSRemoteClient/src/remoteClientContext.xml 2006-08-02 21:43:23 UTC (rev 109) @@ -3,8 +3,45 @@ <beans> - <bean id="messageDao" class="org.commsuite.model.RemoteClientMessageDaoImpl" /> - + <bean id="messageDao" + class="org.commsuite.model.RemoteClientMessageDaoImpl" /> + <bean id="messaging" class="org.commsuite.remotews.IMessagingWSLocator" /> - + + <bean id="mimetypeMap" class="org.commsuite.utils.CSMimeTypesMap" singleton="true"> + <constructor-arg> + <list> + <value>application/pdf pdf PDF</value> + <value>application/postscript ai AI</value> + <value>application/postscript eps EPS</value> + <value>application/postscript ps PS</value> + <value>application/rtf rtf RTF</value> + <value>text/plain c C</value> + <value>text/plain h H</value> + <value>text/plain txt TXT</value> + <value>image/tiff tif TIF</value> + <value>image/tiff tiff TIFF</value> + <value>image/jpeg jpe JPE</value> + <value>image/jpeg jpeg JPEG</value> + <value>image/jpeg jpg JPG</value> + <value>image/gif gif GIF</value> + <value>image/png png PNG</value> + <value>image/bmp bmp BMP</value> + <value>application/msword doc DOC</value> + <value>application/msword dot DOT</value> + <value>text/html htm HTM</value> + <value>text/html html HTML</value> + <value>text/html stm STM</value> + <value>application/vnd.oasis.opendocument.text odt ODT</value> + <value>application/vnd.oasis.opendocument.presentation odp ODP</value> + <value>application/vnd.oasis.opendocument.spreadsheet ods ODS</value> + <value>application/mspowerpoint ppt PPT</value> + <value>application/vnd.sun.xml.calc sxc SXC</value> + <value>application/vnd.sun.xml.draw sxd SXD</value> + <value>application/vnd.sun.xml.impress sxi SXI</value> + <value>application/vnd.sun.xml.writer sxw SXW</value> + <value>application.excel xls XLS</value> + </list> + </constructor-arg> + </bean> </beans> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <mal...@us...> - 2006-08-01 12:34:37
      
     | 
| Revision: 108 Author: malinowskirafal Date: 2006-08-01 05:34:28 -0700 (Tue, 01 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=108&view=rev Log Message: ----------- poprawki marasa Modified Paths: -------------- trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml trunk/code/CSMiddleware/src/org/commsuite/model/Message.java Modified: trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java 2006-08-01 12:27:08 UTC (rev 107) +++ trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java 2006-08-01 12:34:28 UTC (rev 108) @@ -162,9 +162,14 @@ * @hibernate.property column="DESCRIPTION" not-null="false" */ public String getDescription() { - final int length = Math.min(27, description.length()); - String shortDescription = description.substring(0, length); - return (description.length() > 27) ? shortDescription.concat("...") : description; + if (null != description) { + final int length = Math.min(27, description.length()); + String shortDescription = description.substring(0, length); + return (description.length() > 27) ? shortDescription.concat("...") + : description; + } else { + return null; + } } public void setDescription(String description) { Modified: trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml 2006-08-01 12:27:08 UTC (rev 107) +++ trunk/code/CSMiddleware/src/org/commsuite/model/Message.hbm.xml 2006-08-01 12:34:28 UTC (rev 108) @@ -7,7 +7,7 @@ <id name="id"> <generator class="native"> <param name="sequence">CS_MESSAGES_SEQ</param> - <param name="parameters">INCREMENT BY 1 START WITH 100</param> + <param name="parameters">INCREMENT BY 1 START</param> </generator> </id> <property name="creationDate" not-null="true" type="timestamp" column="CREATION_DATE"/> Modified: trunk/code/CSMiddleware/src/org/commsuite/model/Message.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/Message.java 2006-08-01 12:27:08 UTC (rev 107) +++ trunk/code/CSMiddleware/src/org/commsuite/model/Message.java 2006-08-01 12:34:28 UTC (rev 108) @@ -48,540 +48,544 @@ */ public class Message extends BaseObject implements Cloneable, WSMessage { - private static final long serialVersionUID = 6727639637472631600L; - - private static final Logger logger = Logger.getLogger(Message.class); + private static final long serialVersionUID = 6727639637472631600L; - /* - * Fields of the message: - */ - private SAPInstanceDef sapInstanceDefOwner; + private static final Logger logger = Logger.getLogger(Message.class); - private User userOwner; + /* + * Fields of the message: + */ + private SAPInstanceDef sapInstanceDefOwner; - private Direction direction; + private User userOwner; - private FormatType formatType; + private Direction direction; - private Status status; + private FormatType formatType; - /** - * Unique ID that was generated and assigned to the message by SAP R/3 system. - */ - private String sapID; + private Status status; - /** - * Could be: - * <ul> - * <li>e-mail address according to RFC822 in the form <local>@<domain>(241), eg: - * jo...@bc...</li> - * <li>Pager address in the form <service>(4):<number>(30), eg: SMS:48600223344</li> - * <li>!!! SAP User, REVIEW IT !!! - * </ul> - */ - private String receiver; + /** + * Unique ID that was generated and assigned to the message by SAP R/3 + * system. + */ + private String sapID; - private String sender; + /** + * Could be: + * <ul> + * <li>e-mail address according to RFC822 in the form <local>@<domain>(241), + * eg: jo...@bc...</li> + * <li>Pager address in the form <service>(4):<number>(30), eg: + * SMS:48600223344</li> + * <li>!!! SAP User, REVIEW IT !!! + * </ul> + */ + private String receiver; - /** - * Date on which the object was sent. - */ - private Date sendDate; + private String sender; - /** - * Date on which the object was created. - */ - private Date creationDate; + /** + * Date on which the object was sent. + */ + private Date sendDate; - /** - * Date on which the object was lastly processed. - */ - private Date lastProcessDate; + /** + * Date on which the object was created. + */ + private Date creationDate; - /** - * Understandable for humans message of the last processing action (could be error message, or - * successful message). - */ - private String lastProcessMessage; + /** + * Date on which the object was lastly processed. + */ + private Date lastProcessDate; - /** - * Date on which the object will be considered as expired, and any other attempts to process it - * will be rejected. - */ - private Date expirationDate; + /** + * Understandable for humans message of the last processing action (could be + * error message, or successful message). + */ + private String lastProcessMessage; - private Date startDate; + /** + * Date on which the object will be considered as expired, and any other + * attempts to process it will be rejected. + */ + private Date expirationDate; - private Date endDate; + private Date startDate; - /** - * SAP users sometimes provide description for their messages. - */ - private String description; + private Date endDate; - /** - * <p> - * The sender can assign a priority level to the message. This value determines the speed at - * which the message is processed by the communication system. It is possible for high priority - * messages to overtake those with low priority. - * - * <p> - * By default all messages are in {@link Priority#NORMAL} priority. - */ - private Priority priority = Priority.LEVEL_4; + /** + * SAP users sometimes provide description for their messages. + */ + private String description; - private List<SentContent> sentContents = new ArrayList<SentContent>(); + /** + * <p> + * The sender can assign a priority level to the message. This value + * determines the speed at which the message is processed by the + * communication system. It is possible for high priority messages to + * overtake those with low priority. + * + * <p> + * By default all messages are in {@link Priority#NORMAL} priority. + */ + private Priority priority = Priority.LEVEL_4; - public Message() { - } - - public Message(WSMessage wsMessage) { - logger.debug("MESSAGE PRIORITY: "+ wsMessage.getPriority()); - this.setId(wsMessage.getId()); - this.setCreationDate(wsMessage.getCreationDate()); - this.setDescription(wsMessage.getDescription()); - this.setDirection(wsMessage.getDirection()); - this.setEndDate(wsMessage.getEndDate()); - this.setExpirationDate(wsMessage.getExpirationDate()); - this.setFormatType(wsMessage.getFormatType()); - this.setLastProcessDate(wsMessage.getLastProcessDate()); - this.setLastProcessMessage(wsMessage.getLastProcessMessage()); - this.setPriority(wsMessage.getPriority()); - this.setReceiver(wsMessage.getReceiver()); - this.setSapID(wsMessage.getSapID()); - this.setSendDate(wsMessage.getSendDate()); - this.setSender(wsMessage.getSender()); - this.setStartDate(wsMessage.getStartDate()); - this.setStatus(wsMessage.getStatus()); - } + private List<SentContent> sentContents = new ArrayList<SentContent>(); - public Message clone() { - final Message msg = new Message(); - msg.setId(this.id); - msg.setCreationDate(this.creationDate); - msg.setDescription(this.description); - msg.setDirection(this.direction); - msg.setEndDate(this.endDate); - msg.setExpirationDate(this.expirationDate); - msg.setFormatType(this.formatType); - msg.setLastProcessDate(this.lastProcessDate); - msg.setLastProcessMessage(lastProcessMessage); - msg.setPriority(this.priority); - msg.setReceiver(this.receiver); - msg.setSapID(this.sapID); - msg.setSAPInstanceDefOwner(this.sapInstanceDefOwner); - msg.setSendDate(this.sendDate); - msg.setSender(this.sender); - msg.setStartDate(this.startDate); - msg.setStatus(this.status); - msg.setUserOwner(this.userOwner); + public Message() { + } - final List<SentContent> scList = new ArrayList<SentContent>(); - for (SentContent scContent : sentContents) { - SentContent sc = new SentContent(); - sc.setContent(scContent.getContent()); - sc.setInternalId(RandomGUID.getGUID()); - sc.setState(scContent.getState()); - sc.setMessage(this); - scList.add(sc); - } - msg.setSentContents(scList); + public Message(WSMessage wsMessage) { + logger.debug("MESSAGE PRIORITY: " + wsMessage.getPriority()); + this.setId(wsMessage.getId()); + this.setCreationDate(wsMessage.getCreationDate()); + this.setDescription(wsMessage.getDescription()); + this.setDirection(wsMessage.getDirection()); + this.setEndDate(wsMessage.getEndDate()); + this.setExpirationDate(wsMessage.getExpirationDate()); + this.setFormatType(wsMessage.getFormatType()); + this.setLastProcessDate(wsMessage.getLastProcessDate()); + this.setLastProcessMessage(wsMessage.getLastProcessMessage()); + this.setPriority(wsMessage.getPriority()); + this.setReceiver(wsMessage.getReceiver()); + this.setSapID(wsMessage.getSapID()); + this.setSendDate(wsMessage.getSendDate()); + this.setSender(wsMessage.getSender()); + this.setStartDate(wsMessage.getStartDate()); + this.setStatus(wsMessage.getStatus()); + } - return msg; - } + public Message clone() { + final Message msg = new Message(); + msg.setId(this.id); + msg.setCreationDate(this.creationDate); + msg.setDescription(this.description); + msg.setDirection(this.direction); + msg.setEndDate(this.endDate); + msg.setExpirationDate(this.expirationDate); + msg.setFormatType(this.formatType); + msg.setLastProcessDate(this.lastProcessDate); + msg.setLastProcessMessage(lastProcessMessage); + msg.setPriority(this.priority); + msg.setReceiver(this.receiver); + msg.setSapID(this.sapID); + msg.setSAPInstanceDefOwner(this.sapInstanceDefOwner); + msg.setSendDate(this.sendDate); + msg.setSender(this.sender); + msg.setStartDate(this.startDate); + msg.setStatus(this.status); + msg.setUserOwner(this.userOwner); - /** - * @hibernate.id generator-class="native" - * @hibernate.generator-param name="sequence" value="CS_MESSAGES_SEQ" - * @hibernate.generator-param name="parameters" value="INCREMENT BY 1 START WITH 100" - */ - public Long getId() { - return super.id; - } + final List<SentContent> scList = new ArrayList<SentContent>(); + for (SentContent scContent : sentContents) { + SentContent sc = new SentContent(); + sc.setContent(scContent.getContent()); + sc.setInternalId(RandomGUID.getGUID()); + sc.setState(scContent.getState()); + sc.setMessage(this); + scList.add(sc); + } + msg.setSentContents(scList); - /** - * This property MUST be set. - * - * @hibernate.property column="CREATION_DATE" type="timestamp" not-null="true" - */ - public Date getCreationDate() { - return creationDate; - } + return msg; + } - public void setCreationDate(Date createDate) { - this.creationDate = createDate; - } + /** + * @hibernate.id generator-class="native" + * @hibernate.generator-param name="sequence" value="CS_MESSAGES_SEQ" + * @hibernate.generator-param name="parameters" value="INCREMENT BY 1 START + * WITH 100" + */ + public Long getId() { + return super.id; + } - /** - * This property MAY NOT be set. - * - * @hibernate.property column="DESCRIPTION" not-null="false" - */ - public String getDescription() { - final int length = Math.min(27, description.length()); - String shortDescription = description.substring(0, length); - return (description.length() > 27) ? shortDescription.concat("...") : description; - } + /** + * This property MUST be set. + * + * @hibernate.property column="CREATION_DATE" type="timestamp" + * not-null="true" + */ + public Date getCreationDate() { + return creationDate; + } - public void setDescription(String description) { - this.description = description; - } + public void setCreationDate(Date createDate) { + this.creationDate = createDate; + } - /** - * This property MUST be set. - * - * @hibernate.property column="DIRECTION" - * type="org.commsuite.enums.hibernate.HibernateDirection" not-null="true" - */ - public Direction getDirection() { - return direction; - } + /** + * This property MAY NOT be set. + * + * @hibernate.property column="DESCRIPTION" not-null="false" + */ + public String getDescription() { + if (null != description) { + final int length = Math.min(27, description.length()); + String shortDescription = description.substring(0, length); + return (description.length() > 27) ? shortDescription.concat("...") + : description; + } else { + return null; + } + } - public void setDirection(Direction direction) { - this.direction = direction; - } + public void setDescription(String description) { + this.description = description; + } - /** - * <p> - * Latest date on which the document should have reached receiver. - * - * <p> - * This property MAY NOT be set. - * - * @hibernate.property column="END_DATE" type="timestamp" not-null="false" - */ - public Date getEndDate() { - return endDate; - } + /** + * This property MUST be set. + * + * @hibernate.property column="DIRECTION" + * type="org.commsuite.enums.hibernate.HibernateDirection" + * not-null="true" + */ + public Direction getDirection() { + return direction; + } - public void setEndDate(Date endDate) { - this.endDate = endDate; - } + public void setDirection(Direction direction) { + this.direction = direction; + } - /** - * <p> - * Expiry date of the object after it is received. - * - * <p> - * This property MAY NOT be set. - * - * @hibernate.property column="EXPIRATION_DATE" type="timestamp" not-null="false" - */ - public Date getExpirationDate() { - return expirationDate; - } + /** + * <p> + * Latest date on which the document should have reached receiver. + * + * <p> + * This property MAY NOT be set. + * + * @hibernate.property column="END_DATE" type="timestamp" not-null="false" + */ + public Date getEndDate() { + return endDate; + } - public void setExpirationDate(Date expiratonDate) { - this.expirationDate = expiratonDate; - } + public void setEndDate(Date endDate) { + this.endDate = endDate; + } - /** - * This property MUST be set. - * - * @hibernate.property column="FORMAT_TYPE" not-null="true" - * type="org.commsuite.enums.hibernate.HibernateFormatType" - */ - public FormatType getFormatType() { - return formatType; - } + /** + * <p> + * Expiry date of the object after it is received. + * + * <p> + * This property MAY NOT be set. + * + * @hibernate.property column="EXPIRATION_DATE" type="timestamp" + * not-null="false" + */ + public Date getExpirationDate() { + return expirationDate; + } - public void setFormatType(FormatType formatType) { - this.formatType = formatType; - } + public void setExpirationDate(Date expiratonDate) { + this.expirationDate = expiratonDate; + } - /** - * This property MUST be set. - * - * @hibernate.property column="LAST_PROCESS_DATE" type="timestamp" not-null="true" - */ - public Date getLastProcessDate() { - return lastProcessDate; - } + /** + * This property MUST be set. + * + * @hibernate.property column="FORMAT_TYPE" not-null="true" + * type="org.commsuite.enums.hibernate.HibernateFormatType" + */ + public FormatType getFormatType() { + return formatType; + } - public void setLastProcessDate(Date lastProcessDate) { - this.lastProcessDate = lastProcessDate; - } + public void setFormatType(FormatType formatType) { + this.formatType = formatType; + } - /** - * This property MAY NOT be set. - * - * @hibernate.property column="LAST_PROCESS_MESSAGE" not-null="false" - */ - public String getLastProcessMessage() { - final int length = Math.min(27, lastProcessMessage.length()); - String shortLastProcessMessage = lastProcessMessage.substring(0, length); - return (lastProcessMessage.length() > 27) ? shortLastProcessMessage.concat("...") : lastProcessMessage; - } + /** + * This property MUST be set. + * + * @hibernate.property column="LAST_PROCESS_DATE" type="timestamp" + * not-null="true" + */ + public Date getLastProcessDate() { + return lastProcessDate; + } - public void setLastProcessMessage(String lastProcessMessage) { - this.lastProcessMessage = lastProcessMessage; - } + public void setLastProcessDate(Date lastProcessDate) { + this.lastProcessDate = lastProcessDate; + } - /** - * <p> - * Default priority: {@link Message.Priority#LEVEL_4}. - * - * <p> - * This property MUST be set. - * - * @hibernate.property column="PRIORITY" type="org.commsuite.enums.hibernate.HibernatePriority" - * not-null="true" - */ - public Priority getPriority() { - return priority; - } + /** + * This property MAY NOT be set. + * + * @hibernate.property column="LAST_PROCESS_MESSAGE" not-null="false" + */ + public String getLastProcessMessage() { + if (null != lastProcessMessage) { + final int length = Math.min(27, lastProcessMessage.length()); + String shortLastProcessMessage = lastProcessMessage.substring(0, + length); + return (lastProcessMessage.length() > 27) ? shortLastProcessMessage + .concat("...") : lastProcessMessage; + } else { + return null; + } + } - public void setPriority(Priority priority) { - this.priority = priority; - } + public void setLastProcessMessage(String lastProcessMessage) { + this.lastProcessMessage = lastProcessMessage; + } - /** - * This property MUST be set. - * - * @hibernate.property column="RECEIVER" not-null="true" - */ - public String getReceiver() { - return receiver; - } + /** + * <p> + * Default priority: {@link Message.Priority#LEVEL_4}. + * + * <p> + * This property MUST be set. + * + * @hibernate.property column="PRIORITY" + * type="org.commsuite.enums.hibernate.HibernatePriority" + * not-null="true" + */ + public Priority getPriority() { + return priority; + } - public void setReceiver(String receiver) { - this.receiver = receiver; - } + public void setPriority(Priority priority) { + this.priority = priority; + } - /** - * <p> - * This property could be NULL, in cases where this message has been sent through Windows - * Printing Driver. - * - * <p> - * SapID are not unique through all Communications Suite system. Two different SAP systems may - * generate thesame SapID. - * - * <p>This property MAY NOT be set. - * - * @hibernate.property column="SAP_ID" not-null="false" - */ - public String getSapID() { - return sapID; - } + /** + * This property MUST be set. + * + * @hibernate.property column="RECEIVER" not-null="true" + */ + public String getReceiver() { + return receiver; + } - public void setSapID(String sapID) { - this.sapID = sapID; - } + public void setReceiver(String receiver) { + this.receiver = receiver; + } - /** - * This property MUST be set. - * - * @hibernate.property column="SEND_DATE" type="timestamp" not-null="true" - */ - public Date getSendDate() { - return sendDate; - } + /** + * <p> + * This property could be NULL, in cases where this message has been sent + * through Windows Printing Driver. + * + * <p> + * SapID are not unique through all Communications Suite system. Two + * different SAP systems may generate thesame SapID. + * + * <p> + * This property MAY NOT be set. + * + * @hibernate.property column="SAP_ID" not-null="false" + */ + public String getSapID() { + return sapID; + } - public void setSendDate(Date sendDate) { - this.sendDate = sendDate; - } + public void setSapID(String sapID) { + this.sapID = sapID; + } - /** - * This property MUST be set. - * - * @hibernate.property column="SENDER" not-null="true" - */ - public String getSender() { - return sender; - } + /** + * This property MUST be set. + * + * @hibernate.property column="SEND_DATE" type="timestamp" not-null="true" + */ + public Date getSendDate() { + return sendDate; + } - public void setSender(String sender) { - this.sender = sender; - } + public void setSendDate(Date sendDate) { + this.sendDate = sendDate; + } - /** - * <p> - * Earliest date on which the document should have reached receiver. - * - * <p> - * This property MAY NOT be set. - * - * @hibernate.property column="START_DATE" type="timestamp" not-null="false" - */ - public Date getStartDate() { - return startDate; - } + /** + * This property MUST be set. + * + * @hibernate.property column="SENDER" not-null="true" + */ + public String getSender() { + return sender; + } - public void setStartDate(Date startDate) { - this.startDate = startDate; - } + public void setSender(String sender) { + this.sender = sender; + } - /** - * This property MUST be set. - * - * @hibernate.property column="STATUS" type="org.commsuite.enums.hibernate.HibernateStatus" not-null="true" - */ - public Status getStatus() { - return status; - } + /** + * <p> + * Earliest date on which the document should have reached receiver. + * + * <p> + * This property MAY NOT be set. + * + * @hibernate.property column="START_DATE" type="timestamp" not-null="false" + */ + public Date getStartDate() { + return startDate; + } - public void setStatus(Status status) { - this.status = status; - } + public void setStartDate(Date startDate) { + this.startDate = startDate; + } - /** - * This property MAY NOT be set. - * - * @hibernate.many-to-one column="SAP_SERVER_ID" not-null="false" lazy="false" cascade="none" - * @hibernate.cache usage="read-write" - */ - public SAPInstanceDef getSAPInstanceDefOwner() { - return sapInstanceDefOwner; - } + /** + * This property MUST be set. + * + * @hibernate.property column="STATUS" + * type="org.commsuite.enums.hibernate.HibernateStatus" + * not-null="true" + */ + public Status getStatus() { + return status; + } - public void setSAPInstanceDefOwner(SAPInstanceDef instanceDefOwner) { - this.sapInstanceDefOwner = instanceDefOwner; - } + public void setStatus(Status status) { + this.status = status; + } - /** - * This property MAY NOT be set. - * - * @hibernate.many-to-one column="USER_ID" not-null="false" lazy="false" cascade="none" - */ - public User getUserOwner() { - return this.userOwner; - } + /** + * This property MAY NOT be set. + * + * @hibernate.many-to-one column="SAP_SERVER_ID" not-null="false" + * lazy="false" cascade="none" + * @hibernate.cache usage="read-write" + */ + public SAPInstanceDef getSAPInstanceDefOwner() { + return sapInstanceDefOwner; + } - public void setUserOwner(User userOwner) { - this.userOwner = userOwner; - } + public void setSAPInstanceDefOwner(SAPInstanceDef instanceDefOwner) { + this.sapInstanceDefOwner = instanceDefOwner; + } - /** - * @hibernate.list cascade="none" - * @hibernate.key not-null="true" column="MESSAGE_ID" - * @hibernate.list-index column="LIST_ORDER" - * @hibernate.one-to-many class="org.commsuite.model.SentContent" - * @hibernate.cache usage="read-write" - */ - public List<SentContent> getSentContents() { - return sentContents; - } + /** + * This property MAY NOT be set. + * + * @hibernate.many-to-one column="USER_ID" not-null="false" lazy="false" + * cascade="none" + */ + public User getUserOwner() { + return this.userOwner; + } - public void setSentContents(List<SentContent> sentContents) { - for (SentContent content : sentContents) - content.setMessage(this); - this.sentContents = sentContents; - } - - - private SentContent createSentContent(Contents c) { - final SentContent sc = new SentContent(); - sc.setInternalId(RandomGUID.getGUID()); - sc.setContent(c); - sc.setMessage(this); - c.getSentContents().add(sc); - return sc; - } + public void setUserOwner(User userOwner) { + this.userOwner = userOwner; + } - /** - * Internal ID will be automatically calculated using {@link RandomGUID#getGUID()} method. - */ - public void addContents(Contents c) { - final SentContent sc = createSentContent(c); - this.sentContents.add(sc); - } - - public void addContentsAsFirst(Contents c) { - final SentContent sc = createSentContent(c); - this.sentContents.add(0, sc); - } + /** + * @hibernate.list cascade="none" + * @hibernate.key not-null="true" column="MESSAGE_ID" + * @hibernate.list-index column="LIST_ORDER" + * @hibernate.one-to-many class="org.commsuite.model.SentContent" + * @hibernate.cache usage="read-write" + */ + public List<SentContent> getSentContents() { + return sentContents; + } - public void addContents(Contents c, String internalID) { - final SentContent sc = new SentContent(); + public void setSentContents(List<SentContent> sentContents) { + for (SentContent content : sentContents) + content.setMessage(this); + this.sentContents = sentContents; + } - sc.setInternalId(internalID); - sc.setContent(c); - sc.setMessage(this); - c.getSentContents().add(sc); + private SentContent createSentContent(Contents c) { + final SentContent sc = new SentContent(); + sc.setInternalId(RandomGUID.getGUID()); + sc.setContent(c); + sc.setMessage(this); + c.getSentContents().add(sc); + return sc; + } - this.sentContents.add(sc); - } + /** + * Internal ID will be automatically calculated using + * {@link RandomGUID#getGUID()} method. + */ + public void addContents(Contents c) { + final SentContent sc = createSentContent(c); + this.sentContents.add(sc); + } - public List<Contents> listContents() { - final List<Contents> contentsSet = new ArrayList<Contents>(); - for (SentContent sc : sentContents) { - contentsSet.add(sc.getContent()); - } - return contentsSet; - } + public void addContentsAsFirst(Contents c) { + final SentContent sc = createSentContent(c); + this.sentContents.add(0, sc); + } - @Override - public String toString() { - return new ToStringBuilder(this) - .append("id", this.id) - .append("creationDate", this.creationDate) - .append("description", this.description) - .append("direction", this.direction) - .append("endDate", this.endDate) - .append("expirationDate", this.expirationDate) - .append("formatType", this.formatType) - .append("lastProcessDate", this.lastProcessDate) - .append("lastProcessMessage", this.lastProcessMessage) - .append("priority", this.priority) - .append("receiver", this.receiver) - .append("sapID", this.sapID) - .append("sendDate", this.sendDate) - .append("sender", this.sender) - .append("startDate", this.startDate) - .append("status", this.status) - .toString(); - } + public void addContents(Contents c, String internalID) { + final SentContent sc = new SentContent(); - @Override - public boolean equals(Object object) { - if (null == object) { - return false; - } - if (!(object instanceof Message)) { - return false; - } - Message rhs = (Message) object; - return new EqualsBuilder() - .append(this.id, rhs.id) - .append(this.creationDate, rhs.creationDate) - .append(this.description, rhs.description) - .append(this.direction, rhs.direction) - .append(this.endDate, rhs.endDate) - .append(this.expirationDate, rhs.expirationDate) - .append(this.formatType, rhs.formatType) - .append(this.lastProcessDate, rhs.lastProcessDate) - .append(this.lastProcessMessage, rhs.lastProcessMessage) - .append(this.priority, rhs.priority) - .append(this.receiver, rhs.receiver) - .append(this.sapID, rhs.sapID) - .append(this.sendDate, rhs.sendDate) - .append(this.sender, rhs.sender) - .append(this.startDate, rhs.startDate) - .append(this.status, rhs.status) - .isEquals(); - } + sc.setInternalId(internalID); + sc.setContent(c); + sc.setMessage(this); + c.getSentContents().add(sc); - @Override - public int hashCode() { - return new HashCodeBuilder(7, 31) - .append(this.id) - .append(this.creationDate) - .append(this.description) - .append(this.direction) - .append(this.endDate) - .append(this.expirationDate) - .append(this.formatType) - .append(this.lastProcessDate) - .append(this.lastProcessMessage) - .append(this.priority) - .append(this.receiver) - .append(this.sapID) - .append(this.sendDate) - .append(this.sender) - .append(this.startDate) - .append(this.status) - .toHashCode(); - } + this.sentContents.add(sc); + } + public List<Contents> listContents() { + final List<Contents> contentsSet = new ArrayList<Contents>(); + for (SentContent sc : sentContents) { + contentsSet.add(sc.getContent()); + } + return contentsSet; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", this.id).append( + "creationDate", this.creationDate).append("description", + this.description).append("direction", this.direction).append( + "endDate", this.endDate).append("expirationDate", + this.expirationDate).append("formatType", this.formatType) + .append("lastProcessDate", this.lastProcessDate).append( + "lastProcessMessage", this.lastProcessMessage).append( + "priority", this.priority).append("receiver", + this.receiver).append("sapID", this.sapID).append( + "sendDate", this.sendDate) + .append("sender", this.sender).append("startDate", + this.startDate).append("status", this.status) + .toString(); + } + + @Override + public boolean equals(Object object) { + if (null == object) { + return false; + } + if (!(object instanceof Message)) { + return false; + } + Message rhs = (Message) object; + return new EqualsBuilder().append(this.id, rhs.id).append( + this.creationDate, rhs.creationDate).append(this.description, + rhs.description).append(this.direction, rhs.direction).append( + this.endDate, rhs.endDate).append(this.expirationDate, + rhs.expirationDate).append(this.formatType, rhs.formatType) + .append(this.lastProcessDate, rhs.lastProcessDate).append( + this.lastProcessMessage, rhs.lastProcessMessage) + .append(this.priority, rhs.priority).append(this.receiver, + rhs.receiver).append(this.sapID, rhs.sapID).append( + this.sendDate, rhs.sendDate).append(this.sender, + rhs.sender).append(this.startDate, rhs.startDate) + .append(this.status, rhs.status).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(7, 31).append(this.id).append( + this.creationDate).append(this.description).append( + this.direction).append(this.endDate) + .append(this.expirationDate).append(this.formatType).append( + this.lastProcessDate).append(this.lastProcessMessage) + .append(this.priority).append(this.receiver).append(this.sapID) + .append(this.sendDate).append(this.sender).append( + this.startDate).append(this.status).toHashCode(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <mal...@us...> - 2006-08-01 12:27:37
      
     | 
| Revision: 107 Author: malinowskirafal Date: 2006-08-01 05:27:08 -0700 (Tue, 01 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=107&view=rev Log Message: ----------- Modified Paths: -------------- trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java trunk/code/CSMiddleware/src/org/commsuite/devices/fax/clientserver/FaxNotiferServer.java trunk/code/CSMiddleware/src/org/commsuite/devices/fax/polling/ReceivePollingJob.java trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java Added Paths: ----------- trunk/code/CSMiddleware/src/org/commsuite/devices/sms/ReceivePollingJob.java Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java 2006-08-01 12:06:07 UTC (rev 106) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java 2006-08-01 12:27:08 UTC (rev 107) @@ -50,7 +50,7 @@ * FaxDevice creates it after notification of new received Fax. * @throws FaxInboundMessageCreateException */ - public FaxInboundMessage(FaxDevice device, String messageId, String sourceAddress, String destinationAddress, String contentMimeType, + public FaxInboundMessage(FaxDevice device, HylaFAXClient hylaFaxClient, String messageId, String sourceAddress, String destinationAddress, String contentMimeType, String fileName) throws FaxInboundMessageCreateException { // test fails with mocks... // logger.info("FaxInboundMessage created, device: " + device.getName() + ", id: " + messageId); @@ -74,9 +74,6 @@ throw new FaxInboundMessageCreateException("Inbound message file name can not be null"); } - FaxDevice faxDevice = (FaxDevice)getDevice(); - HylaFAXClient hylaFaxClient = faxDevice.getHylaFAXClient(); - ByteArrayOutputStream contentStream = new ByteArrayOutputStream(); try { Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java 2006-08-01 12:06:07 UTC (rev 106) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java 2006-08-01 12:27:08 UTC (rev 107) @@ -31,6 +31,7 @@ import org.apache.log4j.Logger; import org.commsuite.converter.ConversionFailedException; +import org.commsuite.devices.DeviceInitializationFailedException; import org.commsuite.devices.OutboundMessage; import org.commsuite.devices.OutboundMessageConversionFailedException; import org.commsuite.devices.OutboundMessageInvalidContentException; @@ -97,7 +98,12 @@ } FaxDevice faxDevice = (FaxDevice)getDevice(); - HylaFAXClient hylaFAXClient = faxDevice.getHylaFAXClient(); + HylaFAXClient hylaFAXClient; + try { + hylaFAXClient = faxDevice.getConnection(); + } catch (DeviceInitializationFailedException e) { + throw new OutboundMessageSendException("", e); + } try { Job hylafaxJob = hylaFAXClient.createJob(); Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/fax/clientserver/FaxNotiferServer.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/fax/clientserver/FaxNotiferServer.java 2006-08-01 12:06:07 UTC (rev 106) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/fax/clientserver/FaxNotiferServer.java 2006-08-01 12:27:08 UTC (rev 107) @@ -146,7 +146,7 @@ * @throws FaxInboundMessageCreateException */ private FaxInboundMessage convertToInboundMessage(ReceiveEvent event) throws FaxInboundMessageCreateException { - return new FaxInboundMessage(device, RandomGUID.getGUID(), event.getCommunicationIdentifier(), + return new FaxInboundMessage(device, null, RandomGUID.getGUID(), event.getCommunicationIdentifier(), event.getCidNumber(), "image/tiff", event.getFilename()); } } Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/fax/polling/ReceivePollingJob.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/fax/polling/ReceivePollingJob.java 2006-08-01 12:06:07 UTC (rev 106) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/fax/polling/ReceivePollingJob.java 2006-08-01 12:27:08 UTC (rev 107) @@ -121,7 +121,7 @@ // unable to set anyting useful to destinationAddress here // needs hylafax update ? - final FaxInboundMessage inboundMessage = new FaxInboundMessage(faxDevice, + final FaxInboundMessage inboundMessage = new FaxInboundMessage(faxDevice, hylafaxClient, Integer.toString(receivedFaxId), faxFileAddress, null, "image/tiff", "recvq/" + faxFileName); Added: trunk/code/CSMiddleware/src/org/commsuite/devices/sms/ReceivePollingJob.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/sms/ReceivePollingJob.java (rev 0) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/sms/ReceivePollingJob.java 2006-08-01 12:27:08 UTC (rev 107) @@ -0,0 +1,38 @@ +package org.commsuite.devices.sms; + +import java.util.LinkedList; + +import org.apache.log4j.Logger; +import org.quartz.JobExecutionContext; +import org.quartz.StatefulJob; +import org.smslib.CIncomingMessage; + +public class ReceivePollingJob implements StatefulJob { + + private static final Logger logger = Logger.getLogger(ReceivePollingJob.class); + + public void execute(JobExecutionContext context) { +// logger.info("execute"); + + synchronized (SmsDevice.class) { + final SmsDevice smsDevice = (SmsDevice) (context.getJobDetail().getJobDataMap().get("SmsDevice")); + + LinkedList messageList; + messageList = new LinkedList(); + + SmsService smsService= smsDevice.getSmsService(); + + try { + smsService.readMessages(messageList, CIncomingMessage.CLASS_ALL); + } catch (Exception e) { + logger.error("Error during reading messages", e); + } + + for (int i = 0; i < messageList.size(); i ++) { + CIncomingMessage message = (CIncomingMessage) messageList.get(i); + smsService.received(message); + } + } + } + +} Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java 2006-08-01 12:06:07 UTC (rev 106) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java 2006-08-01 12:27:08 UTC (rev 107) @@ -37,6 +37,11 @@ import org.commsuite.devices.OutboundMessageInvalidDestinationAddressException; import org.commsuite.devices.OutboundMessageSendException; import org.commsuite.enums.FormatType; +import org.quartz.JobDetail; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.quartz.SchedulerFactory; +import org.quartz.SimpleTrigger; import org.smslib.CMessage; import org.smslib.COutgoingMessage; import org.smslib.CService; @@ -77,8 +82,10 @@ private long lastSignalWarning; - private CService service; + private SmsService service; + private Scheduler scheduler; + /** * Creates new SmsDevice. * @@ -103,7 +110,8 @@ getGsmDeviceModel()); logger.info("Using " + CService._name + " " + CService._version); - service.setReceiveMode(SmsService.RECEIVE_MODE_ASYNC_POLL); + // service.setReceiveMode(SmsService.RECEIVE_MODE_ASYNC_POLL); + service.setReceiveMode(SmsService.RECEIVE_MODE_SYNC); service.setSimPin(""); service.connect(); @@ -139,6 +147,8 @@ setState(Device.State.OFF); throw new DeviceInitializationFailedException(t); } + + initNotification(); } @@ -149,6 +159,8 @@ */ public void shutdown() throws DeviceShutdownFailedException { try { + shutdownNotification(); + // TODO: kod bezpiecznie zamykający urządzenie service.disconnect(); @@ -462,5 +474,50 @@ public FormatType getFormatType() { return FormatType.SMS; } + + /** + * Starts Quartz jobs to poll receive smses. + * + * @throws DeviceInitializationFailedException when quarts fails + */ + protected void initNotification() throws DeviceInitializationFailedException { + final SchedulerFactory shedulerFactory = new org.quartz.impl.StdSchedulerFactory(); + final JobDetail receivePollingJobDetail = new JobDetail(getName() + "_receivePollingJobDetail", null, ReceivePollingJob.class); + receivePollingJobDetail.getJobDataMap().put("SmsDevice", this); + + final Date plus2Seconds = new Date(); + plus2Seconds.setTime(plus2Seconds.getTime() + 2500); + + // fire every 5 seconds + final SimpleTrigger receivePollingTrigger = new SimpleTrigger(getName() + "_receivePollingTrigger", null, + new Date(), null, SimpleTrigger.REPEAT_INDEFINITELY, 5000); + + try { + scheduler = shedulerFactory.getScheduler(); + scheduler.start(); + scheduler.scheduleJob(receivePollingJobDetail, receivePollingTrigger); + } catch (SchedulerException e) { + throw new DeviceInitializationFailedException(e); + } + } + + /** + * Stops Quartz jobs to poll receive smses. + * + * @throws DeviceInitializationFailedException when quarts fails + */ + protected void shutdownNotification() throws DeviceShutdownFailedException { + try { + scheduler.shutdown(true); + } catch (SchedulerException e) { + throw new DeviceShutdownFailedException(e); + } finally { + scheduler = null; + } + } + + public SmsService getSmsService() { + return service; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <ma...@us...> - 2006-08-01 12:06:27
      
     | 
| Revision: 106 Author: marasm Date: 2006-08-01 05:06:07 -0700 (Tue, 01 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=106&view=rev Log Message: ----------- small code cleanup Modified Paths: -------------- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/converter/TimeZoneConverter.java trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsOutboundMessage.java trunk/code/CSRemoteClient/src/org/commsuite/remotews/FormatType.java trunk/code/CSRemoteClient/src/org/commsuite/remotews/State.java Modified: trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/converter/TimeZoneConverter.java =================================================================== --- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/converter/TimeZoneConverter.java 2006-08-01 11:59:38 UTC (rev 105) +++ trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/converter/TimeZoneConverter.java 2006-08-01 12:06:07 UTC (rev 106) @@ -24,7 +24,6 @@ import javax.faces.context.FacesContext; import javax.faces.convert.ConverterException; -import org.commsuite.enums.Country; import org.commsuite.enums.TimeZone; /** Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java 2006-08-01 11:59:38 UTC (rev 105) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxInboundMessage.java 2006-08-01 12:06:07 UTC (rev 106) @@ -27,7 +27,6 @@ import java.io.IOException; import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.log4j.Logger; import org.commsuite.converter.Conversion; import org.commsuite.converter.ConversionFailedException; import org.commsuite.converter.ConversionImpossibleException; @@ -43,7 +42,6 @@ * @author Rafał Malinowski */ public class FaxInboundMessage extends InboundMessage { - private static final Logger logger = Logger.getLogger(FaxInboundMessage.class); private static final String SUPPORTED_MIME_TYPE = "image/tiff"; private String fileName; Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsOutboundMessage.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsOutboundMessage.java 2006-08-01 11:59:38 UTC (rev 105) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsOutboundMessage.java 2006-08-01 12:06:07 UTC (rev 106) @@ -22,7 +22,6 @@ import java.util.ArrayList; -import org.apache.log4j.Logger; import org.commsuite.devices.OutboundMessage; /** @@ -33,7 +32,6 @@ * @author Marcin Zduniak */ public class SmsOutboundMessage extends OutboundMessage { - private static final Logger logger = Logger.getLogger(SmsOutboundMessage.class); static { acceptedMimeTypes = new ArrayList<String>(); Modified: trunk/code/CSRemoteClient/src/org/commsuite/remotews/FormatType.java =================================================================== --- trunk/code/CSRemoteClient/src/org/commsuite/remotews/FormatType.java 2006-08-01 11:59:38 UTC (rev 105) +++ trunk/code/CSRemoteClient/src/org/commsuite/remotews/FormatType.java 2006-08-01 12:06:07 UTC (rev 106) @@ -8,7 +8,10 @@ package org.commsuite.remotews; public class FormatType implements java.io.Serializable { - private java.lang.String _value_; + + private static final long serialVersionUID = -8474540224776780269L; + + private java.lang.String _value_; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor Modified: trunk/code/CSRemoteClient/src/org/commsuite/remotews/State.java =================================================================== --- trunk/code/CSRemoteClient/src/org/commsuite/remotews/State.java 2006-08-01 11:59:38 UTC (rev 105) +++ trunk/code/CSRemoteClient/src/org/commsuite/remotews/State.java 2006-08-01 12:06:07 UTC (rev 106) @@ -8,7 +8,10 @@ package org.commsuite.remotews; public class State implements java.io.Serializable { - private java.lang.String _value_; + + private static final long serialVersionUID = 1440040790148373119L; + + private java.lang.String _value_; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <ma...@us...> - 2006-08-01 11:59:49
      
     | 
| Revision: 105 Author: marasm Date: 2006-08-01 04:59:38 -0700 (Tue, 01 Aug 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=105&view=rev Log Message: ----------- description & lastProcessMessage toString changed Modified Paths: -------------- trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java trunk/code/CSMiddleware/src/org/commsuite/model/Message.java Modified: trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java 2006-07-29 10:40:56 UTC (rev 104) +++ trunk/code/CSMiddleware/src/org/commsuite/model/Contents.java 2006-08-01 11:59:38 UTC (rev 105) @@ -162,7 +162,9 @@ * @hibernate.property column="DESCRIPTION" not-null="false" */ public String getDescription() { - return description; + final int length = Math.min(27, description.length()); + String shortDescription = description.substring(0, length); + return (description.length() > 27) ? shortDescription.concat("...") : description; } public void setDescription(String description) { Modified: trunk/code/CSMiddleware/src/org/commsuite/model/Message.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/model/Message.java 2006-07-29 10:40:56 UTC (rev 104) +++ trunk/code/CSMiddleware/src/org/commsuite/model/Message.java 2006-08-01 11:59:38 UTC (rev 105) @@ -218,7 +218,9 @@ * @hibernate.property column="DESCRIPTION" not-null="false" */ public String getDescription() { - return description; + final int length = Math.min(27, description.length()); + String shortDescription = description.substring(0, length); + return (description.length() > 27) ? shortDescription.concat("...") : description; } public void setDescription(String description) { @@ -306,7 +308,9 @@ * @hibernate.property column="LAST_PROCESS_MESSAGE" not-null="false" */ public String getLastProcessMessage() { - return lastProcessMessage; + final int length = Math.min(27, lastProcessMessage.length()); + String shortLastProcessMessage = lastProcessMessage.substring(0, length); + return (lastProcessMessage.length() > 27) ? shortLastProcessMessage.concat("...") : lastProcessMessage; } public void setLastProcessMessage(String lastProcessMessage) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-07-29 10:43:05
      
     | 
| Revision: 104 Author: skuzniak Date: 2006-07-29 03:40:56 -0700 (Sat, 29 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=104&view=rev Log Message: ----------- deleting servers provided Modified Paths: -------------- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java trunk/code/CSAdminPanel/WebContent/pages/servers/CSSAPServers.jsp trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java Modified: trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java =================================================================== --- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java 2006-07-29 10:14:36 UTC (rev 103) +++ trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java 2006-07-29 10:40:56 UTC (rev 104) @@ -316,6 +316,16 @@ return BeansUtils.SEARCH_SERVER_NAVIGATION; } + public String deleteServer() { + final ICommunicateWS ws = SpringAdminPanelContext.getCommunicateWS(); + try { + ws.deleteServer(this.serverId); + } catch(WebServiceException wse) { + + } + return BeansUtils.SEARCH_SERVER_NAVIGATION; + } + private List<WSSAPInstanceDef> getServers(WSSAPInstanceDef model, boolean def, boolean load, boolean unicode, ICommunicateWS ws) throws WebServiceException{ Modified: trunk/code/CSAdminPanel/WebContent/pages/servers/CSSAPServers.jsp =================================================================== --- trunk/code/CSAdminPanel/WebContent/pages/servers/CSSAPServers.jsp 2006-07-29 10:14:36 UTC (rev 103) +++ trunk/code/CSAdminPanel/WebContent/pages/servers/CSSAPServers.jsp 2006-07-29 10:40:56 UTC (rev 104) @@ -30,7 +30,7 @@ styleClass="listView" rowClasses="listView-header-odd,listView-header-even"> <h:column> <h:panelGrid columns="1"> - <h:panelGrid columns="6"> + <h:panelGrid columns="7"> <h:panelGrid columns="2"> <h:outputText value="#{Locale.SERVER_NAME}" styleClass="listView-header-title"/> <h:outputText value="#{inst.instance.name}" styleClass="listView-header-value"/> @@ -58,6 +58,13 @@ <h:outputText value="#{Locale.LABEL_EDIT}" styleClass="header-command"/> </h:panelGrid> </h:commandLink> + <h:commandLink actionListener="#{searchServerBean.selectServer}" action="#{searchServerBean.deleteServer}" > + <f:param name="serverId" value="#{inst.instance.id}" /> + <h:panelGrid columns="1"> + <h:graphicImage value="#{pageContext.request.contextPath}/pages/files/gif/list-remove.gif" styleClass="header-icon"/> + <h:outputText value="#{Locale.LABEL_DELETE}" styleClass="header-command"/> + </h:panelGrid> + </h:commandLink> </h:panelGrid> </h:panelGrid> </h:column> Modified: trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java =================================================================== --- trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java 2006-07-29 10:14:36 UTC (rev 103) +++ trunk/code/CSCommon/src/org/commsuite/ws/ICommunicateWS.java 2006-07-29 10:40:56 UTC (rev 104) @@ -92,6 +92,8 @@ public void startSapServer(String serverName) throws WebServiceException ; public void stopSapServer(String serverName) throws WebServiceException ; + + public void deleteServer(String id) throws WebServiceException ; /** * This method provides adding new SAP R/3 instance to database Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java 2006-07-29 10:14:36 UTC (rev 103) +++ trunk/code/CSMiddleware/src/org/commsuite/ws/CommunicateWS.java 2006-07-29 10:40:56 UTC (rev 104) @@ -239,6 +239,16 @@ throw new WebServiceException(t); } } + + public void deleteServer(String id) throws WebServiceException { + try { + ServersService service = ServersService.getInstance(); + service.deletServer(id); + } catch (Throwable t) { + logger.fatal("error in deleteServer method", t); + throw new WebServiceException(t); + } + } public int getUsersSize(WSUser user, boolean enabledSearch) throws WebServiceException { try { Modified: trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-07-29 10:14:36 UTC (rev 103) +++ trunk/code/CSMiddleware/src/org/commsuite/ws/services/ServersService.java 2006-07-29 10:40:56 UTC (rev 104) @@ -301,4 +301,15 @@ instance.setUser(wsInstance.getUser()); } + public void deletServer(String id) throws WebServiceException{ + try { + final SAPInstanceDefManager instManager = (SAPInstanceDefManager) SpringMiddlewareContext + .getSAPInstanceDefManager(); + instManager.deleteSAPInstanceDef(id); + } catch(Throwable t) { + logger.fatal("error in getInstancesSize method", t); + throw new WebServiceException(t); + } + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <sku...@us...> - 2006-07-29 10:14:56
      
     | 
| Revision: 103 Author: skuzniak Date: 2006-07-29 03:14:36 -0700 (Sat, 29 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=103&view=rev Log Message: ----------- adding new server bug fixed (history of testing removed) Modified Paths: -------------- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java Modified: trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java =================================================================== --- trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java 2006-07-29 07:45:10 UTC (rev 102) +++ trunk/code/CSAdminPanel/JavaSource/org/commsuite/web/beans/servers/SearchServerBean.java 2006-07-29 10:14:36 UTC (rev 103) @@ -60,9 +60,9 @@ private List<ServerExtended> servers; -// private List<String> serverStates = new FastTable<String>(); + private List<String> serverStates = new FastTable<String>(); - private List<List<String>> serverStatePages = new FastTable<List<String>>(); +// private List<List<String>> serverStatePages = new FastTable<List<String>>(); private String serverId; @@ -166,12 +166,6 @@ serversList = this.getServers(null, false, false, false, ws); } this.servers = new FastTable<ServerExtended>(); - - try { - this.serverStatePages.get(this.actualPage-1); - } catch(IndexOutOfBoundsException ioobe) { - this.serverStatePages.add(this.actualPage-1, new FastTable<String>()); - } int i = 0; logger.debug("Servers list size: " + serversList.size()); @@ -186,27 +180,20 @@ workingIcon = START_ICON_PATH; label = BeansUtils.LABEL_START; } - try { - List<String> p = this.serverStatePages.get(this.actualPage-1); - logger.debug("TEMPORARY LIST: "+ p); - p.set(i, this.serverStatePages.get(this.actualPage-1).get(i)); - // this.serverStates.set(i, this.serverStates.get(i)); - } catch(IndexOutOfBoundsException ioobe) { - this.serverStatePages.get(this.actualPage-1).add(i, UNKNOWN_ICON_PATH); - // this.serverStates.add(i, UNKNOWN_ICON_PATH); - } - this.servers.add(i, new ServerExtended(def, this.serverStatePages.get(this.actualPage-1).get(i), - // this.servers.add(i, new ServerExtended(def, this.serverStates.get(i), +// try { +// this.serverStates.set(i, this.serverStates.get(i)); +// } catch(IndexOutOfBoundsException ioobe) { + this.serverStates.add(i, UNKNOWN_ICON_PATH); +// } + this.servers.add(i, new ServerExtended(def, this.serverStates.get(i), workingIcon, label)); } else if (null != this.serverId && def.getId().toString().equals(this.serverId)) { final boolean testResult = ws.testServer(def.getName()); logger.debug("Result of SAP server testing: " + testResult); if (testResult) { - this.serverStatePages.get(this.actualPage-1).set(i, TEST_OK_ICON_PATH); - // this.serverStates.set(i, TEST_OK_ICON_PATH); + this.serverStates.set(i, TEST_OK_ICON_PATH); } else { - this.serverStatePages.get(this.actualPage-1).set(i, TEST_FAIL_ICON_PATH); - // this.serverStates.set(i, TEST_FAIL_ICON_PATH); + this.serverStates.set(i, TEST_FAIL_ICON_PATH); } String workingIcon ; String label; @@ -217,8 +204,7 @@ workingIcon = START_ICON_PATH; label = BeansUtils.LABEL_START; } - this.servers.add(i, new ServerExtended(def, this.serverStatePages.get(this.actualPage-1).get(i), - // this.servers.add(i, new ServerExtended(def, this.serverStates.get(i), + this.servers.add(i, new ServerExtended(def, this.serverStates.get(i), workingIcon, label)); } i++; @@ -250,13 +236,9 @@ public void doSearching(ActionEvent e) { try { - boolean recent = this.searching; final String val = getParameter("searching"); logger.debug("PARAMETER: "+ val); this.searching = "true".equals(val); - if (recent != this.searching) { - this.serverStatePages = new FastTable<List<String>>(); - } } catch (IllegalArgumentException iae) { logger.fatal("Wrong parameter name", iae); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <zd...@us...> - 2006-07-29 07:45:38
      
     | 
| Revision: 102 Author: zduniak Date: 2006-07-29 00:45:10 -0700 (Sat, 29 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=102&view=rev Log Message: ----------- Tagging the 0.9beta1 release of the 'comsuite' project. Added Paths: ----------- tags/0.9beta1/ Copied: tags/0.9beta1 (from rev 101, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <zd...@us...> - 2006-07-25 16:21:38
      
     | 
| Revision: 101 Author: zduniak Date: 2006-07-25 09:21:26 -0700 (Tue, 25 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=101&view=rev Log Message: ----------- '.classpath' file reverted to previous version (r99) Modified Paths: -------------- trunk/code/CSAdminPanel/.classpath Added Paths: ----------- trunk/code/CSAdminPanel/.settings/org.eclipse.wst.common.component Modified: trunk/code/CSAdminPanel/.classpath =================================================================== --- trunk/code/CSAdminPanel/.classpath 2006-07-24 22:51:27 UTC (rev 100) +++ trunk/code/CSAdminPanel/.classpath 2006-07-25 16:21:26 UTC (rev 101) @@ -12,8 +12,15 @@ <classpathentry kind="lib" path="/CSCommon/lib/acegi-security-1.0.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/acegi-security-catalina-1.0.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/commons-logging-1.1.jar"/> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/tomahawk.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/jdom-1.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/xfire-all-1.1.2.jar"/> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-beanutils-1.7.0.jar"/> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-digester-1.6.jar"/> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-el-1.0.jar"/> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jstl-1.1.0.jar"/> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/myfaces-api-1.1.3.jar"/> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/myfaces-impl-1.1.3.jar"/> <classpathentry kind="lib" path="/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar"/> <classpathentry kind="output" path="WebContent/WEB-INF/classes"/> </classpath> Added: trunk/code/CSAdminPanel/.settings/org.eclipse.wst.common.component =================================================================== --- trunk/code/CSAdminPanel/.settings/org.eclipse.wst.common.component (rev 0) +++ trunk/code/CSAdminPanel/.settings/org.eclipse.wst.common.component 2006-07-25 16:21:26 UTC (rev 101) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-modules id="moduleCoreId" project-version="1.5.0"> + <wb-module deploy-name="CSAdminPanel"/> +</project-modules> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <zd...@us...> - 2006-07-24 22:53:49
      
     | 
| Revision: 100 Author: zduniak Date: 2006-07-24 15:51:27 -0700 (Mon, 24 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=100&view=rev Log Message: ----------- Some libraries upgraded to newer versions from Geronimo 1.1 package Modified Paths: -------------- trunk/code/CSAdminPanel/.classpath trunk/code/CSCommon/.classpath trunk/code/CSMiddleware/.classpath trunk/code/CSRemoteClient/.classpath trunk/code/CSTests/.classpath Added Paths: ----------- trunk/code/CSCommon/lib/geronimo-activation_1.0.2_spec-1.1.jar trunk/code/CSCommon/lib/geronimo-javamail_1.3.1_spec-1.1.jar trunk/code/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar trunk/code/CSMiddleware/lib/ehcache-1.2.2.jar trunk/code/CSMiddleware/lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar trunk/code/CSMiddleware/lib/geronimo-j2ee-management_1.0_spec-1.0.1.jar trunk/code/CSMiddleware/lib/geronimo-jms_1.1_spec-1.0.1.jar trunk/code/CSMiddleware/lib/geronimo-jta_1.0.1B_spec-1.0.1.jar trunk/code/CSMiddleware/lib/mx4j-3.0.1.jar trunk/code/CSRemoteClient/lib/geronimo-activation_1.0.2_spec-1.1.jar trunk/code/CSRemoteClient/lib/geronimo-javamail_1.3.1_spec-1.1.jar Removed Paths: ------------- trunk/code/CSCommon/lib/geronimo-activation_1.0.2_spec-1.0.jar trunk/code/CSCommon/lib/geronimo-javamail_1.3.1_spec-1.0.jar trunk/code/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.jar trunk/code/CSMiddleware/lib/ehcache-1.2.jar trunk/code/CSMiddleware/lib/geronimo-j2ee-connector_1.5_spec-1.0.jar trunk/code/CSMiddleware/lib/geronimo-j2ee-management_1.0_spec-1.0.jar trunk/code/CSMiddleware/lib/geronimo-jms_1.1_spec-1.0.jar trunk/code/CSMiddleware/lib/geronimo-jta_1.0.1B_spec-1.0.jar trunk/code/CSMiddleware/lib/mx4j-2.1.1.jar trunk/code/CSRemoteClient/lib/geronimo-activation_1.0.2_spec-1.0.jar trunk/code/CSRemoteClient/lib/geronimo-javamail_1.3.1_spec-1.0.jar Modified: trunk/code/CSAdminPanel/.classpath =================================================================== --- trunk/code/CSAdminPanel/.classpath 2006-07-24 20:32:13 UTC (rev 99) +++ trunk/code/CSAdminPanel/.classpath 2006-07-24 22:51:27 UTC (rev 100) @@ -6,21 +6,14 @@ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container/CSAdminPanel"/> <classpathentry combineaccessrules="false" kind="src" path="/CSCommon"/> <classpathentry kind="lib" path="/CSCommon/lib/log4j-1.2.13.jar"/> - <classpathentry kind="lib" path="/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/javolution.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/spring.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/commons-collections-3.1.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/acegi-security-1.0.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/acegi-security-catalina-1.0.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/commons-logging-1.1.jar"/> - <classpathentry kind="lib" path="WebContent/WEB-INF/lib/tomahawk.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/jdom-1.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/xfire-all-1.1.2.jar"/> - <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-beanutils-1.7.0.jar"/> - <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-digester-1.6.jar"/> - <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-el-1.0.jar"/> - <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jstl-1.1.0.jar"/> - <classpathentry kind="lib" path="WebContent/WEB-INF/lib/myfaces-api-1.1.3.jar"/> - <classpathentry kind="lib" path="WebContent/WEB-INF/lib/myfaces-impl-1.1.3.jar"/> + <classpathentry kind="lib" path="/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar"/> <classpathentry kind="output" path="WebContent/WEB-INF/classes"/> </classpath> Modified: trunk/code/CSCommon/.classpath =================================================================== --- trunk/code/CSCommon/.classpath 2006-07-24 20:32:13 UTC (rev 99) +++ trunk/code/CSCommon/.classpath 2006-07-24 22:51:27 UTC (rev 100) @@ -7,19 +7,19 @@ <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/> <classpathentry kind="lib" path="lib/commons-httpclient-3.0.jar"/> <classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/> - <classpathentry kind="lib" path="lib/geronimo-activation_1.0.2_spec-1.0.jar"/> <classpathentry kind="lib" path="lib/jakarta-oro-2.0.8.jar"/> <classpathentry kind="lib" path="lib/jdom-1.0.jar"/> <classpathentry kind="lib" path="lib/stax-api-1.0.jar"/> <classpathentry kind="lib" path="lib/velocity-1.4.jar"/> <classpathentry kind="lib" path="lib/wsdl4j-1.5.2.jar"/> <classpathentry kind="lib" path="lib/xbean-2.1.0.jar"/> - <classpathentry kind="lib" path="lib-compiletime/geronimo-servlet_2.4_spec-1.0.jar"/> <classpathentry kind="lib" path="lib/javolution.jar"/> <classpathentry kind="lib" path="lib/wstx-asl-2.9.3.jar"/> <classpathentry kind="lib" path="lib/stax-utils-20060501.jar"/> <classpathentry kind="lib" path="lib/acegi-security-1.0.0.jar"/> <classpathentry kind="lib" path="lib/acegi-security-catalina-1.0.0.jar"/> <classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/> + <classpathentry kind="lib" path="lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="lib/geronimo-activation_1.0.2_spec-1.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Deleted: trunk/code/CSCommon/lib/geronimo-activation_1.0.2_spec-1.0.jar =================================================================== (Binary files differ) Added: trunk/code/CSCommon/lib/geronimo-activation_1.0.2_spec-1.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSCommon/lib/geronimo-activation_1.0.2_spec-1.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSCommon/lib/geronimo-javamail_1.3.1_spec-1.0.jar =================================================================== (Binary files differ) Added: trunk/code/CSCommon/lib/geronimo-javamail_1.3.1_spec-1.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSCommon/lib/geronimo-javamail_1.3.1_spec-1.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/code/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.jar =================================================================== (Binary files differ) Modified: trunk/code/CSMiddleware/.classpath =================================================================== --- trunk/code/CSMiddleware/.classpath 2006-07-24 20:32:13 UTC (rev 99) +++ trunk/code/CSMiddleware/.classpath 2006-07-24 22:51:27 UTC (rev 100) @@ -6,9 +6,6 @@ <classpathentry kind="lib" path="lib/commons-dbcp.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/spring.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/log4j-1.2.13.jar"/> - <classpathentry kind="lib" path="lib/geronimo-jms_1.1_spec-1.0.jar"/> - <classpathentry kind="lib" path="lib/geronimo-j2ee-management_1.0_spec-1.0.jar"/> - <classpathentry kind="lib" path="/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.jar"/> <classpathentry kind="lib" path="lib/gnu-hylafax-0.0.9.2.jar"/> <classpathentry kind="lib" path="lib/gnu-inet-ftp-0.0.9.2.jar"/> <classpathentry kind="lib" path="lib/quartz-1.5.2.jar"/> @@ -19,7 +16,6 @@ <classpathentry kind="lib" path="lib/unoil.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/cglib-2.1.3.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/javolution.jar"/> - <classpathentry kind="lib" path="/CSCommon/lib/geronimo-activation_1.0.2_spec-1.0.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/velocity-1.4.jar"/> <classpathentry kind="lib" path="lib/postgresql-8.1-407.jdbc3.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/commons-collections-3.1.jar"/> @@ -34,5 +30,9 @@ <classpathentry kind="lib" path="lib/smsLib1.3.0-rxtx.jar"/> <classpathentry kind="lib" path="lib/activemq-core-4.1-SNAPSHOT.jar"/> <classpathentry kind="lib" path="lib/activeio-core-3.0-SNAPSHOT.jar"/> + <classpathentry kind="lib" path="lib/geronimo-j2ee-management_1.0_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="lib/geronimo-jms_1.1_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="/CSCommon/lib/geronimo-activation_1.0.2_spec-1.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Added: trunk/code/CSMiddleware/lib/ehcache-1.2.2.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSMiddleware/lib/ehcache-1.2.2.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSMiddleware/lib/ehcache-1.2.jar =================================================================== (Binary files differ) Added: trunk/code/CSMiddleware/lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSMiddleware/lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSMiddleware/lib/geronimo-j2ee-connector_1.5_spec-1.0.jar =================================================================== (Binary files differ) Added: trunk/code/CSMiddleware/lib/geronimo-j2ee-management_1.0_spec-1.0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSMiddleware/lib/geronimo-j2ee-management_1.0_spec-1.0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSMiddleware/lib/geronimo-j2ee-management_1.0_spec-1.0.jar =================================================================== (Binary files differ) Added: trunk/code/CSMiddleware/lib/geronimo-jms_1.1_spec-1.0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSMiddleware/lib/geronimo-jms_1.1_spec-1.0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSMiddleware/lib/geronimo-jms_1.1_spec-1.0.jar =================================================================== (Binary files differ) Added: trunk/code/CSMiddleware/lib/geronimo-jta_1.0.1B_spec-1.0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSMiddleware/lib/geronimo-jta_1.0.1B_spec-1.0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSMiddleware/lib/geronimo-jta_1.0.1B_spec-1.0.jar =================================================================== (Binary files differ) Deleted: trunk/code/CSMiddleware/lib/mx4j-2.1.1.jar =================================================================== (Binary files differ) Added: trunk/code/CSMiddleware/lib/mx4j-3.0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSMiddleware/lib/mx4j-3.0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/code/CSRemoteClient/.classpath =================================================================== --- trunk/code/CSRemoteClient/.classpath 2006-07-24 20:32:13 UTC (rev 99) +++ trunk/code/CSRemoteClient/.classpath 2006-07-24 22:51:27 UTC (rev 100) @@ -5,8 +5,6 @@ <classpathentry kind="lib" path="lib/axis.jar"/> <classpathentry kind="lib" path="lib/commons-discovery-0.2.jar"/> <classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/> - <classpathentry kind="lib" path="lib/geronimo-activation_1.0.2_spec-1.0.jar"/> - <classpathentry kind="lib" path="lib/geronimo-javamail_1.3.1_spec-1.0.jar"/> <classpathentry kind="lib" path="lib/jaxrpc.jar"/> <classpathentry kind="lib" path="lib/je.jar"/> <classpathentry kind="lib" path="lib/log4j-1.2.13.jar"/> @@ -14,5 +12,7 @@ <classpathentry kind="lib" path="lib/spring.jar"/> <classpathentry kind="lib" path="lib/wsdl4j-1.5.1.jar"/> <classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/> + <classpathentry kind="lib" path="lib/geronimo-activation_1.0.2_spec-1.1.jar"/> + <classpathentry kind="lib" path="lib/geronimo-javamail_1.3.1_spec-1.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Deleted: trunk/code/CSRemoteClient/lib/geronimo-activation_1.0.2_spec-1.0.jar =================================================================== (Binary files differ) Added: trunk/code/CSRemoteClient/lib/geronimo-activation_1.0.2_spec-1.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSRemoteClient/lib/geronimo-activation_1.0.2_spec-1.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/code/CSRemoteClient/lib/geronimo-javamail_1.3.1_spec-1.0.jar =================================================================== (Binary files differ) Added: trunk/code/CSRemoteClient/lib/geronimo-javamail_1.3.1_spec-1.1.jar =================================================================== (Binary files differ) Property changes on: trunk/code/CSRemoteClient/lib/geronimo-javamail_1.3.1_spec-1.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/code/CSTests/.classpath =================================================================== --- trunk/code/CSTests/.classpath 2006-07-24 20:32:13 UTC (rev 99) +++ trunk/code/CSTests/.classpath 2006-07-24 22:51:27 UTC (rev 100) @@ -14,26 +14,26 @@ <classpathentry kind="lib" path="/CSCommon/lib/log4j-1.2.13.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/spring.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/hibernate3.jar"/> - <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-j2ee-connector_1.5_spec-1.0.jar"/> - <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-j2ee-management_1.0_spec-1.0.jar"/> - <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-jta_1.0.1B_spec-1.0.jar"/> <classpathentry kind="lib" path="lib/spring-mock.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/jakarta-oro-2.0.8.jar"/> <classpathentry kind="lib" path="lib/easymockclassextension.jar"/> - <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-jms_1.1_spec-1.0.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/commons-pool.jar"/> - <classpathentry kind="lib" path="/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/gnu-hylafax-0.0.9.2.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/gnu-inet-ftp-0.0.9.2.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/quartz-1.5.2.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/antlr-2.7.6.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/dom4j-1.6.1.jar"/> - <classpathentry kind="lib" path="/CSMiddleware/lib/ehcache-1.2.jar"/> <classpathentry kind="lib" path="/CSCommon/lib/javolution.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/CSRemoteClient"/> <classpathentry kind="lib" path="/CSRemoteClient/lib/je.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib-notversioned/sapjco.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/backport-util-concurrent-2.1.jar"/> <classpathentry kind="lib" path="/CSMiddleware/lib/activeio-core-3.0-SNAPSHOT.jar"/> + <classpathentry kind="lib" path="/CSMiddleware/lib/ehcache-1.2.2.jar"/> + <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-j2ee-management_1.0_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-jms_1.1_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="/CSMiddleware/lib/geronimo-jta_1.0.1B_spec-1.0.1.jar"/> + <classpathentry kind="lib" path="/CSCommon/lib-compiletime/geronimo-servlet_2.4_spec-1.0.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <mal...@us...> - 2006-07-24 20:32:34
      
     | 
| Revision: 99 Author: malinowskirafal Date: 2006-07-24 13:32:13 -0700 (Mon, 24 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=99&view=rev Log Message: ----------- some fixes Modified Paths: -------------- trunk/code/CSMiddleware/src/org/commsuite/converter/Converter.java trunk/code/CSMiddleware/src/org/commsuite/converter/SimpleConverter.java trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsService.java trunk/code/CSTests/src/org/commsuite/converter/ConverterBuilderTest.java Modified: trunk/code/CSMiddleware/src/org/commsuite/converter/Converter.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/converter/Converter.java 2006-07-23 23:10:27 UTC (rev 98) +++ trunk/code/CSMiddleware/src/org/commsuite/converter/Converter.java 2006-07-24 20:32:13 UTC (rev 99) @@ -127,8 +127,8 @@ converter.setStreams(input, output); } } - } catch (IOException e) { - logger.error("Converter IOException", e); + } catch (Throwable e) { + logger.error("Converter exception", e); throw new ConversionFailedException(e); } @@ -152,16 +152,16 @@ * * @return Exception thorwn during conversion or null if everything was ok. */ - public Exception getException() { + public Throwable getThrowable() { if (simpleConvertersChain == null) { return null; } - Exception result = null; + Throwable result = null; Iterator<SimpleConverter> i = simpleConvertersChain.iterator(); while (i.hasNext()) { - result = i.next().getException(); + result = i.next().getThrowable(); if (result != null) { return result; } Modified: trunk/code/CSMiddleware/src/org/commsuite/converter/SimpleConverter.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/converter/SimpleConverter.java 2006-07-23 23:10:27 UTC (rev 98) +++ trunk/code/CSMiddleware/src/org/commsuite/converter/SimpleConverter.java 2006-07-24 20:32:13 UTC (rev 99) @@ -39,7 +39,7 @@ private OutputStream resultStream; // exception thorwn during conversion - private Exception exception; + private Throwable throwable; /** * Sets streams used during conversion. @@ -72,8 +72,8 @@ * * @return rReturns exception thrown during conversion (if any) or null */ - public Exception getException() { - return exception; + public Throwable getThrowable() { + return throwable; } /** @@ -81,13 +81,13 @@ * and can be obtained by getException method. */ final public void run() { - exception = null; + throwable = null; try { convert(); - } catch (Exception e) { + } catch (Throwable e) { logger.error("", e); - exception = e; + throwable = e; } finally { try { resultStream.close(); Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java 2006-07-23 23:10:27 UTC (rev 98) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/fax/FaxOutboundMessage.java 2006-07-24 20:32:13 UTC (rev 99) @@ -107,9 +107,9 @@ String temporaryFileName = hylaFAXClient.putTemporary(new ByteArrayInputStream(converted)); - Exception e = getConverter().getException(); - if (e != null) { - throw new OutboundMessageConversionFailedException(e); + Throwable t = getConverter().getThrowable(); + if (t != null) { + throw new OutboundMessageConversionFailedException(t); } // TODO: consider using this parameters: Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java 2006-07-23 23:10:27 UTC (rev 98) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsDevice.java 2006-07-24 20:32:13 UTC (rev 99) @@ -42,8 +42,7 @@ import org.smslib.CService; /** - * Implementation of SMS device using SMSLib (<a - * href="http://smslib.org">http://smslib.org</a>). + * Implementation of SMS device using SMSLib. * * @since 1.0 * @author Rafał Malinowski @@ -51,465 +50,417 @@ */ public final class SmsDevice extends Device { - private static final Logger logger = Logger.getLogger(SmsDevice.class); + private static final Logger logger = Logger.getLogger(SmsDevice.class); - protected String port; + protected String port; - protected String gsmDeviceManufacturer; + protected String gsmDeviceManufacturer; - protected String gsmDeviceModel; + protected String gsmDeviceModel; - protected int baud; + protected int baud; - protected boolean changeUTFCharacters; + protected boolean changeUTFCharacters; - protected int maxMessageLength; + protected int maxMessageLength; - protected String warningsReceiver; + protected String warningsReceiver; - protected int warningBatteryLevel; + protected int warningBatteryLevel; - protected int warningSignalLevel; + protected int warningSignalLevel; - // 30 minutes by default: - protected int warningsInterval = 60 * 30; + // 30 minutes by default: + protected int warningsInterval = 60 * 30; - private long lastBatteryWarning; + private long lastBatteryWarning; - private long lastSignalWarning; + private long lastSignalWarning; - private SmsService service; + private CService service; - /** - * Creates new {@link SmsDevice}. - * - * @param name - * unique name of device - */ - public SmsDevice(String name) { - super(name); - setState(Device.State.OFF); - } + /** + * Creates new SmsDevice. + * + * @param name unique name of device + */ + public SmsDevice(String name) { + super(name); + setState(Device.State.OFF); + } - /** - * Connects to GSM modem. - * - * @throws DeviceInitializationFailedException - * when connection failed - */ - public void init() throws DeviceInitializationFailedException { - setState(Device.State.INITIALIZING); + /** + * Connects to GSM modem. + * + * @throws DeviceInitializationFailedException when connection failed + */ + public void init() throws DeviceInitializationFailedException { + setState(Device.State.INITIALIZING); - try { - synchronized (SmsDevice.class) { - service = new SmsService(this, getPort(), getBaud(), - getGsmDeviceManufacturer(), getGsmDeviceModel()); - logger - .info("Using " + CService._name + " " - + CService._version); + try { + synchronized (SmsDevice.class) { + service = new SmsService(this, getPort(), getBaud(), getGsmDeviceManufacturer(), + getGsmDeviceModel()); + logger.info("Using " + CService._name + " " + CService._version); - service.setReceiveMode(SmsService.RECEIVE_MODE_ASYNC_POLL); + service.setReceiveMode(SmsService.RECEIVE_MODE_ASYNC_POLL); - service.setSimPin(""); - service.connect(); + service.setSimPin(""); + service.connect(); - logger.debug("IsConnected: " + service.getConnected()); + logger.debug("IsConnected: " + service.getConnected()); - if (service.getConnected()) { - setState(Device.State.ON); + if (service.getConnected()) { + setState(Device.State.ON); - service.setSmscNumber(""); - service.refreshDeviceInfo(); + service.setSmscNumber(""); + service.refreshDeviceInfo(); - // Print out GSM device info... - if (logger.isInfoEnabled()) { - logger.info("Mobile Device Information: "); - logger.info("Manufacturer : " - + service.getDeviceInfo().getManufacturer()); - logger.info("Model : " - + service.getDeviceInfo().getModel()); - logger.info("Serial No : " - + service.getDeviceInfo().getSerialNo()); - logger.info("IMSI : " - + service.getDeviceInfo().getImsi()); - logger.info("S/W Version : " - + service.getDeviceInfo().getSwVersion()); - logger.info("Battery Level : " - + service.getDeviceInfo().getBatteryLevel() - + "%"); - logger.info("Signal Level : " - + service.getDeviceInfo().getSignalLevel() - + "%"); - } - } else { - setState(Device.State.OFF); - } - } - } catch (Throwable t) { - logger.error("", t); + // Print out GSM device info... + if (logger.isInfoEnabled()) { + logger.info("Mobile Device Information: "); + logger.info("Manufacturer : " + service.getDeviceInfo().getManufacturer()); + logger.info("Model : " + service.getDeviceInfo().getModel()); + logger.info("Serial No : " + service.getDeviceInfo().getSerialNo()); + logger.info("IMSI : " + service.getDeviceInfo().getImsi()); + logger.info("S/W Version : " + service.getDeviceInfo().getSwVersion()); + logger.info("Battery Level : " + service.getDeviceInfo().getBatteryLevel() + + "%"); + logger.info("Signal Level : " + service.getDeviceInfo().getSignalLevel() + + "%"); + } + } else { + setState(Device.State.OFF); + } + } + } catch (Throwable t) { + logger.error("", t); - setState(Device.State.OFF); - throw new DeviceInitializationFailedException(t); - } - } + setState(Device.State.OFF); + throw new DeviceInitializationFailedException(t); + } + } - /** - * Disconnects from GSM modem. - * - * @throws DeviceShutdownFailedException - * when disconnection failed - */ - public void shutdown() throws DeviceShutdownFailedException { - try { - // TODO: kod bezpiecznie zamykający urządzenie - service.disconnect(); - setState(Device.State.OFF); - } catch (Throwable t) { - logger.error("", t); - setState(Device.State.OFF); - throw new DeviceShutdownFailedException(t); - } - } + /** + * Disconnects to GSM modem. + * + * @throws DeviceShutdownFailedException when disconnection failed + */ + public void shutdown() throws DeviceShutdownFailedException { + try { + // TODO: kod bezpiecznie zamykający urządzenie + service.disconnect(); - public String getGsmDeviceManufacturer() { - return gsmDeviceManufacturer; - } + setState(Device.State.OFF); + } catch (Throwable t) { + logger.error("", t); + setState(Device.State.OFF); + throw new DeviceShutdownFailedException(t); + } + } - public void setGsmDeviceManufacturer(String gsmDeviceManufacturer) { - this.gsmDeviceManufacturer = gsmDeviceManufacturer; - } + public String getGsmDeviceManufacturer() { + return gsmDeviceManufacturer; + } - public String getGsmDeviceModel() { - return gsmDeviceModel; - } + public void setGsmDeviceManufacturer(String gsmDeviceManufacturer) { + this.gsmDeviceManufacturer = gsmDeviceManufacturer; + } - public void setGsmDeviceModel(String gsmDeviceModel) { - this.gsmDeviceModel = gsmDeviceModel; - } + public String getGsmDeviceModel() { + return gsmDeviceModel; + } - public String getPort() { - return port; - } + public void setGsmDeviceModel(String gsmDeviceModel) { + this.gsmDeviceModel = gsmDeviceModel; + } - public void setPort(String port) { - this.port = port; - } + public String getPort() { + return port; + } - public int getBaud() { - return baud; - } + public void setPort(String port) { + this.port = port; + } - public void setBaud(int baud) { - this.baud = baud; - } + public int getBaud() { + return baud; + } - public void setChangeUTFCharacters(boolean changeUTFCharacters) { - this.changeUTFCharacters = changeUTFCharacters; - } + public void setBaud(int baud) { + this.baud = baud; + } - public boolean getChangeUTFCharacters() { - return changeUTFCharacters; - } + public void setChangeUTFCharacters(boolean changeUTFCharacters) { + this.changeUTFCharacters = changeUTFCharacters; + } - public void setMaxMessageLength(int maxMessageLength) { - this.maxMessageLength = maxMessageLength; - } + public boolean getChangeUTFCharacters() { + return changeUTFCharacters; + } - public int getMaxMessageLenght() { - return maxMessageLength; - } + public void setMaxMessageLength(int maxMessageLength) { + this.maxMessageLength = maxMessageLength; + } - public void setWarningsReceiver(String warningsReciever) { - this.warningsReceiver = warningsReciever; - } + public int getMaxMessageLenght() { + return maxMessageLength; + } - public String getWarningsReceiver() { - return warningsReceiver; - } + public void setWarningsReceiver(String warningsReciever) { + this.warningsReceiver = warningsReciever; + } - public void setWarningBatteryLevel(int warningBatteryLevel) { - this.warningBatteryLevel = warningBatteryLevel; - } + public String getWarningsReceiver() { + return warningsReceiver; + } - public int getWarningBatteryLevel() { - return warningBatteryLevel; - } + public void setWarningBatteryLevel(int warningBatteryLevel) { + this.warningBatteryLevel = warningBatteryLevel; + } - public void setWarningSignalLevel(int warningSignalLevel) { - this.warningSignalLevel = warningSignalLevel; - } + public int getWarningBatteryLevel() { + return warningBatteryLevel; + } - public int getWarningSignalLevel() { - return warningSignalLevel; - } + public void setWarningSignalLevel(int warningSignalLevel) { + this.warningSignalLevel = warningSignalLevel; + } - /** - * Set interval in seconds. - * - * By default 30 minutes. - */ - public void setWarningsInterval(int warningsInterval) { - this.warningsInterval = warningsInterval; - } + public int getWarningSignalLevel() { + return warningSignalLevel; + } - /** - * Get interval in seconds. - * - * @return - */ - public int getWarningsInterval() { - return warningsInterval; - } + /** + * Set interval in seconds. + * + * By default 30 minutes. + */ + public void setWarningsInterval(int warningsInterval) { + this.warningsInterval = warningsInterval; + } - /** - * Creates new message that can be sent using this device. - * - * @return new message that can be sent using this device - */ - public OutboundMessage createOutboundMessage() { - return new SmsOutboundMessage(this); - } + /** + * Get interval in seconds. + * @return + */ + public int getWarningsInterval() { + return warningsInterval; + } - /** - * Sends message throught GSM modem. Message can only have plain/text data. - * - * @throws DeviceInvalidOutboundMessageException - * message was created on another device - * @throws OutboundMessageInvalidContentMimeTypeException - * message does not have text/plain data - * @throws OutboundMessageInvalidContentException - * message is too long - * @throws OutboundMessageSendException - * an error occured - */ - public void send(OutboundMessage message) - throws DeviceInvalidOutboundMessageException, - OutboundMessageInvalidContentMimeTypeException, - OutboundMessageInvalidContentException, - OutboundMessageInvalidDestinationAddressException, - OutboundMessageSendException, - OutboundMessageConversionFailedException { - if (!(message instanceof SmsOutboundMessage)) { - throw new DeviceInvalidOutboundMessageException( - "SmsDevice can handle only SmsOutboundMessage"); - } + /** + * Creates new message that can be sent using this device. + * + * @return new message that can be sent using this device + */ + public OutboundMessage createOutboundMessage() { + return new SmsOutboundMessage(this); + } - if (message.getDevice() != this) { - throw new DeviceInvalidOutboundMessageException( - "SmsDevice can handle only SmsOutboundMessage that it created"); - } + /** + * Sends message throught GSM modem. Message can only have plain/text data. + * + * @throws DeviceInvalidOutboundMessageException message was created on another device + * @throws OutboundMessageInvalidContentMimeTypeException message does not have text/plain data + * @throws OutboundMessageInvalidContentException message is too long + * @throws OutboundMessageSendException an error occured + */ + public void send(OutboundMessage message) throws DeviceInvalidOutboundMessageException, + OutboundMessageInvalidContentMimeTypeException, OutboundMessageInvalidContentException, + OutboundMessageInvalidDestinationAddressException, OutboundMessageSendException, + OutboundMessageConversionFailedException { + if (!(message instanceof SmsOutboundMessage)) { + throw new DeviceInvalidOutboundMessageException( + "SmsDevice can handle only SmsOutboundMessage"); + } - final byte[] data = message.getContent(); - String text; - try { - text = new String(data, "UTF-8"); - } catch (UnsupportedEncodingException e) { - logger - .warn( - "Exception during internally converting SMS into String", - e); - // default charset: - text = new String(data); - } + if (message.getDevice() != this) { + throw new DeviceInvalidOutboundMessageException( + "SmsDevice can handle only SmsOutboundMessage that it created"); + } - if (text.length() > maxMessageLength) { - throw new OutboundMessageInvalidContentException( - "SMS message is too long, cannot be sent"); - } + final byte[] data = message.getContent(); + String text; + try { + text = new String(data, "UTF-8"); + } catch (UnsupportedEncodingException e) { + logger.warn("Exception during internally converting SMS into String", e); + // default charset: + text = new String(data); + } - try { - if (changeUTFCharacters) { - text = removeUTFCharacters(text); - } - } catch (UnsupportedEncodingException e) { - logger.fatal("", e); - } + if (text.length() > maxMessageLength) { + throw new OutboundMessageInvalidContentException( + "SMS message is too long, cannot be sent"); + } - final int batteryCurrentLevel = service.getDeviceInfo() - .getBatteryLevel(); - if (batteryCurrentLevel < warningBatteryLevel) { - final Date now = new Date(); - final long seconds = now.getTime() / 1000L; + try { + if (changeUTFCharacters) { + text = removeUTFCharacters(text); + } + } catch (UnsupportedEncodingException e) { + logger.fatal("", e); + } - if (seconds - lastBatteryWarning >= warningsInterval) { - final TextBuilder tb = new TextBuilder(); - tb.append("CS: Battery level ").append(batteryCurrentLevel) - .append("% is lower than ").append(warningBatteryLevel) - .append("%"); - final String warningMsg = tb.toString(); + final int batteryCurrentLevel = service.getDeviceInfo().getBatteryLevel(); + if (batteryCurrentLevel < warningBatteryLevel) { + final Date now = new Date(); + final long seconds = now.getTime() / 1000L; - logger.warn(warningMsg); + if (seconds - lastBatteryWarning >= warningsInterval) { + final TextBuilder tb = new TextBuilder(); + tb.append("CS: Battery level ").append(batteryCurrentLevel).append( + "% is lower than ").append(warningBatteryLevel).append("%"); + final String warningMsg = tb.toString(); - if (null != warningsReceiver) { - sendSMSMessage(warningMsg, warningsReceiver); - } - } + logger.warn(warningMsg); - lastBatteryWarning = seconds; - } + if (null != warningsReceiver && !"".equals(warningsReceiver)) { + sendSMSMessage(warningMsg, warningsReceiver); + } + } - final int signalCurrentLevel = service.getDeviceInfo().getSignalLevel(); - if (signalCurrentLevel < warningSignalLevel) { - final Date now = new Date(); - final long seconds = now.getTime() / 1000L; + lastBatteryWarning = seconds; + } - if (seconds - lastSignalWarning >= warningsInterval) { - final TextBuilder tb = new TextBuilder(); - tb.append("CS: Signal level ").append(signalCurrentLevel) - .append("% is lower than ").append(warningSignalLevel) - .append("%"); - final String warningMsg = tb.toString(); + final int signalCurrentLevel = service.getDeviceInfo().getSignalLevel(); + if (signalCurrentLevel < warningSignalLevel) { + final Date now = new Date(); + final long seconds = now.getTime() / 1000L; - logger.warn(warningMsg); + if (seconds - lastSignalWarning >= warningsInterval) { + final TextBuilder tb = new TextBuilder(); + tb.append("CS: Signal level ").append(signalCurrentLevel) + .append("% is lower than ").append(warningSignalLevel).append("%"); + final String warningMsg = tb.toString(); - if (null != warningsReceiver) { - sendSMSMessage(warningMsg, warningsReceiver); - } - } + logger.warn(warningMsg); - lastSignalWarning = seconds; - } + if (null != warningsReceiver && !"".equals(warningsReceiver)) { + sendSMSMessage(warningMsg, warningsReceiver); + } + } - final String messageId = sendSMSMessage(text, message - .getDestinationAddress()); + lastSignalWarning = seconds; + } - if (null != messageId) { - message.setMessageId(messageId); - } else { - logger - .fatal("SMS messageId obtained during sending process is null"); - throw new OutboundMessageSendException( - "Error during sending SMS: SMS messageId obtained during sending process is null"); - } - } + final String messageId = sendSMSMessage(text, message.getDestinationAddress()); - private static String removeUTFCharacters(String text) - throws UnsupportedEncodingException { - logger.debug("Converting :" + text); + if (null != messageId) { + message.setMessageId(messageId); + } else { + logger.fatal("SMS messageId obtained during sending process is null"); + throw new OutboundMessageSendException( + "Error during sending SMS: SMS messageId obtained during sending process is null"); + } + } - // TODO: [RM] przemyslec i zaproponowac rozwiazanie ogolne dla takiej - // konwersji, dla znakow - // diakrytycznych rowniez innych jezykow. Byc moze istnieja do tego - // jakies biblioteki. - final String result = text.replace('\u0105', 'a') - .replace('\u0104', 'A').replace('\u0107', 'c').replace( - '\u0105', 'C').replace('\u0119', 'e').replace('\u0118', - 'E').replace('\u0142', 'l').replace('\u0141', 'L') - .replace('\u0144', 'n').replace('\u0143', 'N').replace( - '\u00f3', 'o').replace('\u00d3', 'O').replace('\u015b', - 's').replace('\u015a', 'S').replace('\u017a', 'z') - .replace('\u0179', 'Z').replace('\u017c', 'z').replace( - '\u017b', 'z'); + private static String removeUTFCharacters(String text) throws UnsupportedEncodingException { + logger.debug("Converting :" + text); - logger.debug("Converted to :" + result); + // TODO: [RM] przemyslec i zaproponowac rozwiazanie ogolne dla takiej konwersji, dla znakow + // diakrytycznych rowniez innych jezykow. Byc moze istnieja do tego jakies biblioteki. + final String result = text.replace('\u0105', 'a').replace('\u0104', 'A').replace('\u0107', + 'c').replace('\u0105', 'C').replace('\u0119', 'e').replace('\u0118', 'E').replace( + '\u0142', 'l').replace('\u0141', 'L').replace('\u0144', 'n').replace('\u0143', 'N') + .replace('\u00f3', 'o').replace('\u00d3', 'O').replace('\u015b', 's').replace( + '\u015a', 'S').replace('\u017a', 'z').replace('\u0179', 'Z').replace( + '\u017c', 'z').replace('\u017b', 'z'); - return result; - } + logger.debug("Converted to :" + result); - /** - * @return unique message-id of sent SMS - * @throws OutboundMessageSendException - */ - private String sendSMSMessage(String text, String phone) - throws OutboundMessageSendException { + return result; + } - // REFACTOR: Kod laczacy sie z modemem GSM i inicjuacy polaczenia - // nalezy przeniesc do metody #init(), a tutaj jedynie weryfikowac czy - // polaczenie - // jest nadal aktywne. Jesli nie jest aktywne to np. sprobowac 2 razy je - // ponownie - // zainicjowac - jesli sie nie uda to zrobic tak by ten SmsDevice byl - // nieaktywny i wrzucic - // stosowny fatal do logow. + /** + * @return unique message-id of sent SMS + * @throws OutboundMessageSendException + */ + private String sendSMSMessage(String text, String phone) throws OutboundMessageSendException { - int messageId; + // REFACTOR: Kod laczacy sie z modemem GSM i incujacy polaczenia + // nalezy przeniesc do metody #init(), a tutaj jedynie weryfikowac czy polaczenie + // jest nadal aktywne. Jesli nie jest aktywne to np. sprobowac 2 razy je ponownie + // zainicjowac - jesli sie nie uda to zrobic tak by ten SmsDevice byl nieaktywny i wrzucic + // stosowny fatal do logow. - if (logger.isDebugEnabled()) { - logger.debug("Sending message to: " + phone); - logger.debug("Message text to send: " + text); - } + int messageId; - if (phone.startsWith("+")) { - phone = phone.substring(1); - } + if (logger.isDebugEnabled()) { + logger.debug("Sending message to: " + phone); + logger.debug("Message text to send: " + text); + } - // Create a COutgoingMessage object. - final COutgoingMessage msg = new COutgoingMessage(phone, text); + if (phone.startsWith("+")) { + phone = phone.substring(1); + } - // Character set is 7bit by default. - msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_7BIT); + // Create a COutgoingMessage object. + final COutgoingMessage msg = new COutgoingMessage(phone, text); - // TODO: We are interested in status reports, so we should switch below - // option to 'true' state in next version of this software - // TODO: When message is sending we should check if in database are - // messages with internalId - // equal to uniqueId of message - // If they exists, we should set insternalId's of them to internalId + - // ':' + GUID - // So we will have unique internalId, and we will get status reports - // properly. - // internalId conists of refNr and destinationAddress of SMS - msg.setStatusReport(true); - msg.setFlashSms(false); - msg.setDate(new Date()); // current time + // Character set is 7bit by default. + msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_7BIT); - // REVIEW: [RM] czy to jest poprawne miejsce do synchronizacji ? Byc - // moze mogli bysmy - // mniejsza czesc procesu wysylania SMSa zsynchronizowac, np. dopiero od - // wywolania metody: - // srv.connect() ? + // TODO: We are interested in status reports, so we should switch below + // option to 'true' state in next version of this software + // TODO: When message is sending we should check if in database are messages with internalId + // equal to uniqueId of message + // If they exists, we should set insternalId's of them to internalId + ':' + GUID + // So we will have unique internalId, and we will get status reports properly. + // internalId conists of refNr and destinationAddress of SMS + msg.setStatusReport(true); + msg.setFlashSms(false); + msg.setDate(new Date()); // current time - // NOTE: We assume that there might be more than one object of type - // {@link SmsDevice} - // therefore we are synchronizing by class and not by object of this - // class. - synchronized (SmsDevice.class) { - try { - if (!service.getConnected()) { - init(); // reconnect - } + // REVIEW: [RM] czy to jest poprawne miejsce do synchronizacji ? Byc moze mogli bysmy + // mniejsza czesc procesu wysylania SMSa zsynchronizowac, np. dopiero od wywolania metody: + // srv.connect() ? - if (!service.getConnected()) { - throw new OutboundMessageSendException( - "Cannot connect to SmsDevie"); - } + // NOTE: We assume that there might be more than one object of type {@link SmsDevice} + // therefore we are synchronizing by class and not by object of this class. + synchronized (SmsDevice.class) { + try { + if (!service.getConnected()) { + init(); // reconnect + } - service.sendMessage(msg); + if (!service.getConnected()) { + throw new OutboundMessageSendException("Cannot connect to SmsDevie"); + } - // {@link COutgoingMessage#getRefNo()} returns the Reference - // Number of the - // message. The Reference Number is returned from the SMSC upon - // succesful - // dispatch of a message: - messageId = msg.getRefNo(); - } catch (Throwable t1) { - logger.fatal("Exception during sending SMS", t1); - throw new OutboundMessageSendException( - "Cannot connect to SmsDevie", t1); - } - } + service.sendMessage(msg); - if (logger.isDebugEnabled()) { - logger.debug("messageId is: " + Integer.toString(messageId) + "@" - + phone); - } + // {@link COutgoingMessage#getRefNo()} returns the Reference Number of the + // message. The Reference Number is returned from the SMSC upon succesful + // dispatch of a message: + messageId = msg.getRefNo(); + } catch (Throwable t1) { + logger.fatal("Exception during sending SMS", t1); + throw new OutboundMessageSendException("Cannot connect to SmsDevie", t1); + } + } - // TODO: [RM] make it more unique: - if (messageId == -1) { - return null; - } else { - return Integer.toString(messageId) + "@" + phone; - } - } + if (logger.isDebugEnabled()) { + logger.debug("messageId is: " + Integer.toString(messageId) + "@" + phone); + } + + // TODO: [RM] make it more unique: + if (messageId == -1) { + return null; + } + else { + return Integer.toString(messageId) + "@" + phone; + } + } - /** - * Returns {@link FormatType#SMS}. - * - * @return FormatType.SMS - */ - public FormatType getFormatType() { - return FormatType.SMS; - } + /** + * Returns FormatType.SMS. + * + * @return FormatType.SMS + */ + public FormatType getFormatType() { + return FormatType.SMS; + } } Modified: trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsService.java =================================================================== --- trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsService.java 2006-07-23 23:10:27 UTC (rev 98) +++ trunk/code/CSMiddleware/src/org/commsuite/devices/sms/SmsService.java 2006-07-24 20:32:13 UTC (rev 99) @@ -58,6 +58,9 @@ logger.debug("Received SMS"); try { + // TODO: deleteMessage jest wywoływane także w CService + // to pewnie zmiana w nowej wersji + // sprawdzić, czy kod ten mozna usunąć deleteMessage(message); } catch (Exception e) { logger Modified: trunk/code/CSTests/src/org/commsuite/converter/ConverterBuilderTest.java =================================================================== --- trunk/code/CSTests/src/org/commsuite/converter/ConverterBuilderTest.java 2006-07-23 23:10:27 UTC (rev 98) +++ trunk/code/CSTests/src/org/commsuite/converter/ConverterBuilderTest.java 2006-07-24 20:32:13 UTC (rev 99) @@ -51,7 +51,7 @@ } private void convertFile(String inFile, String inMimeType, String outFile, String outMimeType) - throws Exception { + throws Throwable { InputStream in = null; File fin = null; OutputStream out = null; @@ -90,8 +90,8 @@ out.write(outContent, 0, outContent.length); - if (converter.getException() != null) - throw converter.getException(); + if (converter.getThrowable() != null) + throw converter.getThrowable(); assertTrue("File " + outFile + " should not be empty!", new File(outPath + outFile).length() != 0); } finally { @@ -111,41 +111,41 @@ assertEquals("url wrong", SpringMiddlewareContext.getProperty("commsuite.converter.OpenOfficeOrg.directory") + "soffice", url.getPath()); } - public void testConversionsXlsToPdf() throws Exception { - convertFile("example.xls", "application/x-msexcel", "xls_to_pdf.pdf", "application/pdf"); - } +// public void testConversionsXlsToPdf() throws Exception { +// convertFile("example.xls", "application/x-msexcel", "xls_to_pdf.pdf", "application/pdf"); +// } +// +// public void testConversionsDocToPdf() throws Exception { +// convertFile("example.doc", "application/msword", "doc_to_pdf.pdf", "application/pdf"); +// } +// +// public void testConversionsOdtToPdf() throws Exception { +// convertFile("example.odt", "application/vnd.oasis.opendocument.text", "odt_to_pdf.pdf", +// "application/pdf"); +// } +// +// public void testConversionsPptToPdf() throws Exception { +// convertFile("example.ppt", "application/vnd.ms-powerpoint", "ppt_to_pdf.pdf", +// "application/pdf"); +// } +// +// public void testConversionsPngToTiff() throws Exception { +// convertFile("example.png", "image/x-png", "png_to_tiff.tiff", "image/tiff"); +// } +// +// public void testConversionsPngToPdf() throws Exception { +// convertFile("example.png", "image/x-png", "png_to_pdf.pdf", "application/pdf"); +// } - public void testConversionsDocToPdf() throws Exception { - convertFile("example.doc", "application/msword", "doc_to_pdf.pdf", "application/pdf"); - } - - public void testConversionsOdtToPdf() throws Exception { - convertFile("example.odt", "application/vnd.oasis.opendocument.text", "odt_to_pdf.pdf", - "application/pdf"); - } - - public void testConversionsPptToPdf() throws Exception { - convertFile("example.ppt", "application/vnd.ms-powerpoint", "ppt_to_pdf.pdf", - "application/pdf"); - } - - public void testConversionsPngToTiff() throws Exception { - convertFile("example.png", "image/x-png", "png_to_tiff.tiff", "image/tiff"); - } - - public void testConversionsPngToPdf() throws Exception { - convertFile("example.png", "image/x-png", "png_to_pdf.pdf", "application/pdf"); - } - - public void testConversionstiffToPdf() throws Exception { + public void testConversionstiffToPdf() throws Throwable { convertFile("example.tiff", "image/tiff", "tiff_to_pdf.pdf", "application/pdf"); } - - public void testConversionsBmpToPdf() throws Exception { - convertFile("example.bmp", "image/bmp", "bmp_to_pdf.pdf", "application/pdf"); - } - - public void testConversionsJpegToPdf() throws Exception { - convertFile("example.jpg", "image/jpeg", "jpeg_to_pdf.pdf", "application/pdf"); - } +// +// public void testConversionsBmpToPdf() throws Exception { +// convertFile("example.bmp", "image/bmp", "bmp_to_pdf.pdf", "application/pdf"); +// } +// +// public void testConversionsJpegToPdf() throws Exception { +// convertFile("example.jpg", "image/jpeg", "jpeg_to_pdf.pdf", "application/pdf"); +// } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <zd...@us...> - 2006-07-23 23:10:32
      
     | 
| Revision: 98 Author: zduniak Date: 2006-07-23 16:10:27 -0700 (Sun, 23 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=98&view=rev Log Message: ----------- file for diff testing removed Removed Paths: ------------- trunk/docs/test.txt Deleted: trunk/docs/test.txt =================================================================== --- trunk/docs/test.txt 2006-07-23 23:03:22 UTC (rev 97) +++ trunk/docs/test.txt 2006-07-23 23:10:27 UTC (rev 98) @@ -1 +0,0 @@ -ABC1 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: <zd...@us...> - 2006-07-23 23:03:27
      
     | 
| Revision: 97 Author: zduniak Date: 2006-07-23 16:03:22 -0700 (Sun, 23 Jul 2006) ViewCVS: http://svn.sourceforge.net/comsuite/?rev=97&view=rev Log Message: ----------- diifs test Modified Paths: -------------- trunk/docs/test.txt Modified: trunk/docs/test.txt =================================================================== --- trunk/docs/test.txt 2006-07-23 21:09:06 UTC (rev 96) +++ trunk/docs/test.txt 2006-07-23 23:03:22 UTC (rev 97) @@ -1 +1 @@ -ABC \ No newline at end of file +ABC1 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. | 
| 
      
      
      From: Marcin Z. <mar...@bc...> - 2006-07-01 13:28:10
      
     | 
| hello2 |