Merge remote branch 'upstream/master'

This commit is contained in:
Victor Saisa Lopez
2012-07-13 12:29:49 -04:00
6 changed files with 248 additions and 200 deletions

View File

@@ -1,4 +1,5 @@
<?php <?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php'; require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php'; require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php'; require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
@@ -11,10 +12,10 @@ require_once PATH_TRUNK . 'workflow/engine/classes/class.net.php';
/** /**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32. * Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32.
*/ */
class classNETTest extends PHPUnit_Framework_TestCase class classNETTest extends PHPUnit_Framework_TestCase
{ {
/** /**
* @var NET * @var NET
*/ */
@@ -26,7 +27,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
*/ */
protected function setUp() protected function setUp()
{ {
$this->object = new NET(); $this->object = new NET('192.168.11.21');
} }
/** /**
@@ -35,6 +36,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
*/ */
protected function tearDown() protected function tearDown()
{ {
} }
/** /**
@@ -43,7 +45,8 @@ class classNETTest extends PHPUnit_Framework_TestCase
*/ */
public function testNumberOfMethodsInThisClass() public function testNumberOfMethodsInThisClass()
{ {
$methods = get_class_methods('NET'); $this->assertTrue( count($methods) == 14); $methods = get_class_methods('NET');
$this->assertTrue(count($methods) == 14);
} }
/** /**
@@ -53,12 +56,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function test__construct() public function test__construct()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' ); $this->assertTrue(in_array('__construct', $methods), 'exists method __construct');
$r = new ReflectionMethod('NET', '__construct'); $r = new ReflectionMethod('NET', '__construct');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pHost'); $this->assertTrue($params[0]->getName() == 'pHost');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -68,12 +71,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testresolv() public function testresolv()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('resolv', $methods ), 'exists method resolv' ); $this->assertTrue(in_array('resolv', $methods), 'exists method resolv');
$r = new ReflectionMethod('NET', 'resolv'); $r = new ReflectionMethod('NET', 'resolv');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pHost'); $this->assertTrue($params[0]->getName() == 'pHost');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -83,12 +86,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testscannPort() public function testscannPort()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('scannPort', $methods ), 'exists method scannPort' ); $this->assertTrue(in_array('scannPort', $methods), 'exists method scannPort');
$r = new ReflectionMethod('NET', 'scannPort'); $r = new ReflectionMethod('NET', 'scannPort');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pPort'); $this->assertTrue($params[0]->getName() == 'pPort');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -98,12 +101,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testis_ipaddress() public function testis_ipaddress()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('is_ipaddress', $methods ), 'exists method is_ipaddress' ); $this->assertTrue(in_array('is_ipaddress', $methods), 'exists method is_ipaddress');
$r = new ReflectionMethod('NET', 'is_ipaddress'); $r = new ReflectionMethod('NET', 'is_ipaddress');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pHost'); $this->assertTrue($params[0]->getName() == 'pHost');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -113,13 +116,13 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testping() public function testping()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('ping', $methods ), 'exists method ping' ); $this->assertTrue(in_array('ping', $methods), 'exists method ping');
$r = new ReflectionMethod('NET', 'ping'); $r = new ReflectionMethod('NET', 'ping');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pTTL'); $this->assertTrue($params[0]->getName() == 'pTTL');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true); $this->assertTrue($params[0]->isOptional() == true);
$this->assertTrue( $params[0]->getDefaultValue() == '3000'); $this->assertTrue($params[0]->getDefaultValue() == '3000');
} }
/** /**
@@ -129,15 +132,15 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testloginDbServer() public function testloginDbServer()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('loginDbServer', $methods ), 'exists method loginDbServer' ); $this->assertTrue(in_array('loginDbServer', $methods), 'exists method loginDbServer');
$r = new ReflectionMethod('NET', 'loginDbServer'); $r = new ReflectionMethod('NET', 'loginDbServer');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pUser'); $this->assertTrue($params[0]->getName() == 'pUser');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
$this->assertTrue( $params[1]->getName() == 'pPasswd'); $this->assertTrue($params[1]->getName() == 'pPasswd');
$this->assertTrue( $params[1]->isArray() == false); $this->assertTrue($params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false); $this->assertTrue($params[1]->isOptional() == false);
} }
/** /**
@@ -147,16 +150,16 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testsetDataBase() public function testsetDataBase()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('setDataBase', $methods ), 'exists method setDataBase' ); $this->assertTrue(in_array('setDataBase', $methods), 'exists method setDataBase');
$r = new ReflectionMethod('NET', 'setDataBase'); $r = new ReflectionMethod('NET', 'setDataBase');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pDb'); $this->assertTrue($params[0]->getName() == 'pDb');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
$this->assertTrue( $params[1]->getName() == 'pPort'); $this->assertTrue($params[1]->getName() == 'pPort');
$this->assertTrue( $params[1]->isArray() == false); $this->assertTrue($params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue($params[1]->isOptional() == true);
$this->assertTrue( $params[1]->getDefaultValue() == ''); $this->assertTrue($params[1]->getDefaultValue() == '');
} }
/** /**
@@ -166,12 +169,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testtryConnectServer() public function testtryConnectServer()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('tryConnectServer', $methods ), 'exists method tryConnectServer' ); $this->assertTrue(in_array('tryConnectServer', $methods), 'exists method tryConnectServer');
$r = new ReflectionMethod('NET', 'tryConnectServer'); $r = new ReflectionMethod('NET', 'tryConnectServer');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pDbDriver'); $this->assertTrue($params[0]->getName() == 'pDbDriver');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -181,12 +184,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testtryOpenDataBase() public function testtryOpenDataBase()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('tryOpenDataBase', $methods ), 'exists method tryOpenDataBase' ); $this->assertTrue(in_array('tryOpenDataBase', $methods), 'exists method tryOpenDataBase');
$r = new ReflectionMethod('NET', 'tryOpenDataBase'); $r = new ReflectionMethod('NET', 'tryOpenDataBase');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pDbDriver'); $this->assertTrue($params[0]->getName() == 'pDbDriver');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -196,12 +199,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testgetDbServerVersion() public function testgetDbServerVersion()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('getDbServerVersion', $methods ), 'exists method getDbServerVersion' ); $this->assertTrue(in_array('getDbServerVersion', $methods), 'exists method getDbServerVersion');
$r = new ReflectionMethod('NET', 'getDbServerVersion'); $r = new ReflectionMethod('NET', 'getDbServerVersion');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'driver'); $this->assertTrue($params[0]->getName() == 'driver');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -211,12 +214,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testdbName() public function testdbName()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('dbName', $methods ), 'exists method dbName' ); $this->assertTrue(in_array('dbName', $methods), 'exists method dbName');
$r = new ReflectionMethod('NET', 'dbName'); $r = new ReflectionMethod('NET', 'dbName');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pAdapter'); $this->assertTrue($params[0]->getName() == 'pAdapter');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
@@ -226,7 +229,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testshowMsg() public function testshowMsg()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('showMsg', $methods ), 'exists method showMsg' ); $this->assertTrue(in_array('showMsg', $methods), 'exists method showMsg');
$r = new ReflectionMethod('NET', 'showMsg'); $r = new ReflectionMethod('NET', 'showMsg');
$params = $r->getParameters(); $params = $r->getParameters();
} }
@@ -238,7 +241,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testgetErrno() public function testgetErrno()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('getErrno', $methods ), 'exists method getErrno' ); $this->assertTrue(in_array('getErrno', $methods), 'exists method getErrno');
$r = new ReflectionMethod('NET', 'getErrno'); $r = new ReflectionMethod('NET', 'getErrno');
$params = $r->getParameters(); $params = $r->getParameters();
} }
@@ -250,9 +253,9 @@ class classNETTest extends PHPUnit_Framework_TestCase
public function testgetErrmsg() public function testgetErrmsg()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('getErrmsg', $methods ), 'exists method getErrmsg' ); $this->assertTrue(in_array('getErrmsg', $methods), 'exists method getErrmsg');
$r = new ReflectionMethod('NET', 'getErrmsg'); $r = new ReflectionMethod('NET', 'getErrmsg');
$params = $r->getParameters(); $params = $r->getParameters();
} }
}
}

View File

@@ -43,7 +43,8 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
*/ */
public function testNumberOfMethodsInThisClass() public function testNumberOfMethodsInThisClass()
{ {
$methods = get_class_methods('PmTable'); $this->assertTrue( count($methods) == 26); $methods = get_class_methods('PmTable');
$this->assertTrue( count($methods) == 26);
} }
/** /**
@@ -320,7 +321,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[1]->getName() == 'tablesList'); $this->assertTrue( $params[1]->getName() == 'tablesList');
$this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == 'Array'); $this->assertTrue( $params[1]->getDefaultValue() == array());
} }
/** /**
@@ -342,7 +343,8 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
public function testgetPropelSupportedColumnTypes() public function testgetPropelSupportedColumnTypes()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('getPropelSupportedColumnTypes', $methods ), 'exists method getPropelSupportedColumnTypes' ); $this->assertTrue( in_array('getPropelSupportedColumnTypes', $methods ),
'exists method getPropelSupportedColumnTypes' );
$r = new ReflectionMethod('PmTable', 'getPropelSupportedColumnTypes'); $r = new ReflectionMethod('PmTable', 'getPropelSupportedColumnTypes');
$params = $r->getParameters(); $params = $r->getParameters();
} }
@@ -406,11 +408,11 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[2]->getName() == 'options'); $this->assertTrue( $params[2]->getName() == 'options');
$this->assertTrue( $params[2]->isArray() == false); $this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true); $this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == 'Array'); $this->assertTrue( $params[2]->getDefaultValue() == array());
$this->assertTrue( $params[3]->getName() == 'verbose'); $this->assertTrue( $params[3]->getName() == 'verbose');
$this->assertTrue( $params[3]->isArray() == false); $this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true); $this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '1'); $this->assertTrue( $params[3]->getDefaultValue() == '1');
} }
}
}

View File

@@ -1,4 +1,5 @@
<?php <?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php'; require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php'; require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php'; require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
@@ -11,10 +12,10 @@ require_once PATH_TRUNK . 'workflow/engine/classes/class.plugin.php';
/** /**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32. * Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32.
*/ */
class classcaseSchedulerPluginTest extends PHPUnit_Framework_TestCase class classcaseSchedulerPluginTest extends PHPUnit_Framework_TestCase
{ {
/** /**
* @var caseSchedulerPlugin * @var caseSchedulerPlugin
*/ */
@@ -26,7 +27,8 @@ class classcaseSchedulerPluginTest extends PHPUnit_Framework_TestCase
*/ */
protected function setUp() protected function setUp()
{ {
$this->object = new caseSchedulerPlugin(); $this->object = new caseSchedulerPlugin('sNamespace', 'sActionId', 'sActionForm',
'sActionSave', 'sActionExecute', 'sActionGetFields');
} }
/** /**
@@ -35,6 +37,7 @@ class classcaseSchedulerPluginTest extends PHPUnit_Framework_TestCase
*/ */
protected function tearDown() protected function tearDown()
{ {
} }
/** /**
@@ -43,7 +46,8 @@ class classcaseSchedulerPluginTest extends PHPUnit_Framework_TestCase
*/ */
public function testNumberOfMethodsInThisClass() public function testNumberOfMethodsInThisClass()
{ {
$methods = get_class_methods('caseSchedulerPlugin'); $this->assertTrue( count($methods) == 1); $methods = get_class_methods('caseSchedulerPlugin');
$this->assertTrue(count($methods) == 1);
} }
/** /**
@@ -53,27 +57,27 @@ class classcaseSchedulerPluginTest extends PHPUnit_Framework_TestCase
public function test__construct() public function test__construct()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' ); $this->assertTrue(in_array('__construct', $methods), 'exists method __construct');
$r = new ReflectionMethod('caseSchedulerPlugin', '__construct'); $r = new ReflectionMethod('caseSchedulerPlugin', '__construct');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'sNamespace'); $this->assertTrue($params[0]->getName() == 'sNamespace');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
$this->assertTrue( $params[1]->getName() == 'sActionId'); $this->assertTrue($params[1]->getName() == 'sActionId');
$this->assertTrue( $params[1]->isArray() == false); $this->assertTrue($params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false); $this->assertTrue($params[1]->isOptional() == false);
$this->assertTrue( $params[2]->getName() == 'sActionForm'); $this->assertTrue($params[2]->getName() == 'sActionForm');
$this->assertTrue( $params[2]->isArray() == false); $this->assertTrue($params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false); $this->assertTrue($params[2]->isOptional() == false);
$this->assertTrue( $params[3]->getName() == 'sActionSave'); $this->assertTrue($params[3]->getName() == 'sActionSave');
$this->assertTrue( $params[3]->isArray() == false); $this->assertTrue($params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false); $this->assertTrue($params[3]->isOptional() == false);
$this->assertTrue( $params[4]->getName() == 'sActionExecute'); $this->assertTrue($params[4]->getName() == 'sActionExecute');
$this->assertTrue( $params[4]->isArray() == false); $this->assertTrue($params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false); $this->assertTrue($params[4]->isOptional() == false);
$this->assertTrue( $params[5]->getName() == 'sActionGetFields'); $this->assertTrue($params[5]->getName() == 'sActionGetFields');
$this->assertTrue( $params[5]->isArray() == false); $this->assertTrue($params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == false); $this->assertTrue($params[5]->isOptional() == false);
} }
}
}

View File

@@ -26,7 +26,8 @@ class classfolderDataTest extends PHPUnit_Framework_TestCase
*/ */
protected function setUp() protected function setUp()
{ {
$this->object = new folderData(); $this->object = new folderData('$sProcessUid', '$sProcessTitle', '$sApplicationUid',
'$sApplicationTitle', '$sUserUid', '$sUserLogin', '$sUserFullName');
} }
/** /**
@@ -43,7 +44,8 @@ class classfolderDataTest extends PHPUnit_Framework_TestCase
*/ */
public function testNumberOfMethodsInThisClass() public function testNumberOfMethodsInThisClass()
{ {
$methods = get_class_methods('folderData'); $this->assertTrue( count($methods) == 1); $methods = get_class_methods('folderData');
$this->assertTrue( count($methods) == 1);
} }
/** /**
@@ -80,5 +82,5 @@ class classfolderDataTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[6]->isOptional () == true); $this->assertTrue( $params[6]->isOptional () == true);
$this->assertTrue( $params[6]->getDefaultValue() == ''); $this->assertTrue( $params[6]->getDefaultValue() == '');
} }
}
}

View File

@@ -66,7 +66,7 @@ class InvalidIndexSearchTextException extends Exception
* @author Herbert Saal Gutierrez * @author Herbert Saal Gutierrez
* *
* @category Colosa * @category Colosa
* @copyright Copyright (c) 2005-2011 Colosa Inc. (http://www.colosa.com) * @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
*/ */
class ApplicationWithoutDelegationRecordsException extends Exception class ApplicationWithoutDelegationRecordsException extends Exception
{ {
@@ -85,6 +85,31 @@ class ApplicationWithoutDelegationRecordsException extends Exception
} }
} }
/**
* Application APP_DATA could not be unserialized exception
*
* @author Herbert Saal Gutierrez
*
* @category Colosa
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
*/
class ApplicationAPP_DATAUnserializeException extends Exception
{
// Redefine the exception so message isn't optional
public function __construct($message, $code = 0)
{
// some code
// make sure everything is assigned properly
parent::__construct ($message, $code);
}
// custom string representation of object
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
}
/** /**
* Implementation to display application data in the PMOS2 grids using Solr * Implementation to display application data in the PMOS2 grids using Solr
* search service * search service
@@ -1015,11 +1040,23 @@ class AppSolr
$unassignedUsers = $result [11]; $unassignedUsers = $result [11];
$unassignedGroups = $result [12]; $unassignedGroups = $result [12];
try {
// create document // create document
$xmlDoc .= $this->buildSearchIndexDocumentPMOS2 ($documentInformation, $dynaformFieldTypes, $xmlDoc .= $this->buildSearchIndexDocumentPMOS2 ($documentInformation, $dynaformFieldTypes,
$lastUpdateDate, $maxPriority, $assignedUsers, $assignedUsersRead, $assignedUsersUnread, $lastUpdateDate, $maxPriority, $assignedUsers, $assignedUsersRead, $assignedUsersUnread,
$draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser, $draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser,
$unassignedUsers, $unassignedGroups); $unassignedUsers, $unassignedGroups);
}
catch ( ApplicationAPP_DATAUnserializeException $e ) {
// exception trying to get application information
//print $e->message +" \n";
//$fh = fopen("./UnserializeError_APP_DATA".".txt", 'a') or die("can't open file");
//fwrite($fh, $e->message . "\n");
//fclose($fh);
// skip and continue with the next application
continue;
}
} }
@@ -1288,7 +1325,7 @@ class AppSolr
if (! $UnSerializedCaseData) { if (! $UnSerializedCaseData) {
// error unserializing // error unserializing
throw new Exception ("Unserialize APP_DATA error. APP_UID: " . $documentData ['APP_UID']); throw new ApplicationAPP_DATAUnserializeException ("Could not unserialize APP_DATA of APP_UID: " . $documentData ['APP_UID']);
} }
else { else {
foreach ($UnSerializedCaseData as $k => $value) { foreach ($UnSerializedCaseData as $k => $value) {
@@ -1390,7 +1427,7 @@ class AppSolr
} }
} }
} // foreach unserialized data } // foreach unserialized data
} }// else unserialize APP_DATA
} // empty APP_DATA } // empty APP_DATA
$writer->endElement (); // end /doc $writer->endElement (); // end /doc

View File

@@ -22,7 +22,7 @@ try {
$userUid = (isset ( $_SESSION ['USER_LOGGED'] ) && $_SESSION ['USER_LOGGED'] != '') ? $_SESSION ['USER_LOGGED'] : null; $userUid = (isset ( $_SESSION ['USER_LOGGED'] ) && $_SESSION ['USER_LOGGED'] != '') ? $_SESSION ['USER_LOGGED'] : null;
if ((($solrConf = System::solrEnv()) !== false) && $action != 'paused') { if (($action == 'todo' || $action == 'draft' || $action == 'sent' || $action == 'selfservice' || $action == 'unassigned' || $action == 'search') && (($solrConf = System::solrEnv()) !== false)) {
G::LoadClass ( 'AppSolr' ); G::LoadClass ( 'AppSolr' );
$ApplicationSolrIndex = new AppSolr ($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']); $ApplicationSolrIndex = new AppSolr ($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);