Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Move AJXP_Node package. Create basic SerializableStream for auto-dete…
Browse files Browse the repository at this point in the history
…cting format, currently using XML serialization by default.
  • Loading branch information
cdujeu committed May 10, 2016
1 parent 3b0dda0 commit 42c0243
Show file tree
Hide file tree
Showing 109 changed files with 916 additions and 405 deletions.
6 changes: 3 additions & 3 deletions core/src/core/compat.php
Expand Up @@ -23,7 +23,7 @@

class_alias("Pydio\\Access\\Core\\Filter\\AJXP_Permission", "AJXP_Permission", true);
class_alias("Pydio\\Access\\Core\\Filter\\AJXP_PermissionMask", "AJXP_PermissionMask", true);
class_alias("Pydio\\Access\\Core\\AJXP_Node", "AJXP_Node", true);
class_alias("Pydio\\Access\\Core\\Model\\AJXP_Node", "AJXP_Node", true);
class_alias("Pydio\\Conf\\Core\\AJXP_Role", "AJXP_Role", true);
class_alias("Pydio\\Access\\Core\\Repository", "Repository", true);
class_alias("Pydio\\Access\\Core\\ContentFilter", "ContentFilter", true);
class_alias("Pydio\\Access\\Core\\Model\\Repository", "Repository", true);
class_alias("Pydio\\Access\\Core\\Filter\\ContentFilter", "ContentFilter", true);
18 changes: 6 additions & 12 deletions core/src/core/src/pydio/Core/Controller/XMLWriter.php
Expand Up @@ -20,9 +20,9 @@
*/
namespace Pydio\Core\Controller;

use Pydio\Access\Core\AJXP_Node;
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Access\Core\IAjxpWrapperProvider;
use Pydio\Access\Core\Repository;
use Pydio\Access\Core\Model\Repository;
use Pydio\Core\Exception\AuthRequiredException;
use Pydio\Core\Utils\Utils;
use Pydio\Core\Exception\PydioPromptException;
Expand Down Expand Up @@ -183,7 +183,7 @@ public static function renderHeaderNode($nodeName, $nodeLabel, $isLeaf, $metaDat

/**
* @static
* @param AJXP_Node $ajxpNode
* @param \Pydio\Access\Core\Model\AJXP_Node $ajxpNode
* @return void
*/
public static function renderAjxpHeaderNode($ajxpNode)
Expand Down Expand Up @@ -236,7 +236,7 @@ public static function renderNode($nodeName, $nodeLabel, $isLeaf, $metaData = ar

/**
* @static
* @param AJXP_Node $ajxpNode
* @param \Pydio\Access\Core\Model\AJXP_Node $ajxpNode
* @param bool $close
* @param bool $print
* @return void|string
Expand Down Expand Up @@ -430,7 +430,7 @@ public static function reloadDataNode($nodePath="", $pendingSelection="", $print
public static function writeNodesDiff($diffNodes, $print = false)
{
/**
* @var $ajxpNode AJXP_Node
* @var $ajxpNode \Pydio\Access\Core\Model\AJXP_Node
*/
$mess = ConfService::getMessages();
$buffer = "<nodes_diff>";
Expand Down Expand Up @@ -467,12 +467,6 @@ public static function writeNodesDiff($diffNodes, $print = false)
}
$buffer .= "</nodes_diff>";
return XMLWriter::write($buffer, $print);

/*
$nodePath = AJXP_Utils::xmlEntities($nodePath, true);
$pendingSelection = AJXP_Utils::xmlEntities($pendingSelection, true);
return AJXP_XMLWriter::write("<reload_instruction object=\"data\" node=\"$nodePath\" file=\"$pendingSelection\"/>", $print);
*/
}


Expand Down Expand Up @@ -722,7 +716,7 @@ public static function writeRepositoriesData($loggedUser)

/**
* @param string $repoId
* @param Repository $repoObject
* @param \Pydio\Access\Core\Model\Repository $repoObject
* @param array $exposed
* @param array $streams
* @param AbstractAjxpUser $loggedUser
Expand Down
38 changes: 38 additions & 0 deletions core/src/core/src/pydio/Core/Exception/AuthRequiredException.php
@@ -0,0 +1,38 @@
<?php
/*
* Copyright 2007-2015 Abstrium <contact (at) pydio.com>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*/
namespace Pydio\Core\Exception;

use Pydio\Core\Services\ConfService;

defined('AJXP_EXEC') or die('Access not allowed');


class AuthRequiredException extends PydioException
{
public function __construct($messageId = "", $messageString = "")
{
if(!empty($messageId)){
$mess = ConfService::getMessages();
if(isSet($mess[$messageId])) $messageString = $mess[$messageId];
}
parent::__construct($messageString, $messageId);
}
}
@@ -0,0 +1,37 @@
<?php
/*
* Copyright 2007-2015 Abstrium <contact (at) pydio.com>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*/
namespace Pydio\Core\Http;

defined('AJXP_EXEC') or die('Access not allowed');


interface JSONSerializableResponseChunk extends SerializableResponseChunk
{
/**
* @return mixed
*/
public function jsonSerializableData();

/**
* @return string
*/
public function jsonSerializableKey();
}
28 changes: 28 additions & 0 deletions core/src/core/src/pydio/Core/Http/SerializableResponseChunk.php
@@ -0,0 +1,28 @@
<?php
/*
* Copyright 2007-2015 Abstrium <contact (at) pydio.com>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*/
namespace Pydio\Core\Http;

defined('AJXP_EXEC') or die('Access not allowed');

interface SerializableResponseChunk
{

}

0 comments on commit 42c0243

Please sign in to comment.