List Info

Thread: Import External Data




Import External Data
user name
2006-03-09 20:26:32

Hi Jason,

Thanks for the question, as well as for your interest in Campsite. The new Campsite 2.5 has a PHP API that will probably save you a lot of grief. I'm forwarding your message to the Campsite support mailing list, which you can sign up for at this address:

http://sympa.mdlf.org/wws/subscribe/campsite-support

Good luck with your import. I'm looking forward to hearing what the Campsite developers have to say.

Best regards,

douglas

=============================================
Media Development Loan Fund
=============================================
Douglas Arellanes
Head of Research and Development
Center for Advanced Media--Prague (CAMP)
Na vinicnich horach 24a/1834, 160 00  Prague 6
Czech Republic
Tel: + 420 2 3333 5356, Fax: +420 2 2431 5419
Mobile: +420 724 073 364
http://www.mdlf-camp.net
http://www.campware.org
=============================================
http://www.mdlf.org
=============================================



"Jason Gerard&quot; <jasoncreativemotion.ca>

03/09/2006 08:36 PM

       
        To:        <contactcampware.org>
        cc:        
        Subject:        Import External Data



Hi there,
 
I'm currently building content for a publication.  The magazine I'm doing this for has older, archived data - a lot - and wants to put it into the Campsite system.  The problem is the data is in an organized format (such as delimited list or spreadsheet file).  Is there anyway to import article data into Campsite instead of manualling typing in every part of the article?  Any method that would fully or partially streamline the process would be helpful.  The reason I am asking is there is a huge volume of data to input.
 
Thanks,

Jason Gerard
Chief Systems Architect
, Creative Motion
telephone: (416) 944 - 9063 | website:
http://www.creativemotion.ca | email: creativemotion.ca>jasoncreativemotion.ca

* Confidentiality Notice *
This message, including any attachments, is confidential and/or privileged, and the property of Creative Motion.  It may not be reproduced or released without our consent.  If you received this email by error, please notify us immediately and permanently delete the original transmission from your system, including attachments, without making a copy.

Import External Data
user name
2006-03-09 22:01:54
Hi Jason -
You can write a PHP script to import all the data
automatically.

Before you create your script, make the appropriate article
types that
will contain your data. (Use the admin interface to do this:
Configuration->Article Types)

Then write your script.  The first part of your script would
read in
your data and parse it into its various fields.  The second
part of your
script would insert them into Campsite.

Take a look at this page for an example of how to use the
Campsite API:
http://code.campware.org/projects/campsite/wiki
/ArticleApiExample

The full documentation for the entire Campsite API is here:
http://cod
e.campware.org/api/campsite-2.5/

And here is a specific example of something you might do:

------------------------------------------------------------
-------------
// Assume each $record has the following data:
"title", "intro", "body"
// and that you've created an article type with those same
fields
// called "jasons_article_type".

$articleType = "jasons_article_type";
$languageId = 1; /* English */

foreach ($records as $record) {
  // Create the article
  $article =& new Article($languageId);
  $article->create($articleType,
$record["title"]);

  // update the data
  $articleData =& $article->getArticleTypeObject();
  $articleData->setProperty("intro",
$record["intro"]);
  $articleData->setProperty("body",
$record["body"]);
}
------------------------------------------------------------
-------------

I dont know how much programming experience you have, so let
me know if
you need any help.

- Paul


Douglas.Arellanesmdlf.org wrote:
> 
> Hi Jason,
> 
> Thanks for the question, as well as for your interest
in Campsite. The
> new Campsite 2.5 has a PHP API that will probably save
you a lot of
> grief. I'm forwarding your message to the Campsite
support mailing list,
> which you can sign up for at this address:
> 
> 
http://sympa.mdlf.org/wws/subscribe/campsite-support
> 
> Good luck with your import. I'm looking forward to
hearing what the
> Campsite developers have to say.
> 
> Best regards,
> 
> douglas
> 
> =============================================
> Media Development Loan Fund
> =============================================
> Douglas Arellanes
> Head of Research and Development
> Center for Advanced Media--Prague (CAMP)
> Na vinicnich horach 24a/1834, 160 00  Prague 6
> Czech Republic
> Tel: + 420 2 3333 5356, Fax: +420 2 2431 5419
> Mobile: +420 724 073 364
> http://www.mdlf-camp.net
> http://www.campware.org
> =============================================
> http://www.mdlf.org
> =============================================
> 
> 
> 	*"Jason Gerard" <jasoncreativemotion.ca>*
> 
> 03/09/2006 08:36 PM
> 
> 	       
>         To:        <contactcampware.org>
>         cc:        
>         Subject:        Import External Data
> 
> 
> 
> 
> Hi there,
>  
> I'm currently building content for a publication.  The
magazine I'm
> doing this for has older, archived data - a lot - and
wants to put it
> into the Campsite system.  The problem is the data is
in an organized
> format (such as delimited list or spreadsheet file). 
Is there anyway to
> import article data into Campsite instead of manualling
typing in every
> part of the article?  Any method that would fully or
partially
> streamline the process would be helpful.  The reason I
am asking is
> there is a huge volume of data to input.
>  
> Thanks,
> 
> *Jason Gerard*/
> Chief Systems Architect/, Creative Motion
> telephone: (416) 944 - 9063 | website: _http://www.creativemoti
on.ca_
> <http://www.creative
motion.ca/> | email: _jasoncreativemotion.ca_
> <mailto:jasoncreativemotion.ca>
> 
> * Confidentiality Notice *
> This message, including any attachments, is
confidential and/or
> privileged, and the property of Creative Motion.  It
may not be
> reproduced or released without our consent.  If you
received this email
> by error, please notify us immediately and permanently
delete the
> original transmission from your system, including
attachments, without
> making a copy.
> 

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )