Path

ez projects / ezcontentstaging / forum / general / ezcontentstaging & sqliimport


ezcontentstaging & sqliimport

You need to be logged in to post messages in the forums. New users may register here.

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Thursday 04 April 2013 6:08:30 pm

Hi Gaetano,

Have you ever tried ezcontentstaging with content imported with the sqliimport extension?
I'm using sqliimport to import some contents, so the classes "SQLIContent" and "SQLIContentPublisher" are used to publish the contents.
It works fine if I use the default language, but if I add another language the content cannot be sync.
So this is working:



$contentOptions = new SQLIContentOptions( array(


        'class_identifier'     => self::CLASSIDENTIFIER,


        'remote_id'            => $contentRemoteID


) );


 

$content = SQLIContent::create( $contentOptions );


 

$content->fields->title = 'TEST';


$content->fields->description = 'TEST';


 

$content->addLocation( SQLILocation::fromNodeID( $nodeId ) );


$publisher = SQLIContentPublisher::getInstance();


$publisher->publish( $content );




And this fails:



$contentOptions = new SQLIContentOptions( array(


        'class_identifier'     => self::CLASSIDENTIFIER,


        'remote_id'            => $contentRemoteID


) );


 

$content = SQLIContent::create( $contentOptions );


 

$content->fields->title = 'TEST';


$content->fields->description = 'TEST';


 

$content->addTranslation( 'eng-GB' );


$content->fields['eng-GB']->id = 'TEST';


$content->fields['eng-GB']->ref = 'TEST';


 

$content->addLocation( SQLILocation::fromNodeID( $nodeId ) );


$publisher = SQLIContentPublisher::getInstance();


$publisher->publish( $content );




I also try this, but it fails too:



$contentOptions = new SQLIContentOptions( array(


        'class_identifier'     => self::CLASSIDENTIFIER,


        'remote_id'            => $contentRemoteID


) );


 

$content = SQLIContent::create( $contentOptions );


 

$content->fields->title = 'TEST';


$content->fields->description = 'TEST';


 

$content->addLocation( SQLILocation::fromNodeID( $nodeId ) );


$publisher = SQLIContentPublisher::getInstance();


$publisher->publish( $content );


 

$content->addTranslation( 'eng-GB' );


$content->fields['eng-GB']->id = 'TEST';


$content->fields['eng-GB']->ref = 'TEST';


 

$publisher->publish( $content );




I hope you have an idea where it could come from.
Thanks.


Nicolas
Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Thursday 04 April 2013 8:04:48 pm

Nopes, never tried using the two extensions together.

I will try do ahve a look when I have time - but I can not guarantee anything... ;-)

Principal Consultant International Business
Member of the Community Project Board

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Thursday 04 April 2013 8:07:01 pm

ps: I guess the code of the extension thinks that for every version of an object, only one language can be added - this is how it happens if you work via the GUI anyway.

So your 2nd example might be doomed to fail, but the 3rd one should wrk...

Principal Consultant International Business
Member of the Community Project Board

Up

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Friday 05 April 2013 2:18:04 pm

Yes, you're right, the 3rd example is actually working.
I made a mistake the first time I tried it, so the error was due to something else.
Thanks for the replies!
Up

You need to be logged in to post messages in the forums. New users may register here.