Sqliimport and multilocation

Author Message

SEBBANE Alexandre

Monday 02 May 2011 1:21:25 am

Hello,

i use to work with sqliimport but i try to do multilocation and it does not succeed :

here is a part of my code which work :

$contentOptions = new SQLIContentOptions( array(
'class_identifier' => 'agence',
'remote_id' => (string)md5($row->etab."-".$row->guichet),
'creator_id' => 14
) );
$content = SQLIContent::create( $contentOptions );
$content->fields->nom_du_guichet = (string) $row->nomguichet;
$content->fields->entite = (string) $row->etab;
$content->addLocation( SQLILocation::fromNodeID( $parentnodeid ) );

$publisher = SQLIContentPublisher::getInstance();
$publisher->publish( $content );

the same with multilocation to contentroot et mediaroot doesn't work :

 

$contentOptions = new SQLIContentOptions( array(
'class_identifier' => 'agence',
'remote_id' => (string)md5($row->etab."-".$row->guichet),
'creator_id' => 14
) );
$content = SQLIContent::create( $contentOptions );
$content->fields->nom_du_guichet = (string) $row->nomguichet;
$content->fields->entite = (string) $row->etab;
$content->addLocation( SQLILocation::fromNodeID( $parentnodeid ) );
$content->addLocation( SQLILocation::fromNodeID( 2 ) );
$content->addLocation( SQLILocation::fromNodeID( 43 ) );

$publisher = SQLIContentPublisher::getInstance();
$publisher->publish( $content );

thanks a lot for your help.

Alexandre

Paris, France

Jérôme Vieilledent

Monday 02 May 2011 2:20:41 am

Hi Alex

It seems to be a simple right access issue. Does your import user has the right to create/edit content in the media section ?

SEBBANE Alexandre

Monday 02 May 2011 2:33:24 am

hello,

14 is the admin ....

Alexandre

Paris, France

Jérôme Vieilledent

Monday 02 May 2011 2:41:20 am

Yes, but there is no login action here...

Try this in your sqliimport.ini :

[ImportSettings]
RobotUserID=14

With that setting, the admin will be logged in. Without it, Anonymous User is used. The creator_id option is different. It's for forcing a user as content owner.

SEBBANE Alexandre

Monday 02 May 2011 2:48:25 am

I try to do this but nothing change ...

How the first code work with anonymous ? anonimous don't have any rights to write .... so i do'nt understand.

Alexandre

Paris, France

Jérôme Vieilledent

Monday 02 May 2011 3:02:38 am

"

I try to do this but nothing change ...

How the first code work with anonymous ? anonimous don't have any rights to write .... so i do'nt understand.

Alexandre

"

When creating/editing content via script, security policies are not always checked.

Do you have anything in your logs (error.log / sqliimport logs) ?

SEBBANE Alexandre

Monday 02 May 2011 3:17:52 am

Cool it's works.... You rock.

i 'am using : sqliimport 1.2.1 et ezpublish 4.5 community

Alexandre

Thanks ...

Paris, France

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 03:11:04
Script start
Timing: Jan 18 2025 03:11:04
Module start 'layout'
Timing: Jan 18 2025 03:11:04
Module start 'content'
Timing: Jan 18 2025 03:11:05
Module end 'content'
Timing: Jan 18 2025 03:11:05
Script end

Main resources:

Total runtime0.4838 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 587.9141152.6250
Module start 'layout' 0.00500.0029 740.539139.4531
Module start 'content' 0.00780.4748 779.9922602.6172
Module end 'content' 0.48260.0012 1,382.609420.1641
Script end 0.4838  1,402.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.5984160.0002
Check MTime0.00120.2479160.0001
Mysql Total
Database connection0.00060.120110.0006
Mysqli_queries0.422687.3539690.0061
Looping result0.00040.0852670.0000
Template Total0.460595.220.2302
Template load0.00210.435220.0011
Template processing0.458494.740920.2292
Template load and register function0.00010.016910.0001
states
state_id_array0.00050.104610.0005
state_identifier_array0.00090.182320.0004
Override
Cache load0.00190.3872710.0000
Sytem overhead
Fetch class attribute can translate value0.00040.087020.0002
Fetch class attribute name0.00070.147290.0001
XML
Image XML parsing0.00110.223020.0005
class_abstraction
Instantiating content class attribute0.00000.0038140.0000
General
dbfile0.00100.2036230.0000
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs