Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pixel Humain
api
Commits
f6df8933
Commit
f6df8933
authored
Jun 07, 2019
by
Clément Damiens
Browse files
Merge remote-tracking branch 'origin/master'
parents
98936491
4224070c
Changes
8
Hide whitespace changes
Inline
Side-by-side
ApiModule.php
View file @
f6df8933
...
...
@@ -30,6 +30,9 @@ class ApiModule extends CWebModule
'citizenToolKit.models.*'
,
'eco.models.*'
,
'places.models.*'
,
'news.models.*'
,
'dda.models.*'
,
'costum.models.*'
,
$this
->
id
.
'.models.*'
,
$this
->
id
.
'.components.*'
,
$this
->
id
.
'.messages.*'
,
...
...
assets/js/sig/map.js
View file @
f6df8933
...
...
@@ -740,7 +740,7 @@
//console.dir(this.markersLayer.getBounds());
if
(
"
undefined
"
!=
typeof
this
.
markersLayer
.
getBounds
()
&&
"
undefined
"
!=
typeof
this
.
markersLayer
.
getBounds
().
_northEast
){
thisMap
.
fitBounds
(
this
.
markersLayer
.
getBounds
(),
{
'
maxZoom
'
:
1
4
});
thisMap
.
fitBounds
(
this
.
markersLayer
.
getBounds
(),
{
'
maxZoom
'
:
1
0
});
thisMap
.
zoomOut
();
}
...
...
components/ApiController.php
View file @
f6df8933
...
...
@@ -33,6 +33,10 @@ class ApiController extends Controller
//'getuseridbymail' => array("href" => "/ph/api/getuseridbymail"),
//"updatefield" => array("href" => "/ph/api/person/updatefield"),
),
"activitypub"
=>
array
(
"get"
=>
array
(
"href"
=>
"/ph/api/activitypub/get"
,
"public"
=>
true
),
"actor"
=>
array
(
"href"
=>
"/ph/api/abc/person/actor"
,
"public"
=>
true
)
),
"organization"
=>
array
(
"get"
=>
array
(
"href"
=>
"/ph/api/organization/get"
,
"public"
=>
true
),
/*"updatefield" => array("href" => "/ph/api/organization/updatefield"),
...
...
controllers/ActivitypubController.php
0 → 100644
View file @
f6df8933
<?php
class
ActivitypubController
extends
ApiController
{
protected
function
beforeAction
(
$action
)
{
parent
::
initPage
();
return
parent
::
beforeAction
(
$action
);
}
public
function
actions
()
{
return
array
(
'get'
=>
'api.controllers.activitypub.GetAction'
,
'actor'
=>
'api.controllers.activitypub.ActorAction'
,
);
}
}
\ No newline at end of file
controllers/activitypub/ActorAction.php
0 → 100644
View file @
f6df8933
<?php
class
ActorAction
extends
CAction
{
public
function
run
(
$id
=
null
,
$format
=
"activityStream"
,
$limit
=
1
,
$index
=
0
,
$tags
=
null
,
$multiTags
=
null
,
$key
=
null
,
$insee
=
null
)
{
$controller
=
$this
->
getController
();
$bindMap
=
(
!
empty
(
$id
)
?
TranslateActivityStream
::
$dataBinding_actor
:
null
);
$result
=
Api
::
getData
(
$bindMap
,
$format
,
Citoyen
::
COLLECTION
,
$id
,
$limit
,
$index
,
$tags
,
$multiTags
,
$key
,
$insee
);
Rest
::
json
(
$result
[
'entities'
][
$id
],
null
,
true
,
'application/activity+json; charset=utf-8'
);
Yii
::
app
()
->
end
();
}
}
controllers/activitypub/GetAction.php
0 → 100644
View file @
f6df8933
<?php
class
GetAction
extends
CAction
{
public
function
run
(
$id
=
null
,
$format
=
null
,
$limit
=
50
,
$index
=
0
,
$tags
=
null
,
$multiTags
=
null
,
$key
=
null
,
$insee
=
null
)
{
$controller
=
$this
->
getController
();
if
(
$format
==
Translate
::
FORMAT_AS
)
$bindMap
=
(
empty
(
$id
)
?
TranslateActivityStream
::
$dataBinding_allActivityPub
:
null
);
else
$bindMap
=
(
empty
(
$id
)
?
TranslateCommunecter
::
$dataBinding_allActivityPub
:
TranslateCommunecter
::
$dataBinding_allActivity
);
$result
=
Api
::
getData
(
$bindMap
,
$format
,
ActivityStream
::
COLLECTION
,
$id
,
$limit
,
$index
,
$tags
,
$multiTags
,
$key
,
$insee
);
if
(
$format
==
Translate
::
FORMAT_KML
)
{
$strucKml
=
News
::
getStrucKml
();
Rest
::
xml
(
$result
,
$strucKml
,
$format
);
}
else
if
(
$format
==
Translate
::
FORMAT_MD
)
{
//header('Content-Type: text/markdown');
echo
$result
;
}
Rest
::
json
(
$result
);
Yii
::
app
()
->
end
();
}
}
\ No newline at end of file
controllers/activitypub/WebfingerAction.php
0 → 100644
View file @
f6df8933
<?php
class
WebfingerAction
extends
CAction
{
public
function
run
(
$id
=
null
,
$format
=
null
,
$limit
=
1
,
$index
=
0
,
$tags
=
null
,
$multiTags
=
null
,
$key
=
null
,
$insee
=
null
){
$controller
=
$this
->
getController
();
$bindMap
=
(
!
empty
(
$id
)
?
TranslateActivityStream
::
$dataBinding_webfinger
:
null
);
$result
=
Api
::
getData
(
$bindMap
,
$format
,
ActivityStream
::
COLLECTION2
,
$id
,
$limit
,
$index
,
$tags
,
$multiTags
,
$key
,
$insee
);
Rest
::
json
(
$result
[
'entities'
][
$id
]);
}
}
\ No newline at end of file
data/api.json
View file @
f6df8933
{
{
"swagger"
:
"2.0"
,
"info"
:
{
"version"
:
"0.0.1"
,
...
...
@@ -46,6 +46,13 @@
"type"
:
"string"
,
"required"
:
true
},
"activitypub-id"
:{
"name"
:
"activitypub-id"
,
"in"
:
"path"
,
"description"
:
"The Activity Pub identifier string"
,
"type"
:
"string"
,
"required"
:
true
},
"insee"
:
{
"name"
:
"insee"
,
"in"
:
"query"
,
...
...
@@ -97,6 +104,55 @@
}
},
"paths"
:
{
"/activitypub/get"
:
{
"get"
:
{
"tags"
:
[
"ActivityPub"
],
"parameters"
:
[
],
"description"
:
"Get information about all Activity Pub."
,
"responses"
:
{
"200"
:
{
"description"
:
"The list of Activity Pub."
,
"schema"
:
{
"type"
:
"object"
,
"properties"
:
{
"data"
:
{
"$ref"
:
"#/definitions/allActivitypub"
}
}
}
}
}
}
},
"/activitypub/get/id/{activitypub-id}"
:
{
"get"
:
{
"tags"
:
[
"ActivityPub"
],
"parameters"
:
[
{
"$ref"
:
"#/parameters/activitypub-id"
}
],
"description"
:
"Get information about a ActivityPub."
,
"responses"
:
{
"200"
:
{
"description"
:
"The ActivityPub object"
,
"schema"
:
{
"type"
:
"object"
,
"properties"
:
{
"data"
:
{
"$ref"
:
"#/definitions/activitypub"
}
}
}
}
}
}
},
"/person/get"
:
{
"get"
:
{
"tags"
:
[
...
...
@@ -124,7 +180,7 @@
"type"
:
"object"
,
"properties"
:
{
"data"
:
{
"$ref"
:
"#/definitions/all
Person
"
"$ref"
:
"#/definitions/all
Activitypub
"
}
}
}
...
...
@@ -435,6 +491,7 @@
}
}
},
"definitions"
:
{
"meta"
:
{
"type"
:
"object"
,
...
...
@@ -453,6 +510,82 @@
}
}
},
"allActivitypub"
:
{
"type"
:
"object"
,
"properties"
:
{
"meta"
:
{
"$ref"
:
"#/definitions/meta"
},
"entities"
:
{
"type"
:
"object"
,
"properties"
:
{
"id"
:
{
"type"
:
"object"
,
"properties"
:
{
"@type"
:
{
"type"
:
"string"
,
"description"
:
"Type of element."
},
"verb"
:
{
"type"
:
"string"
,
"description"
:
"Type of verb."
},
"author"
:{
"$ref"
:
"#/definitions/author"
},
"url"
:
{
"$ref"
:
"#/definitions/url"
}
}
}
}
}
}
},
"activitypub"
:
{
"type"
:
"object"
,
"properties"
:
{
"meta"
:
{
"$ref"
:
"#/definitions/meta"
},
"entities"
:
{
"type"
:
"object"
,
"properties"
:
{
"id"
:
{
"type"
:
"object"
,
"properties"
:
{
"@type"
:
{
"type"
:
"string"
,
"description"
:
"Type of element."
},
"verb"
:
{
"type"
:
"string"
,
"description"
:
"Type of verb."
},
"author"
:{
"$ref"
:
"#/definitions/author"
},
"target"
:{
"$ref"
:
"#/definitions/target"
},
"scope"
:{
"type"
:
"string"
},
"object"
:{
"$ref"
:
"#/definitions/object"
},
"url"
:
{
"$ref"
:
"#/definitions/url"
},
"notify"
:{
"$ref"
:
"#/definitions/notify"
}
}
}
}
}
}
},
"allPerson"
:
{
"type"
:
"object"
,
"properties"
:
{
...
...
@@ -625,6 +758,62 @@
}
}
},
"author"
:{
"type"
:
"object"
,
"properties"
:{
"id"
:{
"type"
:
"string"
,
"description"
:
"id author"
},
"name"
:{
"type"
:
"string"
,
"description"
:
"name author"
}
}
},
"target"
:
{
"type"
:
"object"
,
"properties"
:{
"type"
:{
"type"
:
"string"
,
"description"
:
"type"
},
"id"
:{
"type"
:
"string"
,
"description"
:
"id target"
}
}
},
"object"
:
{
"type"
:
"object"
,
"properties"
:{
"displayName"
:{
"type"
:
"string"
,
"description"
:
"type"
},
"displayValue"
:{
"type"
:
"string"
,
"description"
:
"id target"
}
}
},
"notify"
:{
"type"
:
"object"
,
"properties"
:{
"objectType"
:{
"type"
:
"string"
,
"description"
:
"objectType notify"
},
"id"
:{
"type"
:
"string"
,
"description"
:
"id notify"
},
"displayName"
:{
"type"
:
"string"
,
"description"
:
"description notifiy"
}
}
},
"allOrganization"
:
{
"type"
:
"object"
,
"properties"
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment