Permalink
Browse files

Move AJXP_Node package. Create basic SerializableStream for auto-dete…

…cting format, currently using XML serialization by default.
  • Loading branch information...
1 parent 3b0dda0 commit 42c024321cc0545754cc0e0e78920ee6cf790cb2 @cdujeu cdujeu committed May 10, 2016
Showing with 916 additions and 405 deletions.
  1. +3 −3 core/src/core/compat.php
  2. +6 −12 core/src/core/src/pydio/Core/Controller/XMLWriter.php
  3. +38 −0 core/src/core/src/pydio/Core/Exception/AuthRequiredException.php
  4. +37 −0 core/src/core/src/pydio/Core/Http/JSONSerializableResponseChunk.php
  5. +28 −0 core/src/core/src/pydio/Core/Http/SerializableResponseChunk.php
  6. +271 −0 core/src/core/src/pydio/Core/Http/SerializableResponseStream.php
  7. +13 −0 core/src/core/src/pydio/Core/Http/Server.php
  8. +53 −0 core/src/core/src/pydio/Core/Http/UserMessage.php
  9. +32 −0 core/src/core/src/pydio/Core/Http/XMLSerializableResponseChunk.php
  10. +2 −2 core/src/core/src/pydio/Core/PluginFramework/Plugin.php
  11. +1 −1 core/src/core/src/pydio/Core/Services/AuthService.php
  12. +16 −16 core/src/core/src/pydio/Core/Services/ConfService.php
  13. +1 −1 core/src/core/src/pydio/Core/Utils/Utils.php
  14. +2 −2 core/src/core/src/pydio/Tests/AbstractTest.php
  15. +1 −1 core/src/core/src/sabredav/ajaxplorer/class.AJXP_Sabre_Collection.php
  16. +2 −2 core/src/core/src/sabredav/ajaxplorer/class.AJXP_Sabre_Node.php
  17. +1 −1 core/src/core/src/sabredav/ajaxplorer/class.AJXP_Sabre_NodeLeaf.php
  18. +2 −2 core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php
  19. +2 −2 core/src/plugins/access.ajxp_user/class.UserDashboardDriver.php
  20. +8 −5 core/src/plugins/access.demo/class.demoAccessDriver.php
  21. +1 −1 core/src/plugins/access.dropbox/class.dropboxAccessDriver.php
  22. +50 −114 core/src/plugins/access.fs/class.fsAccessDriver.php
  23. +1 −1 core/src/plugins/access.fs/class.fsAccessWrapper.php
  24. +2 −2 core/src/plugins/access.fs/test.fsAccess.php
  25. +1 −1 core/src/plugins/access.ftp/class.ftpAccessDriver.php
  26. +10 −8 core/src/plugins/access.imap/class.imapAccessDriver.php
  27. +2 −2 core/src/plugins/access.inbox/class.inboxAccessDriver.php
  28. +1 −1 core/src/plugins/access.inbox/class.inboxAccessWrapper.php
  29. +1 −1 core/src/plugins/access.mysql/class.mysqlAccessDriver.php
  30. +4 −4 core/src/plugins/access.s3/class.s3AccessDriver.php
  31. +2 −2 core/src/plugins/access.sftp/class.sftpAccessDriver.php
  32. +1 −1 core/src/plugins/access.sftp/class.sftpAccessWrapper.php
  33. +2 −2 core/src/plugins/access.sftp_psl/class.sftpPSLAccessDriver.php
  34. +1 −1 core/src/plugins/access.sftp_psl/class.sftpPSLAccessWrapper.php
  35. +1 −1 core/src/plugins/access.smb/class.smbAccessDriver.php
  36. +2 −2 core/src/plugins/access.swift/class.swiftAccessDriver.php
  37. +2 −2 core/src/plugins/access.webdav/src/Driver.php
  38. +4 −4 core/src/plugins/action.antivirus/class.AntivirusScanner.php
  39. +2 −2 core/src/plugins/action.compression/class.PluginCompression.php
  40. +1 −1 core/src/plugins/action.powerfs/class.PowerFSController.php
  41. +2 −2 core/src/plugins/action.share/class.CompositeShare.php
  42. +1 −1 core/src/plugins/action.share/class.LegacyPubliclet.php
  43. +5 −5 core/src/plugins/action.share/class.ShareCenter.php
  44. +2 −2 core/src/plugins/action.share/class.ShareLink.php
  45. +10 −10 core/src/plugins/action.share/class.ShareMetaManager.php
  46. +6 −6 core/src/plugins/action.share/class.ShareRightsManager.php
  47. +6 −6 core/src/plugins/action.share/class.ShareStore.php
  48. +1 −1 core/src/plugins/action.timestamp/class.TimestampCreator.php
  49. +2 −2 core/src/plugins/boot.conf/class.BootConfLoader.php
  50. +3 −3 core/src/plugins/conf.serial/class.serialConfDriver.php
  51. +6 −6 core/src/plugins/conf.sql/class.sqlConfDriver.php
  52. +1 −0 core/src/plugins/core.access/src/AJXP_MetaStreamWrapper.php
  53. +9 −1 core/src/plugins/core.access/src/AbstractAccessDriver.php
  54. +3 −1 core/src/plugins/core.access/src/{ → Filter}/ContentFilter.php
  55. +3 −1 core/src/plugins/core.access/src/{ → Model}/AJXP_Node.php
  56. +88 −0 core/src/plugins/core.access/src/Model/NodesDiff.php
  57. +3 −1 core/src/plugins/core.access/src/{ → Model}/Repository.php
  58. +3 −1 core/src/plugins/core.access/src/{ → Model}/UserSelection.php
  59. +2 −0 core/src/plugins/core.access/src/RecycleBinManager.php
  60. +2 −2 core/src/plugins/core.auth/class.AJXP_Safe.php
  61. +1 −1 core/src/plugins/core.cache/class.AbstractCacheDriver.php
  62. +2 −2 core/src/plugins/core.cache/class.CacheStreamLayer.php
  63. +8 −8 core/src/plugins/core.cache/class.CoreCacheLoader.php
  64. +1 −1 core/src/plugins/core.conf/class.AJXP_Role.php
  65. +9 −9 core/src/plugins/core.conf/class.AbstractConfDriver.php
  66. +1 −1 core/src/plugins/core.index/class.AbstractSearchEngineIndexer.php
  67. +5 −5 core/src/plugins/core.index/class.CoreIndexer.php
  68. +1 −1 core/src/plugins/core.log/class.AJXP_Logger.php
  69. +1 −1 core/src/plugins/core.mailer/class.AjxpMailer.php
  70. +1 −1 core/src/plugins/core.metastore/interface.MetaStoreProvider.php
  71. +1 −1 core/src/plugins/core.mq/class.MqManager.php
  72. +3 −3 core/src/plugins/core.notifications/class.AJXP_Notification.php
  73. +3 −3 core/src/plugins/core.notifications/class.AJXP_NotificationCenter.php
  74. +3 −3 core/src/plugins/core.ocs/src/Model/RemoteShare.php
  75. +2 −2 core/src/plugins/cypher.encfs/class.EncfsMounter.php
  76. +2 −2 core/src/plugins/editor.audio/class.AudioPreviewer.php
  77. +1 −1 core/src/plugins/editor.browser/class.FileMimeSender.php
  78. +5 −5 core/src/plugins/editor.diaporama/class.ImagePreviewer.php
  79. +2 −2 core/src/plugins/editor.eml/class.EmlParser.php
  80. +2 −2 core/src/plugins/editor.etherpad/class.EtherpadClient.php
  81. +3 −3 core/src/plugins/editor.imagick/class.IMagickPreviewer.php
  82. +2 −2 core/src/plugins/editor.pixlr/class.PixlrEditor.php
  83. +2 −2 core/src/plugins/editor.video/class.VideoReader.php
  84. +2 −2 core/src/plugins/editor.zoho/class.ZohoEditor.php
  85. +2 −2 core/src/plugins/feed.sql/class.AJXP_SqlFeedStore.php
  86. +4 −4 core/src/plugins/gui.ajax/class.AJXP_ClientDriver.php
  87. +9 −9 core/src/plugins/index.elasticsearch/class.AjxpElasticSearch.php
  88. +3 −3 core/src/plugins/index.lucene/class.AjxpLuceneIndexer.php
  89. +5 −5 core/src/plugins/meta.comments/class.CommentsMetaManager.php
  90. +3 −3 core/src/plugins/meta.exif/class.ExifMetaManager.php
  91. +6 −6 core/src/plugins/meta.filehasher/class.FileHasher.php
  92. +3 −3 core/src/plugins/meta.git/class.GitManager.php
  93. +1 −1 core/src/plugins/meta.monitor_fs/class.FSMonitoringManager.php
  94. +1 −1 core/src/plugins/meta.mount/class.FilesystemMounter.php
  95. +2 −2 core/src/plugins/meta.quota/class.QuotaComputer.php
  96. +3 −3 core/src/plugins/meta.simple_lock/class.SimpleLockManager.php
  97. +3 −3 core/src/plugins/meta.svn/class.SvnManager.php
  98. +5 −5 core/src/plugins/meta.syncable/class.ChangesTracker.php
  99. +3 −3 core/src/plugins/meta.user/class.UserMetaManager.php
  100. +11 −11 core/src/plugins/meta.watch/class.MetaWatchRegister.php
  101. +4 −4 core/src/plugins/metastore.s3/class.s3MetaStore.php
  102. +4 −4 core/src/plugins/metastore.serial/class.SerialMetaStore.php
  103. +4 −4 core/src/plugins/metastore.xattr/class.xAttrMetaStore.php
  104. +0 −3 core/src/plugins/shorten.multi/class.multiShortener.php
  105. +1 −1 core/src/plugins/uploader.flex/manifest.xml
  106. +2 −2 core/src/plugins/uploader.html/class.SimpleUploadProcessor.php
  107. +2 −2 core/src/plugins/uploader.http/class.HttpDownloader.php
  108. +2 −2 core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php
  109. +2 −2 core/src/plugins/uploader.plupload/class.PluploadProcessor.php
@@ -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);
@@ -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;
@@ -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)
@@ -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
@@ -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>";
@@ -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);
- */
}
@@ -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
@@ -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();
+}
@@ -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
+{
+
+}
Oops, something went wrong.

0 comments on commit 42c0243

Please sign in to comment.