This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, feature/plugin-repositoryapi has been updated
via 675cdca10a2aa6d1c1af99603d384f8ff9635b5b (commit)
from c7fd5c73df5ae0e3b61a3fb7cb88294bb051714b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=675cdca10a2aa6d1c1af99603d384f8ff9635b5b
commit 675cdca10a2aa6d1c1af99603d384f8ff9635b5b
Author: Roland Mas <[email protected]>
Date: Mon Mar 6 13:39:47 2017 +0100
Return effective time range for repository activities
Clients can specify a time range when requesting repository
activities, but it can get truncated if the server deems it to be too
long. However, the client previously had no way to detect that. So
this commit changes the return value of the
repositoryapi_repositoryActivity method to include the effective time
range that was used.
diff --git a/src/plugins/repositoryapi/include/repositoryapiPlugin.class.php
b/src/plugins/repositoryapi/include/repositoryapiPlugin.class.php
index 3cc5332..dfc1187 100644
--- a/src/plugins/repositoryapi/include/repositoryapiPlugin.class.php
+++ b/src/plugins/repositoryapi/include/repositoryapiPlugin.class.php
@@ -3,7 +3,6 @@
/**
* repositoryapiPlugin Class
*
- *
* Copyright 2016-2017, Roland Mas
* https://fusionforge.org
*
@@ -101,6 +100,18 @@ class repositoryapiPlugin extends Plugin {
array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:RepositoryAPIActivity[]')),
'tns:RepositoryAPIActivity');
+ $server->wsdl->addComplexType(
+ 'RepositoryAPIActivityReturn',
+ 'complexType',
+ 'struct',
+ 'sequence',
+ '',
+ array(
+ 'effective_t0'=>'xsd:int',
+ 'effective_t1'=>'xsd:int',
+ 'activities' => array('name'=>'activities',
'type' => 'tns:ArrayOfRepositoryAPIActivity'),
+ )
+ );
$server->register(
'repositoryapi_repositoryActivity',
array('session_ser'=>'xsd:string',
@@ -109,7 +120,7 @@ class repositoryapiPlugin extends Plugin {
'limit'=>'xsd:int',
'offset'=>'xsd:int',
),
- array('return'=>'tns:ArrayOfRepositoryAPIActivity'),
+ array('return'=>'tns:RepositoryAPIActivityReturn'),
$uri,
$uri.'#repositoryapi_repositoryActivity','rpc','encoded');
@@ -212,7 +223,13 @@ function &repositoryapi_repositoryActivity($session_ser,
$t0, $t1, $limit=0, $of
}
}
- return $results;
+ $return = array(
+ 'effective_t0' => $t0,
+ 'effective_t1' => $t1,
+ 'activities' => $results,
+ );
+
+ return $return;
}
// Local Variables:
diff --git a/tests/func/60_PluginsRepositoryAPI/repositoryapiTest.php
b/tests/func/60_PluginsRepositoryAPI/repositoryapiTest.php
index dc8f3e2..0c0c6c2 100644
--- a/tests/func/60_PluginsRepositoryAPI/repositoryapiTest.php
+++ b/tests/func/60_PluginsRepositoryAPI/repositoryapiTest.php
@@ -1,8 +1,6 @@
<?php
/**
- * Copyright 2011, Roland Mas
- * Copyright 2013, Franck Villaume - TrivialDev
- * Copyright (C) 2015 Inria (Sylvain Beucler)
+ * Copyright 2016-2017, Roland Mas
*
* This file is part of FusionForge.
*
@@ -195,18 +193,18 @@ class RepositoryAPI extends FForge_SeleniumTestCase
// Get activities for repositories
$response =
$soapclient->repositoryapi_repositoryActivity($session,$t0,time(),0,0);
$this->assertNotEquals(NULL,$response);
- $this->assertEquals(5,count($response));
+ $this->assertEquals(5,count($response->activities));
// Check limit/offset
$response =
$soapclient->repositoryapi_repositoryActivity($session,$t0,time(),2,0);
$this->assertNotEquals(NULL,$response);
- $this->assertEquals(2,count($response));
+ $this->assertEquals(2,count($response->activities));
$response =
$soapclient->repositoryapi_repositoryActivity($session,$t0,time(),0,2);
$this->assertNotEquals(NULL,$response);
- $this->assertEquals(3,count($response));
+ $this->assertEquals(3,count($response->activities));
// Check time range
sleep(15);
$response =
$soapclient->repositoryapi_repositoryActivity($session,time()-10,time(),0,0);
$this->assertNotEquals(NULL,$response);
- $this->assertEquals(0,count($response));
+ $this->assertEquals(0,count($response->activities));
}
}
-----------------------------------------------------------------------
Summary of changes:
.../include/repositoryapiPlugin.class.php | 23 +++++++++++++++++++---
.../60_PluginsRepositoryAPI/repositoryapiTest.php | 12 +++++------
2 files changed, 25 insertions(+), 10 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits