BEdita API doc | 4-cactus
  • Class
  • Tree
  • Deprecated
  • Download

Classes

  • Addon
  • AddressbookController
  • AddressbookShell
  • AdminController
  • Alias
  • Annotation
  • ApiAuthComponent
  • ApiBaseController
  • ApiFormatterComponent
  • ApiUploadComponent
  • ApiValidatorComponent
  • AppController
  • AppError
  • AppHelper
  • Application
  • AppModel
  • Area
  • AreasController
  • Audio
  • AuthenticationsController
  • BannedIp
  • BEAppModel
  • BEAppObjectModel
  • BeAuthComponent
  • BeAuthFacebookComponent
  • BeAuthGoogleComponent
  • BeAuthTwitterComponent
  • BeCallbackManager
  • BeConfigure
  • BeCustomPropertyComponent
  • BeditaAnnotationModel
  • BeditaBaseShell
  • BeditaCollectionModel
  • BeditaContentModel
  • BeditaExportFilter
  • BeditaImportFilter
  • BeditaObjectModel
  • BeditaProductModel
  • BeditaShell
  • BeditaSimpleObjectModel
  • BeditaSimpleStreamModel
  • BeditaStreamModel
  • BeEmbedFlashHelper
  • BeEmbedHtml5Helper
  • BeEmbedMediaHelper
  • BeErrorCode
  • BeExceptionHandler
  • BEFile
  • BeFileHandlerComponent
  • BeFormHelper
  • BeFrontHelper
  • BeHashComponent
  • BeHtmlHelper
  • BeLangTextComponent
  • BeLib
  • BeMailComponent
  • BEObject
  • BeObjectCache
  • BePaginatorToolbarHelper
  • BeSchema
  • BeSecurityComponent
  • BeSystem
  • BeSystemComponent
  • BeThumb
  • BeTimeHelper
  • BeToolbarHelper
  • BeTreeComponent
  • BeTreeHelper
  • BeUploadToObjComponent
  • BeurlHelper
  • BeVimeoComponent
  • BeYoutubeComponent
  • BuildFilterBehavior
  • CacheableBehavior
  • CacheShell
  • CallbackBehavior
  • CaptchaComponent
  • Caption
  • CaptionsBehavior
  • Card
  • CardsImportFilter
  • Category
  • CleanupDataTask
  • CleanupTask
  • Comment
  • CommentsController
  • CompactResultBehavior
  • Content
  • CreateIndexFieldsBehavior
  • DataShell
  • DataTransfer
  • DateItem
  • DbadminShell
  • DeleteDependentObjectBehavior
  • DeleteObjectBehavior
  • DeployShell
  • Document
  • DocumentsController
  • DumpModel
  • EditorialContentsShell
  • EditorNote
  • Event
  • EventLog
  • EventsController
  • FilesController
  • ForeignDependenceSaveBehavior
  • FrontendController
  • FrontendShell
  • GalleriesController
  • Gallery
  • GeoTag
  • GettextShell
  • Git
  • GravatarHelper
  • Group
  • HashJob
  • History
  • HomeController
  • Image
  • ImageInfoHelper
  • JsonExportFilter
  • JsonImportFilter
  • JsonView
  • LangText
  • Link
  • MailGroup
  • MailGroupCard
  • MailJob
  • MailLog
  • MailMessage
  • MailShell
  • MailTemplate
  • Mask
  • MediaShell
  • MigrateDumpModel
  • MigrateShell
  • Migration
  • MigrationBase
  • MigrationDateItemsShell
  • Module
  • ModulesController
  • ModuleShell
  • MultimediaController
  • NewsController
  • NewsletterController
  • NewsletterShell
  • NotifyBehavior
  • ObjectEditor
  • ObjectProperty
  • ObjectRelation
  • ObjectType
  • ObjectUser
  • PagesController
  • Permission
  • PermissionModule
  • PermsHelper
  • Product
  • Property
  • PropertyOption
  • PublicationShell
  • RedisShell
  • RelationCheck
  • RelationRepair
  • RelationShell
  • RelationStats
  • RemoveDummyNameBehavior
  • ResponseHandlerComponent
  • RestClientModel
  • Revision
  • RevisionObjectBehavior
  • SearchText
  • SearchTextSaveBehavior
  • Section
  • SectionDummy
  • SessionFilterComponent
  • SessionFilterHelper
  • ShortNews
  • SmartyView
  • SoapClientModel
  • SplitterSql
  • StatisticsController
  • Stream
  • StreamLog
  • StreamsController
  • Svn
  • TagsController
  • ThemeSmartyView
  • ThumbnailHelper
  • ThumbShell
  • TransactionComponent
  • TransactionFS
  • TranslationsController
  • Tree
  • TrHelper
  • User
  • UserProperty
  • UsersController
  • Utility
  • Version
  • Video
  • VimeoHelper
  • WebmarksController
  • XmlExportFilter
  • XmlImportFilter
  • XmlJsonConverter
  • XmlView
  • YoutubeHelper

Interfaces

  • ApiAuthInterface
  • MediaProviderInterface
  • UploadableInterface

Exceptions

  • BeditaAjaxException
  • BEditaAllowURLException
  • BeditaBadRequestException
  • BeditaConflictException
  • BEditaDeleteStreamObjException
  • BeditaException
  • BEditaFileExistException
  • BeditaForbiddenException
  • BeditaFrontAccessException
  • BeditaHashException
  • BEditaInfoException
  • BeditaInternalErrorException
  • BEditaIOException
  • BeditaLengthRequiredException
  • BeditaMailException
  • BEditaMediaProviderException
  • BeditaMethodNotAllowedException
  • BEditaMIMEException
  • BeditaNotFoundException
  • BeditaNotImplementedException
  • BeditaPublicationException
  • BeditaRuntimeException
  • BEditaSaveStreamObjException
  • BeditaServiceUnavailableException
  • BeditaUnauthorizedException
  • BEditaUploadPHPException
  • BEditaURLException

Class DataTransfer

Bedita model base class

Model
Extended by AppModel
Extended by BEAppModel
Extended by DataTransfer
Located at models/business/data_transfer.php

Methods summary

public DataTransfer::$result
# import( & $data, $options = array() )

Import data (json string or array) to BEdita

Import data (json string or array) to BEdita

Parameters

$data
string|array
$options
array

Returns

DataTransfer::$result
$result array

Link

$options = array( 'logDebug' => true, // can be true|false 'saveMode' => 0, // can be 0 (MERGE), 1 (NEW), 2 (OVERRIDE), 3 (IGNORE), 4 (UPDATE) 'sourceMediaRoot' => '/media/source/path', // default /TMP/media-import ) 1. Validating input data 2. Importing data to BEdita 3. Return result object
public mixed
# export( array & $objects, array $options = array() )

Export BEdita objects data to JSON, XML or other format

Export BEdita objects data to JSON, XML or other format

Parameters

$objects
$objects ids of root elements (publication|section) or ids of objects (document|event|...)
$options
export parameters

Returns

mixed
object json|array|xml|other (file?)

See

XmlJsonConverter::toXmlString()

$options = array( 'logDebug' => true

,

// can be true|false 'destMediaRoot' => '/media/dest/path'

,

// default TMP/media-export 'returnType' => 'JSON' // default 'JSON' - can be 'ARRAY' )


public array,
# getResult( )

Get last import/export operation result

Get last import/export operation result

Returns

array,
with result info (errors, warnings, stats...)
public
# validate( & $data, $options = array() )

Validation of data and related objects and semantics

Validation of data and related objects and semantics

1 if data is a string 1.1 if data is a string: not empty 1.2a if data is a JSON string: valid (json_decode / json_last_error) 1.2b if data is an XML string: valid

2 config 2.1 custom properties 2.1.1 fields not empty: name, objectType, dataType 2.1.2 valid objectType 2.1.3 dataType can be 'number', 'date', 'text', 'options' 2.1.4 existence 2.1.5 conflict 2.1.6 objects.customProperty consistence (objects.customProperty.name and objects.customProperty.value not empty / objects.customProperty.name must be declared in config.customProperties) [...]

3 objects 3.1 not empty 3.2 necessary fields (defined in $this->objMinimalSet) 3.3 objectType existence 3.4 specific validation by objectType [TODO] 3.5 categories 3.6 tags [TODO]

4 trees 4.1 not empty 4.2 roots not empty 4.3 valid root ids => if more than one, all must be all of the same type (area or section) / if type is section => options[root_section_id] 4.4 valid parent ids => parents elements must be a subcollection of tree elements 4.5 id referenced in tree must be referenced in objects too

5 relations 5.1 necessary fields (defined in $this->relMinimalSet) relation structure 1: flat array / i.e. array(, , ...) relation structure 2: group by switch / i.e. array( => array(, , ...), => array(, , ...), ...) 5.2 id referenced in relations must be referenced in objects too 5.3 switch must be a valid relation name + valid relation objects (existence of objects and right connection) 5.4 objectType(s) must be valid for specified relation switch

6 media 6.1 source folder (sourceMediaRoot) 6.1.1 existence 6.1.2 permits [TODO] 6.2 destination folder 6.2.1 existence 6.2.2 space available 6.3 files 6.3.1 existence (base folder + objects[i].uri) [TODO] 6.3.2 extension allowed [TODO] 6.3.3 dimension allowed [TODO] 6.3.4 all files dimension < space available ... 7 [...] [TODO]

Parameters

$data
string|array
$options
array

See

XmlJsonConverter::toArray()
private
# relationAllowed( $objType, array $relType )
private
# saveProperty( $customProperty )
private
# saveArea( $area )
private
# saveSection( $section, $parendId = null )
private
# saveObject( $object )
private
# saveCategory( $categoryName, $objectType )
private
# saveTags( $tagListString )
private
# saveRelation( $relation, $counter )
private
# updateTreeForImport( $level = 0 )
private
# cleanObjectFields( array & $object )
private
# rearrangeObjectFields( array & $object, $level )
private array
# prepareObjectForExport( array & $object, integer $level = 0 )

clean object and prepare relation data

clean object and prepare relation data

remove empty data (or null) remove meaningless data for export (i.e. user, stats, etc. @see $this->export['objectUnsetFields'])

Parameters

$object
data
$level
$level, recursion level

Returns

array
$object data
private
# parentsForObjId( $objId, $rootIds )
private
# prepareObjectsForExportByParents( $parents )
private
# objectTypeAllowed( $objectTypeId )
private
# objectTypeId( $objId )
private
# orphans( $objsToSkip = array() )
private array
# modelBinding( string $model, BEAppModel $objModel )

Return the proper model binding for model.

Return the proper model binding for model.

Parameters

$model
Model name.
$objModel
Instantiated model object.

Returns

array
Model binding.
private
# copyFileToFolder( string $sourceBasePath, string $destBasePath, string $source )

Copy $source (from $sourceBasePath) to $destBasePath, creating subfolders if necessary

Copy $source (from $sourceBasePath) to $destBasePath, creating subfolders if necessary

Parameters

$sourceBasePath
folder
$destBasePath
folder
$source
path to file (file name included)
private
# urlExists( $url )
private
# trackError( $message )
private
# trackWarn( $message )
private
# trackInfo( $message )
private
# trackDebug( $message )
private
# trackResult( $level, $message )
private
# jsonLastErrorMsg( )
private string
# xmlLastErrorMsg( )

Formats last XML error in a simple, human-readable format.

Formats last XML error in a simple, human-readable format.

Returns

string
private
# exportInfo( )
private
# importInfo( )
private
# convertXmlEntity( $text )

Methods inherited from BEAppModel

am(), buildQueryStatement(), checkDate(), checkDuration(), checkFloat(), checkNumber(), containLevel(), email(), fieldsString(), findObjects(), findObjectsAfterFilter(), findObjectsClauses(), findObjectsCount(), getBindingsLevel(), getDefaultDateFormat(), getDriver(), getEndQuote(), getLimitClausole(), getStartQuote(), setBindingsLevel(), setupDbParams(), toolbar()

Methods inherited from AppModel

apiTransformer()

Properties summary

public boolean $useTable
# false
private integer $maxRelationLevels
# 2
protected array $objDefaults
# array( 'status' => 'on', 'user_created' => '1', 'user_modified' => '1', 'lang' => 'ita', 'ip_created' => '127.0.0.1', 'syndicate' => 'off', )
protected array $objMinimalSet
# array( 'id', 'objectType' )
protected array $relMinimalSet
# array( 'idLeft', 'idRight', 'switch' )
protected array $import
# array( 'source' => array( 'string' => null, // (is_string(data)) ? data : null 'data' => array() // json_decode of data ), 'objects' => array( 'ids' => array(), 'types' => array() ), 'tree' => array( 'ids' => array(), 'parents' => array() ), 'relations' => array( 'ids' => array(), 'switches' => array() ), 'saveMap' => array( // oldId => newId ), 'saveMode' => 1, // NEW 'logLevel' => 2 // INFO )
protected array $export
# array( 'destination' => array( 'byType' => array( 'ARRAY' => array( 'config' => array(), 'tree' => array(), 'objects' => array(), 'relations' => array() ), 'JSON' => '' // string ) ), 'logLevel' => 2, // INFO 'returnType' => 'JSON', 'filename' => null, 'all' => true, 'types' => null, 'relations' => null, 'objectUnsetFields' => array( 'user_created', 'user_modified', 'valid', 'ip_created', 'object_type_id', 'ObjectType', 'UserCreated', 'UserModified', 'User', 'Version', 'Permission', 'Annotation', 'area_id', 'object_path', 'parent_id', 'parent_path', 'priority', 'priority_order', 'syndicate' ), 'contain' => array( 'BEObject' => array( 'RelatedObject', 'ObjectProperty', 'LangText', 'Annotation', 'Category', 'GeoTag' ) ), 'contain-stream' => array( 'BEObject' => array( 'RelatedObject', 'ObjectProperty', 'LangText', 'Annotation', 'Category', 'GeoTag' ), 'Stream' ), 'media' => array(), 'customProperties' => array() )
protected array $streamModels
# array( 'Image', 'Video', 'Application', )
protected array $result
# array( )
private $logFile
#
private $logLevel
#
protected array $logLevels
# array( 'ERROR' => 0, 'WARN' => 1, 'INFO' => 2, 'DEBUG' => 3 )
protected array $saveModes
# array( 'MERGE' => 0, // merge relations (always for imported objects) 'NEW' => 1, // create new object with new nickname 'OVERRIDE' => 2, // remove object with same nickname 'IGNORE' => 3, // ignore object 'UPDATE' => 4 // merge relations and update data )
protected array $customPropertyDataTypes
# array( 'number', 'date', 'text', 'options' )

Properties inherited from BEAppModel

$actsAs, $driver, $eQ, $modelBindings, $sQ

Properties inherited from AppModel

$apiTransformerOptions

BEdita API doc | 4-cactus API documentation generated by ApiGen