Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
fde947e
Added a markup for the Debug-Version.
Jun 16, 2013
e86e8dc
Changed place of Debug-Hint
Jun 16, 2013
1c9ab34
Next try
Jun 16, 2013
6e9bb9c
Next Try
Jun 16, 2013
c286e51
Made it red.
Jun 16, 2013
9b9eb51
I forgot how to HTML.
Jun 16, 2013
846bef2
>
Jun 16, 2013
f3f3a2d
[+] Added Link to ProfileEditor
Jun 23, 2013
928f915
[i] test
Jun 23, 2013
673a217
[i] }
Jun 23, 2013
959320a
[i] Action
Jun 23, 2013
3f2a7fa
[i] profile editor
Jun 23, 2013
384ef58
[i] Hope this works
Jun 23, 2013
85d63a1
[i] For testing, this is now just a copy of login.phtml
Jun 23, 2013
082d7db
[i] Next Try
Jun 23, 2013
ea284cc
[i] Next Try
Jun 23, 2013
23a0949
[i] Test
Jun 23, 2013
47d020b
[i] Function in UserController
Jun 23, 2013
3aeaf13
[i] Moved to PersonController.php
Jun 23, 2013
51125c3
[i] profile -> person
Jun 23, 2013
9b38b94
[i] Action
Jun 23, 2013
3eaef34
[i] Test
Jun 23, 2013
030a96a
[i] Test
Jun 23, 2013
60bc22b
[i] Moved to PersonController.php
Jun 23, 2013
0576724
[i] Das muss noch mit rein
Jun 23, 2013
b9f4983
[i] Oooops
Jun 23, 2013
410011a
[i] PersonController.php
Jun 23, 2013
540523d
[i] ApplicationController.php
Jun 23, 2013
a3e11ca
[i] For Testing
Jun 23, 2013
e8a4fd4
[i] persontest -> person
Jun 23, 2013
ae13b32
[i] Let us see if this works
Jun 23, 2013
ce02bc9
[i] Test if it works
Jun 23, 2013
b98dbb3
[i] uncommented Button
Jun 23, 2013
2f4c30a
[i] If this will work?
Jun 23, 2013
f5d8189
[i] Test
Jun 23, 2013
f97eb4e
[i] Next Try
Jun 23, 2013
6e33f6b
[i] See if this works
Jun 23, 2013
ebe8068
[i] There you go.
Jun 23, 2013
9aeb33f
[i] Tests
Jun 23, 2013
ac8df65
[i] Removed
Jun 23, 2013
de7fa9f
[i] Next Try
Jun 23, 2013
640a892
[i] Next Test
Jun 23, 2013
3f9ed67
[i] With ()
Jun 23, 2013
a514939
[i] Test for This
Jul 8, 2013
e5e2e1d
[i] See if this works.
Jul 8, 2013
117143d
[i] This should work.
Jul 8, 2013
ffd1487
[i] This once worked
Jul 8, 2013
ad73d58
[i] Let's see
Jul 8, 2013
c92fb70
[i] Let's see if it works.
Jul 8, 2013
770be72
[i] With Text-Message
Jul 8, 2013
936dc17
[i] It should work
Jul 8, 2013
af78041
[i] Lets see...
Jul 8, 2013
91404ad
[i] updated EditAction for Testing Purposes
Jul 9, 2013
c2a7464
[i] Fixed echo
Jul 9, 2013
13731c2
[i] this was wrong.
Jul 9, 2013
e1ad5e6
[i] Name->name
Jul 9, 2013
ef3ec22
Testing this
Jul 23, 2013
c3c0927
Test
Jul 23, 2013
2c0ea00
Test
Jul 23, 2013
dbd0a57
Test
Jul 23, 2013
a7baa5d
Test
Jul 23, 2013
e860fdd
Test
Jul 23, 2013
dd52d2b
Test
Jul 23, 2013
45ca7f3
=
Jul 23, 2013
fcd5bef
Test
Jul 23, 2013
38a8cb4
Test
Jul 23, 2013
1f50823
Test
Jul 23, 2013
f979aed
Test
Jul 23, 2013
6d33162
Test
Jul 23, 2013
91da825
Test
Jul 23, 2013
298774a
Test
Jul 23, 2013
b4f620b
gitignore
Jul 23, 2013
890705c
Test
Jul 23, 2013
af5928c
Test
Jul 23, 2013
e47857d
Test
Jul 23, 2013
fff484f
Test
Jul 23, 2013
16c31de
Test
Jul 23, 2013
5d5572f
Test
Jul 23, 2013
bbacf43
Test
Jul 23, 2013
1a8ef83
Test
Jul 23, 2013
8e3451a
Test
Jul 23, 2013
ca4e557
Test
Jul 23, 2013
a7043bf
Test
Jul 23, 2013
0e02df0
Test
Jul 24, 2013
f5b0a07
Test
Jul 24, 2013
5998e4b
Test
Jul 24, 2013
d4885cd
Sprint 4
Aug 30, 2013
be99008
Todos und Query
Sep 3, 2013
584d8dc
Correct Properties in Profile Editor
Sep 15, 2013
82e5ca4
Filter for Prefixes
Sep 15, 2013
ffd8bcd
It does _something_
Sep 16, 2013
a127d9b
Pass allowedPrefixes
Sep 16, 2013
ec3cbf9
Multiple (prepared)
Sep 16, 2013
481efc5
Multiple
Sep 16, 2013
2dca61f
Go over all allowedPrefixes
Sep 21, 2013
4858e76
Pass Prefixes correctly.
Sep 21, 2013
2903e96
configuration for ProfileEditor
Sep 21, 2013
ae10c8b
Load (single) Properties from config
Sep 21, 2013
9a72258
Config for Profile Editor in config.ini-dist
Sep 21, 2013
2527603
Saving apparently works.
Sep 22, 2013
5f293dc
RegEx is executed, but only debugged.
Sep 24, 2013
a6786f6
editAction -> profileeditorAction
Sep 29, 2013
1fa8456
Write Fields for Multiple Properties
Sep 29, 2013
f87d849
config.ini-dist
Sep 29, 2013
11e2c2c
Multiple Statements
Sep 29, 2013
409eb48
preg_match corrected
Sep 29, 2013
5554f85
Indicate wrong Properties
Sep 29, 2013
5045b3d
Bugfixes
Oct 2, 2013
0318e4e
Do not echo.
Oct 2, 2013
32af093
ProfileEditor works.
Oct 8, 2013
e15e0f2
Changed way of storing editor Properties in config.ini
Oct 11, 2013
7716e3d
Made LoadProperties reusable.
Oct 11, 2013
28cb47e
Moved config functions to ConfigHelper.php
Oct 11, 2013
be45580
Added ConferenceController.php (stub)
Oct 11, 2013
d7dcc33
Added conference in ini.dist
Oct 11, 2013
68ae815
Added Stubs for ConferenceEditor
Oct 12, 2013
47f158d
Use correct Template
Oct 12, 2013
1600c88
[b] Do not load PropertyRegex
Oct 12, 2013
a14280b
ProfileEditor is completely functional.
Oct 12, 2013
39f370c
Read Type from config.ini
Oct 12, 2013
0dd7ac1
List Conferences
Oct 12, 2013
b7bb575
Show Conference depending on GET
Oct 13, 2013
7938277
Conferences a bit improved.
Oct 13, 2013
f80faa1
[i] Moved Editor to own class
Oct 21, 2013
6ad3313
Editor
Oct 21, 2013
0411eeb
Editor works the way it should. Kinda.
Oct 21, 2013
803ba83
Removed "edit" from ConferenceController.php
Oct 21, 2013
b23c3ab
Documentation
Oct 21, 2013
55d9f26
Inserted RightsManagement
Oct 24, 2013
705cdd9
Use urlencode/urldecode
Oct 24, 2013
d4dba3d
Corrected Bug n processing
Oct 24, 2013
6fe49b0
Fixed Bug with wrong Single Key
Oct 24, 2013
85d4417
Use objectId when writing to the DataBase
Oct 24, 2013
8e3de72
Create Conferences
Oct 25, 2013
026054c
Fixed Bug where Wrong Value is shown.
Oct 25, 2013
c72d0dc
Fixed Bug in config.
Oct 25, 2013
9cce18e
Cleaned Coded and Added Comments
Oct 27, 2013
4b074b0
Kommentare
Oct 27, 2013
58727ba
Shortened config.ini-dist
Oct 27, 2013
550f86e
Allow editing of newly created conference.
Oct 27, 2013
d9d5ad3
Removed unused template.
Oct 27, 2013
480d8e7
Fixed Link in Template
Oct 27, 2013
92989c5
Added Editor
Nov 12, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ resources/bootstrap/
resources/jquery/
xodx.log
config.ini
/xodx.geany
/gitcommit.bat
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ In order to get the JavaScript dependencies [twitter bootstrap](http://twitter.g

in the xodx root directory (should be the same directory where you found this file).

Configuration
-------------
### Profile Editor
Here is described the configuration of the Profile Editor

There are single and multiple Properties. They are stored in editor.single and editor.multiple respectivly. For every configured Property a corresponding RegEx has to be given. The RegEx can be given any Name, they are afterwards configured via regex.NameOfTheRegEx. Property and Regex are seperated by a comma, without space after the comma. editor.single and editor.multiple are composed with as many Property-RegEx Literals as needed, also seperated with a comma, without spaces.
Example:


Code Conventions
----------------
Currently, this project is developed using [OntoWiki's coding standard](https://github.com/AKSW/OntoWiki/wiki/Coding-Standards).
Expand Down
3 changes: 2 additions & 1 deletion classes/Xodx/ApplicationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class Xodx_ApplicationController extends Saft_Controller
{
/**
* This is the username of the currently logedin user
* This is the username of the currently loggedin user
*/
private $_user;

Expand Down Expand Up @@ -290,3 +290,4 @@ public function getUser ()
return $this->_user;
}
}

77 changes: 77 additions & 0 deletions classes/Xodx/ConferenceController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/**
* This file is part of the {@link http://aksw.org/Projects/Xodx Xodx} project.
*
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
*/

/**
* The ConferenceController is responsible for all action concerning Conferences.
*/
class Xodx_ConferenceController extends Xodx_ResourceController
{

public function testAction($template)
{
$template->addContent('templates/test.phtml');
return $template;
}

public function PrefixesAction()
{
$configHelper = new Xodx_ConfigHelper($this->_app);
var_dump($configHelper -> loadPropertiesSingle("conference"));
}

public function listAction($template)
{
$model = $this->_app->getBootstrap()->getResource('Model');
$configHelper = new Xodx_ConfigHelper($this->_app);
$typeUri = $configHelper -> getEditorClass("conference");

//Get all Conferences
$profiles = $model->sparqlQuery('SELECT DISTINCT ?event ?p ?o WHERE { ?event a <'. $typeUri .'> . ?event ?p ?o}');

//Reduce to Label
foreach ($profiles as $key => $array)
{
if (strcmp($array["p"],"http://www.w3.org/2000/01/rdf-schema#label") !=0)
{
unset($profiles[$key]);
}
}

//Add Values to $template
$template->profiles = $profiles;
$template->addContent('templates/list.phtml');
return $template;
}

public function newAction($template)
{
$bootstrap = $this->_app->getBootstrap();
$model = $bootstrap->getResource('model');
$uid = uniqid();
$conferenceId = $this->_app->getBaseUri() . '?c=conference&id=' . $uid;

//Create Conference
$valueToWrite = 'http://symbolicdata.org/Data/Model#Conference';
$valueArray = array('type' => 'uri', 'value' => $valueToWrite);
$keyToWrite = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';

//echo ("<br>Writing: $conferenceId, $keyToWrite, $valueToWrite");
$model->addStatement($conferenceId, $keyToWrite, $valueArray);

//Add Temporary Title
$valueToWrite2 = $uid;
$valueArray2 = array('type' => 'literal', 'value' => $valueToWrite2);
$keyToWrite2 = 'http://www.w3.org/2000/01/rdf-schema#label';

//echo ("<br>Writing: $conferenceId, $keyToWrite2, $valueToWrite2");
$model->addStatement($conferenceId, $keyToWrite2, $valueArray2);

$template -> id = $conferenceId;
$template->addContent('templates/new.phtml');
return $template;
}
}
143 changes: 143 additions & 0 deletions classes/Xodx/ConfigHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?php
/**
* This file is part of the {@link http://aksw.org/Projects/Xodx Xodx} project.
*
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
*/

class Xodx_ConfigHelper extends Saft_Helper
{
/**
* Returns all Single Properties for a given $editorType
*/
public function loadPropertiesSingle($editorType)
{
//Load All Properties
$properties = $this->loadProperties($editorType);
$single = array();

//Find those whose cardinality is single
foreach($properties as $key => $element)
{
if ($element['cardinality'] == 'single')
{
$single[$key] = $element;
}
}
return $single;
}

/**
* Returns all Multiple Properties for a given $editorType
*/
public function loadPropertiesMultiple($editorType)
{
//Load All Properties
$properties = $this->loadProperties($editorType);
$multiple = array();

//Find those whose cardinality is multiple
foreach($properties as $key => $element)
{
if ($element['cardinality'] == 'multiple')
{
$multiple[$key] = $element;
}
}
return $multiple;
}

/**
* Returns all Properties with the corresponding RegExes, ready for preg_match
*/
public function loadPropertyRegex()
{
$properties = array();
$config = $this->_app->getBootstrap()->getResource('Config');
$bothConfigs = explode(",",$config["editor.single"].",".$config["editor.multiple"]);
$skip = false;

foreach($bothConfigs as $key => $element)
{
if (!$skip)
{
$property = $element;
$skip = true;
}
else
{
$skip = false;
$properties[$property] = $this->propertyRegex($element);
}
}
return $properties;
}

/**
* Returns the RegEx for a given $regexName
*/
public function propertyRegex($regexName)
{
//echo "propertyRegex: $regexName <br>";
$config = $this->_app->getBootstrap()->getResource('Config');
$regexString = 'regex.'
. $regexName;
return $config[$regexString];
}

/**
* Returns all properties for a given $editorType
*/
public function loadProperties($editorType)
{
$propertiesPrepared = array();
$config = $this->_app->getBootstrap()->getResource('Config');
foreach ($config as $key => $value)
{
$keySplit = explode('.',$key);
if ($keySplit[0] == 'editor')
{
if ($keySplit[1] == $editorType)
{
if ($keySplit[2] == 'property')
{
$propertiesPrepared[$keySplit[3]][$keySplit[4]] = $value;
}
}
}
}
$properties = array();
foreach ($propertiesPrepared as $key => $value)
{
$properties[$value['uri']]['type'] = $value['type'];
$properties[$value['uri']]['cardinality'] = $value['cardinality'];
$properties[$value['uri']]['regex'] = $this->propertyRegex($value['type']);
}
return $properties;
}

/**
* Returns the class (e.g foaf:person)of an Editor with the given class as it is in the config
*/
public function getEditorClass($editorType)
{
$config = $this->_app->getBootstrap()->getResource('Config');
foreach ($config as $key => $value)
{
$keySplit = explode('.', $key);
if ($keySplit[0] == 'editor')
{
if ($keySplit[1] == $editorType)
{
if ($keySplit[2] == 'class')
{
return $value;
}
}
}
}

}
}


Loading