<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Delaware Web Designers - Inclind, Inc Internet Professionals &#187; drupal modules</title>
	<atom:link href="http://www.delawarewebdesigner.com/category/drupal-modules/feed" rel="self" type="application/rss+xml" />
	<link>http://www.delawarewebdesigner.com</link>
	<description>Inclind, Inc - Delaware Web Designers - Professional Delaware Web Design Since 1999</description>
	<lastBuildDate>Wed, 12 May 2010 16:21:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Beracah Homes New Site Launches</title>
		<link>http://www.delawarewebdesigner.com/websites/beracah-homes-new-site-launches.htm</link>
		<comments>http://www.delawarewebdesigner.com/websites/beracah-homes-new-site-launches.htm#comments</comments>
		<pubDate>Wed, 12 May 2010 16:21:54 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Custom Website Design]]></category>
		<category><![CDATA[Delaware Web Developer]]></category>
		<category><![CDATA[Drupal 6.x]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[beracah homes]]></category>
		<category><![CDATA[Custom Drupal Development]]></category>
		<category><![CDATA[delaware homes]]></category>
		<category><![CDATA[delaware modular homes]]></category>
		<category><![CDATA[drupal services]]></category>
		<category><![CDATA[services module]]></category>
		<category><![CDATA[stick built homes in delaware]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=650</guid>
		<description><![CDATA[Beracah Homes, a Delmarva based stick built home construction company, has launched their brand new site today. 
Their previous system was a large Drupal 5 application managing 7 websites which we built in 2008 (and was one of our first Drupal websites). Inclind redeveloped beracahhomes.com under their custom Drupal 6 package, providing added functionality, a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.beracahhomes.com" target="_blank">Beracah Homes</a>, a Delmarva based stick built home construction company, has launched their brand new site today. </p>
<p>Their previous system was a large Drupal 5 application managing 7 websites which we built in 2008 (and was one of our first Drupal websites). Inclind redeveloped <a href="http://www.beracahhomes.com" target="_blank">beracahhomes.com</a> under their custom Drupal 6 package, providing added functionality, a better administrative user interface, content delivery through XML services, billboard (rotating banners) management, and high quality video encoding capabilities. Leif Osmundson provided Beracah Homes with a new design for a fresh look and feel for the upcoming years. We&#8217;ve also implemented better search engine optimization tools to help Beracah Homes rank better amongst their competitors.</p>
<p><strong>Before:</strong></p>
<p><a href="http://www.beracahhomes.com" target="_blank"><img src="http://www.delawarewebdesigner.com/wp-content/beracah-old.jpg" alt="" title="beracah-old" width="550" height="448" class="aligncenter size-full wp-image-658" /></a></p>
<p><strong>After:</strong></p>
<p><a href="http://www.beracahhomes.com" target="_blank"><img src="http://www.delawarewebdesigner.com/wp-content/beracah-new.jpg" alt="" title="beracah-new" width="550" height="448" class="aligncenter size-full wp-image-658" /></a></p>
<p><a href="http://www.beracahhomes.com" target="_blank">Beracah Homes&#8217;</a> builders also have a Drupal package allowing them to manage their own website while receiving modular homes content from <a href="http://www.beracahhomes.com" target="_blank">beracahhomes.com</a>. The builders now have the flexibility of customizing their CMS to their needs without being conformed to the same system tie-in they previously had. It was difficult before to add functionality to one site without affecting the rest, but now all sites can scale without an issue. </p>
<p>Services XML, similar to our Drupal RETS implementation for Drupal real estate, allows Roger Collison (Vice President of <a href="http://www.beracahhomes.com" target="_blank">Beracah Homes</a>) to enter model home types, home specifications, floorplans and photos. That content is then sent to all builder sites so everyone has the same information without having to manage it themselves. This ensures that information on all the homes Beracah builds is accurate and up to date across all their websites without a salesperson in another branch having to remember to make the changes. This was a major functionality change that allowed us to decouple all the websites from a single application, providing them with the same content delivery feature while giving them room to manage their own site.</p>
<p>Custom Drupal solutions is what we do. If you have a website that is just idling on the internet and not doing much for your business, you are interested in getting your first website and not sure where to start, or you just need help managing your current website, <a href="http://www.inclind.com/contact.htm">give us a call at 1-302-856-2802 or stop in</a>. We do free consulting to help you and your business on the internet.</p>
<p><a href="http://www.beracahhomes.com" target="_blank">Check out the new and improved Beracah Homes today!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/websites/beracah-homes-new-site-launches.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blue Hen Organics Website Launches</title>
		<link>http://www.delawarewebdesigner.com/web-applications/blue-hen-organics-website-launches.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-applications/blue-hen-organics-website-launches.htm#comments</comments>
		<pubDate>Tue, 04 May 2010 15:44:56 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Delaware Web Developer]]></category>
		<category><![CDATA[Drupal 6.x]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[building green]]></category>
		<category><![CDATA[organic compost]]></category>
		<category><![CDATA[organic compost facilities delaware]]></category>
		<category><![CDATA[organic recycling]]></category>
		<category><![CDATA[organic residual compost]]></category>
		<category><![CDATA[organic residual composting facilities]]></category>
		<category><![CDATA[sustainable companies]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=632</guid>
		<description><![CDATA[<a href="http://www.bluehenorganics.com" target="_blank">Blue Hen Organics</a>, a new Delaware organic recycling center, opened their doors and their <a href="http://www.bluehenorganics.com" target="_blank">new website</a> this month.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bluehenorganics.com" target="_blank">Blue Hen Organics</a>, a new Delaware organic recycling center, opened their doors and their <a href="http://www.bluehenorganics.com" target="_blank">new website</a> this month. <a href="http://www.bluehenorganics.com" target="_blank">Check them out!!</a></p>
<p><a href="http://www.bluehenorganics.com" target="_blank"><img src="http://www.delawarewebdesigner.com/wp-content/bluehen.jpg" alt="" title="bluehen" width="550" height="534" class="aligncenter size-full wp-image-637" /></a></p>
<p><a href="http://www.bluehenorganics.com" target="_blank">Blue Hen Organics</a> Compost Facility is located on 46 acres just west of Dagsboro, Delaware on Fox Run Road. The facility is open six days a week for material drop-off and product purchases.  The <a href="http://www.bluehenorganics.com" target="_blank">Blue Hen Organics</a> facility is the first permitted organic residual composting facility in Sussex County, Delaware, and is capable of processing over 120 tons of debris daily. This facility currently accepts all types of vegetative debris, yard waste, land clearing debris, and poultry manure.</p>
<p>Inclind assisted with defining branding for <a href="http://www.bluehenorganics.com" target="_blank">Blue Hen Organics</a>, providing a fresh design, developing their website, powering it with Drupal content management system, custom modules, social media integration, and providing search engine optimization.</p>
<p><strong><a href="http://www.bluehenorganics.com" target="_blank">Visit the new Blue Hen Organics site today &#8211; in your browser, iPhone or iPad! &raquo;</a></strong></p>
<p>Have a question about <a href="http://www.inclind.com/portfolio.htm" target="_blank">web design</a>, <a href="http://www.inclind.com/services.htm" target="_blank">content management</a>, Drupal, or marketing your business/brand online? <a href="http://www.inclind.com/contact.htm">Contact Inclind today</a>, we&#8217;re here to help.</p>
<p><strong>302-856-2802</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-applications/blue-hen-organics-website-launches.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accudyne Systems Launches</title>
		<link>http://www.delawarewebdesigner.com/web-applications/accudyne-systems-launches.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-applications/accudyne-systems-launches.htm#comments</comments>
		<pubDate>Thu, 29 Apr 2010 19:14:40 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Custom Website Design]]></category>
		<category><![CDATA[Delaware Web Design]]></category>
		<category><![CDATA[Delaware Web Developer]]></category>
		<category><![CDATA[Delaware Website Design]]></category>
		<category><![CDATA[Drupal 6.x]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[iPhone Apps]]></category>
		<category><![CDATA[accudyne]]></category>
		<category><![CDATA[accudyne systems]]></category>
		<category><![CDATA[custom drupal 6 themes]]></category>
		<category><![CDATA[Custom Drupal Development]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=620</guid>
		<description><![CDATA[<a href="http://www.accudyne.com" target="_blank">Accudyne Systems</a>, a leader in systems automation and custom automation equipment engineering has launched a new website with the help of <a href="http://www.inclind.com" target="_blank">Inclind Inc</a>. Located in Newark, Delaware, <a href="http://www.accudyne.com" target="_blank">Accudyne Systems</a> designs and builds cutting edge machines that are designed to build other machines.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.accudyne.com" target="_blank">Accudyne Systems</a>, a leader in systems automation and custom automation equipment engineering has launched a new website with the help of <a href="http://www.inclind.com" target="_blank">Inclind Inc</a>. Located in Newark, Delaware, <a href="http://www.accudyne.com" target="_blank">Accudyne Systems</a> designs and builds cutting edge machines that are designed to build other machines.</p>
<p><a href="http://www.accudyne.com" target="_blank"><img src="http://www.delawarewebdesigner.com/wp-content/accudyne.jpg" alt="" title="accudyne" width="500" height="397" class="aligncenter size-full wp-image-622" /></a></p>
<p><a href="http://www.accudyne.com" target="_blank">Accudyne Systems</a> specializes in all aspects of custom equipment:</p>
<ul>
<li>Development</li>
<li>Engineering design</li>
<li>Fabrication</li>
<li>Systems integration</li>
<li>Start-up</li>
<li>Support</li>
</ul>
<p>We assisted in converting their old static HTML site into a content management powerhouse with the help of Drupal and custom Drupal module programming and provided them with a fresh new look for 2010 and beyond. Easy editing with <a href="http://www.ckeditor.com" target="_blank">CKEditor</a>, eye catching images using our <a href="http://www.delawarewebdesigner.com/web-applications/billboard-management-now-available.htm">Billboards</a> module, and an eye pleasing new design by Leif Osmundson.</p>
<p><a href="http://www.accudyne.com" target="_blank">Visit the new Accudyne Systems website, in your browser or iPhone/iPad! &raquo;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-applications/accudyne-systems-launches.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wilgus Associates Real Estate Launches with RETS</title>
		<link>http://www.delawarewebdesigner.com/web-applications/wilgus-associates-real-estate-launches-with-rets.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-applications/wilgus-associates-real-estate-launches-with-rets.htm#comments</comments>
		<pubDate>Wed, 14 Apr 2010 18:14:53 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Custom Website Design]]></category>
		<category><![CDATA[Delaware Real Estate]]></category>
		<category><![CDATA[Delaware Web Developer]]></category>
		<category><![CDATA[Delaware Web Development]]></category>
		<category><![CDATA[Drupal 6.x]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[drupal real estate]]></category>
		<category><![CDATA[drupal rets]]></category>
		<category><![CDATA[integrating drupal with rets]]></category>
		<category><![CDATA[RETS]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=594</guid>
		<description><![CDATA[Wilgus Associates brand new real estate system was launched today utilizing RETS real estate feed technology.
Their new Delaware Real Estate section is powered by our Drupal stack utilizing a custom in-house RETS module. Previous systems would receive listings once a day through a bulk FTP push from Offutt. Using RETS, Wilgus Associates can receive on-demand [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wilgusassociates.com/" target="_blank" title="Wilgus Associates - Delaware Real Estate">Wilgus Associates</a> brand new real estate system was launched today utilizing RETS real estate feed technology.</p>
<p>Their new Delaware Real Estate section is powered by our Drupal stack utilizing a custom in-house RETS module. Previous systems would receive listings once a day through a bulk FTP push from Offutt. Using RETS, <a href="http://www.wilgusassociates.com/" target="_blank" title="Wilgus Associates - Delaware Real Estate">Wilgus Associates</a> can receive on-demand updates and data every hour.</p>
<p>This allows for the data to be arranged, mapped, sorted and listed in thousands of ways backed up by hourly data integrity functions to ensure the most up to date information, not to mention the worlds most flexible CMS to manage content with Drupal.</p>
<p>The new site also makes use of extensive search engine optimization work to help Wilgus rank better amongst their competiton. It also utilizes social media tools such as Twitter and Facebook to help spread the word and allow users to share/bookmark listings in their respective services.</p>
<h2>What is RETS?</h2>
<p>The Real Estate Transaction Standard (RETS) facilitates data transfer between partners in the real estate industry. Creating and improving RETS is a collaborative effort to simplify moving real estate information from system to system and simplify solution development efforts. As RETS usage matures and expands, MLS with geographic overlaps can create data-sharing policies that provide their members a single point of entry to search multiple MLS data sets.</p>
<h2>Interested in RETS?</h2>
<p>If you&#8217;re a broker or REALTOR, using RETS technology is the fastest way to get listings up and running on your website. Our RETS system for Drupal was built with flexibility, speed, marketing, and conversions in mind allowing us to quickly and effectively deploy it in no time.</p>
<p>Contact Inclind today at 302-856-2802 or email us at info@inclind.com for a free consultation on how your Delaware real estate website could benefit by using RETS.</p>
<h2>About Wilgus Associates</h2>
<p>The growth story of <a href="http://www.wilgusassociates.com/" target="_blank" title="Wilgus Associates - Delaware Real Estate">Wilgus Associates</a> can be traced back to its origins as a staff of one in a one room insurance office located on the boardwalk in the Bethany Beach Bowling Ally. Since that humble and simple beginning, <a href="http://www.wilgusassociates.com/" target="_blank" title="Wilgus Associates - Delaware Real Estate">Wilgus Associates</a> has grown to include <a href="http://www.wilgusassociates.com/wilgus_associates/locations.htm" target="_blank" title="Wilgus Associates - Delaware Real Estate">three offices in Sussex County</a> that offer a wide array of real estate and insurance services and now employs a staff of over fifty people.</p>
<p><strong><a href="http://www.wilgusassociates.com/" target="_blank" title="Wilgus Associates - Delaware Real Estate">Visit the Wilgus Associates website >></a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-applications/wilgus-associates-real-estate-launches-with-rets.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inclind Launches Washingtons Green Grocer</title>
		<link>http://www.delawarewebdesigner.com/web-applications/inclind-launches-washingtons-green-grocer.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-applications/inclind-launches-washingtons-green-grocer.htm#comments</comments>
		<pubDate>Sun, 28 Feb 2010 22:42:21 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Custom Website Design]]></category>
		<category><![CDATA[Delaware Web Design]]></category>
		<category><![CDATA[Delaware Web Designer]]></category>
		<category><![CDATA[Delaware Web Developer]]></category>
		<category><![CDATA[Delaware Web Development]]></category>
		<category><![CDATA[Delaware Website Design]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Teamwork]]></category>
		<category><![CDATA[Ubercart Development]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[Custom Drupal Development]]></category>
		<category><![CDATA[dc home delivery]]></category>
		<category><![CDATA[Drupal 6]]></category>
		<category><![CDATA[fresh produce washington dc]]></category>
		<category><![CDATA[Ubercart]]></category>
		<category><![CDATA[washingtons green grocer]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=345</guid>
		<description><![CDATA[
Washingtons Green Grocer is the brainchild of John (Zeke) Zechiel and his wife Lisa. After identifying the need for better produce and deliverables versus store bought goods, John and Lisa planted the seeds for Washingtons Green Grocer in 1994. Every week, Washingtons Green Grocer provides customers with tentative lists of fruits and vegetables that will [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.washingtonsgreengrocer.com"><img src="http://www.delawarewebdesigner.com/wp-content/Screen-shot-2010-02-28-at-5.38.11-PM.jpg" alt="" title="Washingtons Green Grocer" width="600" height="260" class="aligncenter size-full wp-image-591" /></a></p>
<p><a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> is the brainchild of John (Zeke) Zechiel and his wife Lisa. After identifying the need for better produce and deliverables versus store bought goods, John and Lisa planted the seeds for <a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> in 1994. Every week, <a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> provides customers with tentative lists of fruits and vegetables that will be available, and each customer can pick and choose what they would like delivered (yep, home delivery!) for that week through their online account.</p>
<p>Providing unmatched service and 100% dedication to custom satisfaction, <a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> has been wildly popular and has exploded in the DC metro area. They currently serve all of Washington DC and the surrounding suburban areas in Maryland and Virginia from Severna Park to Arlington and all points in between north and south. </p>
<h2>How does it work?</h2>
<p>Every week, <a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> selects 12 to 14 different fruits and vegetables and delivers them to your doorstep. On Friday&#8217;s, they email customers a tentative list for the next weeks delivery. If there is anything on the list you don&#8217;t want, you can log into your account and customize your box. For example, you can choose to receive only 7 items instead of the full box, or substitute items for other items. Each customer can choose exactly what they want and get it without fail every single week. You can also set custom schedules for delivery, such as every other week, or once a month, or schedule around vacation time. It&#8217;s all up to the customer!</p>
<h2>Application</h2>
<p>Such business growth commands the necessity of a powerful web application to tie all the logic together and keep things running smoothly. After getting tired of the shortcomings of their previous system, Zeke contacted us and we started talking about a full redesign of the front end and a re-architecting of the back end. After planning and mind-mapping the application to the last detail, Inclind began work on the project early in the summer of this year.</p>
<p>Their initial website was built on a rigid and inflexible Coldfusion system. The first order of business was getting all the existing data out and into the new system and giving it structure to make it easy to work with. As with all our sites, we begin with a base install of Drupal 6 to build from. Drupal is the <strong>best</strong> CMF (content management framework) available right now. Other packages that are simply CMS (content management systems- Plone, Wordpress, Joomla) are not as adaptable and flexible as Drupal. </p>
<p>To handle the business end of things, Ubercart takes care of the day to day transactions for customers. There are over 5,000 active customers in the system. To make it as easy as possible to get started, we ask for your basic information up front and allow you to pick your items for delivery. After your account is created, a staff member at Washington&#8217;s Green Grocer selects the most appropriate truck route for you and you will begin receiving deliverables on the next scheduled day.</p>
<p>At this point, a customer can login at any time and adjust their delivery schedule, items for delivery, or halt deliveries. Customers can also browse recipes on the site and submit their own. Washington&#8217;s Green Grocer promotes healthy eating habits and you will find plenty of recipes on their website for that.</p>
<h2>Backend</h2>
<p>Along with the new visuals and customer functionality, we needed to build and provide lots of cool administrative stuff into the backend for easy management of customers, data, and content.</p>
<p>We also needed to be able to actively map delivery truck routes through Google Maps on demand and be able to filter them in a variety of ways. This helps <a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> visually assess their delivery routes, their customers, and orders. We also also extended on that to provide filtering tools to narrow it down further to specific routes, specific clients, specific orders or orders with specific kinds of products.</p>
<p><a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> staff also have a variety of reporting tools at their disposal for viewing customer trends, requests, future forecasting, and production reports.</p>
<p>Check out <a href="http://www.washingtonsgreengrocer.com" target="_blank">Washingtons Green Grocer</a> today!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-applications/inclind-launches-washingtons-green-grocer.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking to start a business? Go to Delaware LLC!</title>
		<link>http://www.delawarewebdesigner.com/websites/looking-to-start-a-business-go-to-delaware-llc.htm</link>
		<comments>http://www.delawarewebdesigner.com/websites/looking-to-start-a-business-go-to-delaware-llc.htm#comments</comments>
		<pubDate>Fri, 22 Jan 2010 21:11:18 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[Custom Website Design]]></category>
		<category><![CDATA[Delaware Web Designer]]></category>
		<category><![CDATA[Delaware Web Developer]]></category>
		<category><![CDATA[Drupal 6.x]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[create an llc in delaware]]></category>
		<category><![CDATA[delaware llc]]></category>
		<category><![CDATA[form an llc in delaware]]></category>
		<category><![CDATA[franchise tax]]></category>
		<category><![CDATA[harvard business services]]></category>
		<category><![CDATA[make an llc in delaware]]></category>
		<category><![CDATA[start a business in delaware]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=522</guid>
		<description><![CDATA[Are you interested in starting a business in 2010? Why not! Start an LLC, it&#8217;s easy, and Rick Bell and the folks at Harvard Business Services can get you jumpstarted into forming your own LLC right away at Delaware LLC (http://www.delawarellc.com).

What is an LLC?
A limited liability company or a company with limited liability (abbreviated L.L.C. [...]]]></description>
			<content:encoded><![CDATA[<p>Are you interested in starting a business in 2010? Why not! Start an LLC, <a href="http://www.delawarellc.com" target="_blank">it&#8217;s easy</a>, and Rick Bell and the folks at Harvard Business Services can get you jumpstarted into <a href="http://www.delawarellc.com" target="_blank">forming your own LLC</a> right away at <a href="http://www.delawarellc.com" target="_blank">Delaware LLC (http://www.delawarellc.com)</a>.</p>
<p><a href="http://www.delawarellc.com" target="_blank"><img src="http://www.delawarewebdesigner.com/wp-content/delawareinc.jpg" alt="" title="delawareinc" width="550" height="339" class="aligncenter size-full wp-image-532" /></a></p>
<p>What is an <a href="http://en.wikipedia.org/wiki/Limited_liability_company" target="_blank">LLC</a>?</p>
<p><em>A limited liability company or a company with limited liability (abbreviated L.L.C. or LLC or W.L.L) in the law of the vast majority of United States jurisdictions is a legal form of business company that provides limited liability to its owners. Often incorrectly called a &#8220;limited liability corporation&#8221; (instead of company), it is a hybrid business entity having certain characteristics of both a corporation and a partnership or sole proprietorship (depending on how many owners there are). An LLC, although a business entity, is a type of unincorporated association and is not a corporation. The primary characteristic an LLC shares with a corporation is limited liability, and the primary characteristic it shares with a partnership is the availability of pass-through income taxation. It is often more flexible than a corporation and it is well-suited for companies with a single owner.</em></p>
<p><a href="http://www.delawarellc.com" target="_blank">Delaware LLC</a> is built on our custom Drupal CMS package. It was designed from the ground up by Creative Director Kevin Howett, and put together in a collaborative effort between newcomer Matt Oseland, Kevin Howett and Bryan Cordrey. Efforts were focused on a pleasing, business-minded design, effective search engine optimization, and funneling/encouraging customers to begin the process of <a href="http://www.delawarellc.com" target="_blank">forming an LLC in Delaware</a>.</p>
<p>As Rick&#8217;s customers go to him and Harvard Business Services for their LLC/incorporation expertise, Rick came to <a href="http://www.inclind.com" target="_blank">Inclind</a> for our expertise in clean, effective websites and powerful web application development under Drupal and our deep knowledge of content management systems such as Drupal. We also got to flex our system integration skills with Drupal, PHP and Coldfusion.</p>
<p><strong>About Delaware LLC &#038; Harvard Business Services</strong></p>
<p>With more than 25 years of experience, over 20,000 clients worldwide, and offices in both the United States and Europe, Harvard Business Services, Inc. is the premier provider of registered agent and business formation solutions. </p>
<p>Rick Bell formed Harvard Business Services, Inc. in March, 1981. Competitors then were big and well established. But Rick conducted business with a philosophy that allowed Harvard not just to survive but to thrive, emerging over time to become an acknowledged leader in the business formation industry.</p>
<p>His philosophy focused on a highly personalized style of customer service, understanding that beyond the mechanics of forming a business there were dreams and aspirations. A customer’s individual questions and concerns were important and special, and that’s how they were treated.</p>
<p>Rick also decided that a customer’s business formation costs should be fixed, predictable, affordable, and customers should get a lot of value for their money.</p>
<p>After almost 30 years and tens of thousands of business formations later, that same approach is still the signature of our culture and way of doing business: speed, efficiency, expertise and affordability, all delivered with the Harvard legacy of personal service.</p>
<p>Headquartered in Lewes, DE, Harvard Business Services, Inc. today is the leading provider of business formation services. Along with the Harvard Business Services brand of fast, personalized service, customers soon discover a number of other traits that set Harvard Business Services, Inc. far apart from the rest.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>If you have any questions regarding content management systems, Drupal, Coldfusion or systems integration, we are here to help. Give us a call at 302-856-2802, send us a tweet <a href="http://twitter.com/inclindinc" target="_blank">@inclindinc</a>, or stop by our office. We have been the leading web development firm in the area for over 10 years running and have fourty years of combined web experience under one roof.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/websites/looking-to-start-a-business-go-to-delaware-llc.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sync Files in Drupal Using Services and xmlrpc()</title>
		<link>http://www.delawarewebdesigner.com/how-tos/sync-files-in-drupal-using-services-and-xmlrpc.htm</link>
		<comments>http://www.delawarewebdesigner.com/how-tos/sync-files-in-drupal-using-services-and-xmlrpc.htm#comments</comments>
		<pubDate>Tue, 05 Jan 2010 14:24:08 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[Custom Website Design]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[How To's]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[content distributing in drupal]]></category>
		<category><![CDATA[sync files with drupal xmlrpc]]></category>
		<category><![CDATA[using drupal xmlrpc]]></category>
		<category><![CDATA[using Services module in drupal]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=486</guid>
		<description><![CDATA[In a previous entry we explored content syncing/distributing using the Services module and XMLRPC in Drupal. We learned how to create a method, its callback, how to invoke it through xmlrpc from another server, and how to create or update a node based on that data.
Lets take a look at how you bring in files [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://www.delawarewebdesigner.com/tech-stuff/sync-drupal-content-using-services-and-xmlrpc.htm">previous entry</a> we explored content syncing/distributing using the <a href="http://www.drupal.org/project/services" target="_blank">Services</a> module and XMLRPC in Drupal. We learned how to create a method, its callback, how to invoke it through xmlrpc from another server, and how to create or update a node based on that data.</p>
<p>Lets take a look at how you bring in files as part of that node as well. From the previous example, before calling node_save($node), I call another function to process files. Name it however you wish. My module is called homes_sync, so my hooks and functions begin with that as per Drupal standards.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">homes_sync_get_files<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nid</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sessid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// save the node object</span>
node_save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>homes_sync_get_files() is passed the $node object and will return it after adding (or removing) data. To have a reliable file sync, we need to only update files if they are newer, and remove them if they no longer exist.</p>
<p>In this specific example, the project I am working on has two CCK file fields. One is for a floorplan (a PDF) and the other is an image field. In a node, there is only 1 floorplan, but can be up to 2 dozen images. If you had a more generic node that just has a CCK filefield of &#8216;client_files&#8217; for example, your code would be slightly different.</p>
<p>Before we add any files to the node, the first thing we should do is compare the list of files from the remote site to the local site. We start that off by getting $files via xmlrpc, and loading the node object if $node->nid is present. If any are found on the local site, and not the remote site, we can safely remove them from the node object. The two arrays are iterated over and remove files if necessary.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> homes_sync_get_files<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nid</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sessid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$files</span> <span style="color: #339933;">=</span> xmlrpc<span style="color: #009900;">&#40;</span>REMOTE_SERVICES_URL<span style="color: #339933;">,</span> <span style="color: #0000ff;">'file.getHomeFiles'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sessid</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// first, compare list of files from parent server with local files</span>
	<span style="color: #666666; font-style: italic;">// if our local files has something the parent server doesnt have</span>
	<span style="color: #666666; font-style: italic;">// it was probably deleted. so we need to unset it from the node object</span>
	<span style="color: #666666; font-style: italic;">// when it gets passed back through node_save, cck should delete it proper</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$current_files</span> <span style="color: #339933;">=</span> node_load<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_files</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$files</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// we have files locally, but none on the parent server. 	</span>
			<span style="color: #666666; font-style: italic;">// remove all</span>
			<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_floorplan</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Remote copy of @node no longer has files. Removing all local files for @node.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@node'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_NOTICE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_files</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$files</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// build comparison arrays</span>
&nbsp;
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$files</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$remote_file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$remote_files</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$remote_file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_files</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_floorplan</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$local_floorplan_file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$local_files</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$local_floorplan_file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_files</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$local_image_file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$local_files</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$local_image_file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// now lets see whats missing</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$local_files</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$remote_files</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$local_files</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$local_file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$local_file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$remote_files</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #666666; font-style: italic;">// parent site does not have this file in the node anymore</span>
						<span style="color: #000088;">$files_to_delete</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$local_file</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$files_to_delete</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$files_to_delete</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$files_to_delete</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$file_to_delete</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #666666; font-style: italic;">// CCK field arrays exist in node objects even if they have no data</span>
						<span style="color: #666666; font-style: italic;">// we can assume if the first record is NULL, there is no data</span>
&nbsp;
						<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_floorplan</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_floorplan</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$file_key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$floorplan</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
								<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_to_delete</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$floorplan</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
									watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@file file does not exist on parent server anymore for @node. Removing.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@file'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$floorplan</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@node'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_NOTICE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
									<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_floorplan</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$file_key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
								<span style="color: #009900;">&#125;</span>
							<span style="color: #009900;">&#125;</span>
						<span style="color: #009900;">&#125;</span>
&nbsp;
						<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$image_key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$image</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
								<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_to_delete</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$image</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
									watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@image image does not exist on parent server anymore for @node. Removing.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@image'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$image</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@node'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_NOTICE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
									<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$image_key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
								<span style="color: #009900;">&#125;</span>
							<span style="color: #009900;">&#125;</span>
						<span style="color: #009900;">&#125;</span>
						<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$floorplan</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$remote_files</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$local_files</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Now that we are through with our deletion process, we can begin processing the remote files. For each file id ($fid) we call xmlrpc and get all the data and the file itself and bring it down to our local site. Based on the file extension, we begin building a query so we can look to see if this file exists locally, and what its last timestamp was. We do this so we know if a file should be replaced or not. For example, if you have MyHome.PDF on your local site, and a new version is uploaded on the remote site, simply comparing file names is not good enough. With a filename and a timestamp comparison, you are certain that it should be processed.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$files</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$files</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$fid</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$remote_file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> xmlrpc<span style="color: #009900;">&#40;</span>REMOTE_SERVICES_URL<span style="color: #339933;">,</span> <span style="color: #0000ff;">'file.get'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sessid</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;">// set filepath to save to</span>
				<span style="color: #666666; font-style: italic;">// decode our content file</span>
&nbsp;
				<span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filepath'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> file_directory_path<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$file_data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">// set content type db table, and field to search on.</span>
				<span style="color: #666666; font-style: italic;">// Load up the CCK field</span>
&nbsp;
				<span style="color: #000088;">$filetype</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$filetype</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'pdf'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$content_table</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'content_type_homes'</span><span style="color: #339933;">;</span>
					<span style="color: #000088;">$fid_field</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'field_floorplan_fid'</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$content_table</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'content_field_image'</span><span style="color: #339933;">;</span>
					<span style="color: #000088;">$fid_field</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'field_image_fid'</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
&nbsp;
				<span style="color: #000088;">$file_details</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">// check if it's the same file coming over</span>
				<span style="color: #666666; font-style: italic;">// only applies if the node exists in the first place. otherwise its a new import on a new home</span>
				<span style="color: #666666; font-style: italic;">// if there is a file match we dont want to do anything but skip the creation</span>
				<span style="color: #666666; font-style: italic;">// i think if you dont keep the node-&gt;file field prefilled, and returns those fields empty, it causes the file deletion on the server</span>
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
					<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> db_query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT f.filename, f.fid, f.filepath, f.timestamp FROM {files} f
											INNER JOIN {<span style="color: #009933; font-weight: bold;">%s</span>} ctype ON f.fid = ctype.<span style="color: #009933; font-weight: bold;">%s</span>
										WHERE f.filename = '<span style="color: #009933; font-weight: bold;">%s</span>'&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content_table</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fid_field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
					<span style="color: #000088;">$file_details</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_details</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$file_details</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'timestamp'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'timestamp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
					<span style="color: #666666; font-style: italic;">// if file exists and has not changed remotely, skip it</span>
&nbsp;
					watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@file already exists for @home. Skipping.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@file'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$file_details</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@home'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_NOTICE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
					<span style="color: #666666; font-style: italic;">// save file</span>
					<span style="color: #666666; font-style: italic;">// REPLACE because we can be certain we will not have duplicate files</span>
					<span style="color: #666666; font-style: italic;">// so we will only ever receive unique ones here</span>
&nbsp;
					file_save_data<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_data</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filepath'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> FILE_EXISTS_REPLACE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					<span style="color: #666666; font-style: italic;">//write record in files table</span>
					drupal_write_record<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'files'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> db_query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT fid,filepath FROM {files} WHERE filename = '<span style="color: #009933; font-weight: bold;">%s</span>'&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000088;">$file_details</span> <span style="color: #339933;">=</span> db_fetch_object<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					<span style="color: #000088;">$file_data</span> <span style="color: #339933;">=</span> field_file_load<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_details</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Uploaded @file into @home.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@file'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$full_file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@home'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_NOTICE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
						<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$filetype</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'pdf'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_floorplan</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_data</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_data</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
&nbsp;
					<span style="color: #009900;">&#125;</span>
&nbsp;
				<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$node</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>After the file is saved to the file system and database, <a href="http://api.lullabot.com/field_file_load" target="_blank">field_file_load()</a> is called to load the file data. With a populated array now, we can add that to our node object by simply putting $node->field_floorplan[] = $file_data or $node->field_image[] = $file_data to append the existing array with data. The $node object is returned, and node_save($node) is immediately called, and our node data and file data are saved. Just like that, we have a simple content distribution system from one parent site to potentially many remote sites.</p>
<p>This is just a simple example, your mileage may vary. We are utilizing this technology to hook companies together under different Drupal installations on different servers. Using <a href="http://www.drupal.org/project/services" target="_blank">Services</a> you could also distribute <a href="http://www.drupal.org/project/views" target="_blank">Views</a> configurations, users, and system settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/how-tos/sync-files-in-drupal-using-services-and-xmlrpc.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choose Drupal, Not Proprietary</title>
		<link>http://www.delawarewebdesigner.com/web-applications/choose-drupal-not-proprietary.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-applications/choose-drupal-not-proprietary.htm#comments</comments>
		<pubDate>Sat, 02 Jan 2010 21:10:30 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[open source cms]]></category>
		<category><![CDATA[proprietary cms are bad]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=463</guid>
		<description><![CDATA[Near the end of 2008, Shaun and I sat down and made the collective decision to change direction in how we develop solutions for clients. It was becoming more obvious as the economy started going downhill, we needed to find a way to decrease development costs and increase efficiency to stay relevant. To do this, [...]]]></description>
			<content:encoded><![CDATA[<p>Near the end of 2008, Shaun and I sat down and made the collective decision to change direction in how we develop solutions for clients. It was becoming more obvious as the economy started going downhill, we needed to find a way to decrease development costs and increase efficiency to stay relevant. To do this, we knew we had to find a way to get things done faster and to stop reinventing the wheel.</p>
<p>Up to that point, we had done every project in Coldfusion hosted on Windows (and eventually Linux). There is a price tag that came with that though, whether it be hosting, Coldfusion licensing/upgrading, or development costs. As people were let go due to the economy, we also realized that it is difficult to support proprietary code for a proprietary solution someone else wrote. Why? Because that person is <strong>the only person</strong> in the world who knows why they made the application/code that way. When something goes wrong, you spend hours trying to find the issue, and even more time coming up with a tested reliable solution.</p>
<p>Proprietary solutions are sold as the best thing since sliced bread, but what customers don&#8217;t know is that they are getting locked in to that company. You can&#8217;t easily cut ties with a firm and take your site someplace else. Proprietary applications are the brainchild of whoever developed it. Therefore, when you need support, you won&#8217;t get it. That developer is long gone, but you are stuck with their code. These firms put you in a box and want to keep you there- that is the whole point of proprietary systems. Why do you think you can&#8217;t install OSX on a PC? Why do you think video games are built only for Windows, and not Linux or Mac? It&#8217;s all about client retention.</p>
<p>With that, we decided to start fresh and drop our proprietary Coldfusion CMS and Ecommerce platforms. Everyday we were tied up in fixing Inclind Commerce, or trying to meet the needs of each client for Inclind CMS. Pete and I went as fast as we could, but we pretty much knew there was no way to compete with the rest of the world. We turned to open source solutions to provide us a solid base to build off of, instead of starting each project from scratch (which all essentially had the same core functionality as it were). Developing Coldfusion in Fusebox framework is/was an absolute nightmare and probably still is. It is a disjointed unauthentic implementation of MVC style framework despite what they say, and requires you to hold its hand every step of the development process.</p>
<p>We knew Wordpress would not be a solution at all. At best, it is a blogging platform and nothing more. You may read lots of articles that say how awesome Wordpress is and is a CMS, but <strong>it is not a CMS</strong>. You&#8217;ll also see that those articles are written by designers too, not developers. It&#8217;s a pain in the ass to develop for, it has patches every other week, plugins are prone to XSS attacks or theme hacking, and cannot sustain the level of development we perform. It is not a prime-time application for websites.</p>
<p>We also tried Joomla. Knowing it was based around Mambo, my expectations were low for it based on the experience I had working with Mambo. Even 5 years later, it had an ugly backend, scattered developer community, and little support. The developer area is full of confusing rules, practices and jargon. Take this for example, from the Joomla extensions page:</p>
<blockquote><ul>
<li>Component &#8211; Mini-application to render the main page body.</li>
<li>Module &#8211; Renders small html blocks on any page.</li>
<li>Plugin &#8211; Changes code behavior dynamically.</li>
<li>Language &#8211; Provides language translation.</li>
<li>Ext. Specific Addon &#8211; Specific addon that requires another ext. to operate.</li>
<li>Tool &#8211; External application that helps with creating or managing Joomla! site.</li>
</ul>
</blockquote>
<p>What the hell is the difference? All 6 bullet points say the same thing, yet they are 6 different kinds of extensions for Joomla. We couldn&#8217;t see ourselves training clients around the confusing backend or having lowered development time with their overly complicated extension system and scary licensing rules.</p>
<p>We came to Drupal. I had heard about this one on and off in various circles, generally more good than bad. After a week of successful proof of concepts for different kinds of websites, we decided Drupal was the best solution for us in terms of what we needed to accomplish.</p>
<p>Out of the box, Drupal provides:</p>
<ul>
<li>Database abstraction</li>
<li>Auto-discovery of custom modules</li>
<li>Managed workflow</li>
<li>Robust Development API</li>
<li>Experienced and organized developer community</li>
<li>Intuitive administrative backend</li>
<li>Easy integration of custom modules through the hook system</li>
</ul>
<p>There is a solution for just about any scenario in the Drupal world. They have a very good approval process for modules. For example, if a module has security loopholes or bad coding practices, it will not be accepted until those are corrected (I don&#8217;t see this happening in other projects). If someone is trying to submit a module that already exists in some form, they are encouraged to merge efforts so the community isn&#8217;t littered with duplicate modules with the same functionality. It is differences like these that make Drupal the most widely used, highly regarded, best open source CMS bar none.</p>
<p>Our choice was the right one, proving vital in our relevance to custom web development and is a reason why we are still here and still the top choice for web design / web development / website building on the peninsula. We are able to deploy websites with a consistent codebase and backend in rapid succession. Clients are pleased with the added functionality and easier administrative UI. We&#8217;re at the point now where we can take Drupal and make it do anything we need it to do, big or small. We&#8217;ve been able to provide scalable solutions from the collaboration of many people providing a solid product. Instead of a couple of people making an in-house solution, we&#8217;re working with hundreds on a more polished result. We changed our entire development process so we could have a streamlined workflow and tighter communication between ourselves and the client with great results.</p>
<p>We have some pretty cool projects in the pipeline for 2010 utilizing Drupal and hope to have some things to show off in the next few months. iPhones, region-free real estate integration, content distribution, big boy stuff. Lookout.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-applications/choose-drupal-not-proprietary.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sync Drupal Content Using Services and xmlrpc()</title>
		<link>http://www.delawarewebdesigner.com/tech-stuff/sync-drupal-content-using-services-and-xmlrpc.htm</link>
		<comments>http://www.delawarewebdesigner.com/tech-stuff/sync-drupal-content-using-services-and-xmlrpc.htm#comments</comments>
		<pubDate>Sat, 19 Dec 2009 01:52:37 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[How To's]]></category>
		<category><![CDATA[Tech Stuff]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[drupal node service]]></category>
		<category><![CDATA[drupal Services API]]></category>
		<category><![CDATA[drupal services module]]></category>
		<category><![CDATA[drupal xmlrpc]]></category>
		<category><![CDATA[push content with drupal services]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=427</guid>
		<description><![CDATA[Have you ever wondered how to push custom content from one Drupal site to another Drupal site?
There are a handful of ways to do this. One way would be to create an external database connection, talk to it, and update the data in our database through raw PHP. But that&#8217;s not really good, not to [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wondered how to push custom content from one Drupal site to another Drupal site?</p>
<p>There are a handful of ways to do this. One way would be to create an external database connection, talk to it, and update the data in our database through raw PHP. But that&#8217;s not really good, not to mention slow, and also very <em>un</em> Drupal.</p>
<p>Another way would be to utilize Domain Access, and publish content to affiliated sites. That works in some cases, but what if these sites are independent from each other with different companies managing them? You would then have the nightmare of dealing with prefixed tables, back-end training issues, and the occasional node overlap from misconfiguring Domain Access.</p>
<p>A third way would be to utilize FeedAPI (or its successor, Feeds), to read from an RSS feed. Then you could parse and import that content at regular intervals. Sounds great, but if you plan on importing custom node types that have extensive CCK fields, files and images, prepare to sit down and code plugins and parsers galore to support CCK as data sources to target.</p>
<p>The third way is the one I thought I could get working. It seems so simple in theory that you can create an RSS/XML/JSON data structure with Views, and then tell Feeds to take that feed and parse it. True, it works if you are using a basic content type like Story or Page, but all bets are off once CCK comes into play- and who doesn&#8217;t use CCK these days? Hats off to Alex Barth / Development Seed though on Feeds, its a great start and sure to grow into a monster data consuming module. I do want to use for future projects, just not for this function.</p>
<p>One way that most people are not aware of is to take advantage of Drupal&#8217;s XML-RPC functions through the <a href="http://drupal.org/project/Services" target="_blank">Services</a> module. In short, the <a href="http://drupal.org/project/Services" target="_blank">Services</a> module provides:</p>
<blockquote><p><strong>A standardized solution of integrating external applications with Drupal. Service callbacks may be used with multiple interfaces like XMLRPC, JSON, REST, SOAP, AMF, etc. This allows a Drupal site to provide web services via multiple interfaces while using the same callback code.</strong></p></blockquote>
<p>So, then we got the idea to have the &#8216;master&#8217; Drupal site act as a SOAP server with the <a href="http://drupal.org/project/Services" target="_blank">Services</a> module, and provide our own custom services in order to get the job done. This runs once an hour, requires no user interaction, fails silently, and only requires two modules. Effectively, it also allows us to not have to use:</p>
<ul>
<li>Domain Access</li>
<li>FeedAPI/Feeds</li>
<li>Multi-site Setup</li>
</ul>
<p>The benefit of this is every site can run independently from one another and be customized various ways, while still receiving key content from the parent website. Thus is the beauty of XMLRPC/SOAP.</p>
<p>The next part was to create my own custom method so I can request a list of node ID&#8217;s from the parent server. There is no method of getting all node ID&#8217;s out of the box, but you can easily create them. Here is what I came up with:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// CODE ON PARENT SERVER</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> homes_service_service<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'#method'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'node.getAllHomes'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'#callback'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'homes_service_node_get_all_homes'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'#return'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'array'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'#help'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Return a list of node id\'s that are of the Home content type.'</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> homes_service_node_get_all_homes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> db_query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT nid FROM {node} WHERE type = &quot;%s&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'homes'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$home</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$home</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$homes</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$home</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>	
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$homes</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// CODE ON REMOTE SERVERS</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> homes_sync_get_node_list<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// user authentication code here</span>
	<span style="color: #666666; font-style: italic;">// connect as 'services' user with 'services' role</span>
	<span style="color: #666666; font-style: italic;">// that way, drupal permissions are respected</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// user.login method used</span>
	<span style="color: #666666; font-style: italic;">// we get a successful login if the return is an array and the array values match our login information</span>
        <span style="color: #666666; font-style: italic;">// this needs a little more work so the parent server knows exactly who is requesting information       </span>
&nbsp;
	<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'user'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'password'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$authenticate</span> <span style="color: #339933;">=</span> xmlrpc<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://upgrade.beracahhomes.com/services/xmlrpc'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'user.login'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$authenticate</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$authenticate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">===</span> <span style="color: #000088;">$user</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$authenticate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'status'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$node_ids</span> <span style="color: #339933;">=</span> xmlrpc<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.parentsite.com/services/xmlrpc'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'node.getAllHomes'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>xmlrpc_error<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> xmlrpc_error<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Error getting node list from parent server. Error: @error.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@error'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_CRITICAL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node_ids</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$nid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$nodes</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$nid</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			variable_set<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'parent_home_nodes'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nodes</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Successfully retrieved node list from parent server.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_NOTICE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	homes_sync_perform_update<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> homes_sync_perform_update<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$node_ids</span> <span style="color: #339933;">=</span> variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'parent_home_nodes'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$node_ids</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$nid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> xmlrpc<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.parentsite.com/services/xmlrpc'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'node.get'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT n.nid, n.title, n.type FROM {node} n WHERE n.title = &quot;%s&quot; AND n.type = &quot;%s&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'homes'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>xmlrpc_error<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> xmlrpc_error<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'homes_sync'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Could not perform XMLRPC request. Error: @error.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@error'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> WATCHDOG_CRITICAL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$node</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
&nbsp;
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">type</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">uid</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'status'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">created</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">changed</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'changed'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">promote</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'promote'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">moderate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'moderate'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sticky</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sticky'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tnid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tnid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">translate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'translate'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">body</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">teaser</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'teaser'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">format</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'format'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'data'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">path</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'path'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_type</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_number_of_bathrooms</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_number_of_bathrooms'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_number_of_bedrooms</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_number_of_bedrooms'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_number_of_floors</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_number_of_floors'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_square_footage</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_square_footage'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
				node_save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>	
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> homes_sync_cron<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	homes_sync_get_node_list<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>For some reason, I can&#8217;t have two instances of wp-syntax in a single post, so bear with me. The above code is part of two seperate modules, one on the parent server, and one on the remote server (as notated with the PHP comment).</strong></p>
<p>The module code (after CODE ON PARENT SERVER)  resides on the parent server. This uses hook_service to talk to Services, and says expose node.getAllHomes as a request. That request method then calls the homes_service_node_get_all_homes function, which does a SQL query returns an array of node id&#8217;s that I am looking for.</p>
<p>I could easily return all nodes as their full node objects, but for performance reasons, I&#8217;d rather get a short list and save them on the receiving end. That way, I can create/update a handful at a time instead of all at once, which lightens the load on the database and application server.</p>
<p>On the receiving end, we need some code that creates the request that is sent to the parent server. Using hook_cron, I can send this request on an automated basis. The module code (after CODE ON REMOTE SERVERS) looks for the node list locally, and constructs single requests to retrieve node data one at a time. From there, it constructs a node object and saves it all with node_save. If the node already exists, based on type and title (our node ID&#8217;s will not match, but our title certainly will, since child sites cannot create or edit these nodes) it grabs the node ID from the local database and puts that in with the node object. node_save is a great function that can handle creating or updating data with the same structure. So, if the update runs again and passes us the same data, it will recognize it already has it, and update the record instead of create duplicates. Slick.</p>
<p>So what do we have? If we deploy the remote code on multiple remote sites, they can all sync up specific content with the parent website without anyone having to do anything special. So long as the parent site admin provides content, everyone will get it.</p>
<p>This is a quick implementation of course. I am fleshing out the authentication further as well as staggering the amount of data updated every cron run. With the core functionality in place, I can focus on security and speed. The next step is retrieving files and images using the same methods, and I will go over that in another post when I get a chance.</p>
<p>I hope fellow Drupalers found this useful, because I found that documentation on this is touch and go (and probably a reason not many utilize XMLRPC/Services). It&#8217;s a very powerful feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/tech-stuff/sync-drupal-content-using-services-and-xmlrpc.htm/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Module Compatibility Issue(s) with Drupal Installation Profiles</title>
		<link>http://www.delawarewebdesigner.com/web-applications/make-a-drupal-module-compatible-with-install-profiles.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-applications/make-a-drupal-module-compatible-with-install-profiles.htm#comments</comments>
		<pubDate>Mon, 30 Nov 2009 21:39:18 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[Custom Website Design]]></category>
		<category><![CDATA[Delaware Website Design]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[drupal modules]]></category>
		<category><![CDATA[bug in drupal module?]]></category>
		<category><![CDATA[drupal install profile]]></category>
		<category><![CDATA[drupal install profile help]]></category>
		<category><![CDATA[drupal install profiles]]></category>
		<category><![CDATA[drupal installation profile]]></category>
		<category><![CDATA[program a drupal module]]></category>
		<category><![CDATA[write a drupal module]]></category>
		<category><![CDATA[writing install profile for drupal]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=404</guid>
		<description><![CDATA[Drupal ships with a powerful method of packaging and redistributing your platform configuration called Install Profiles. It is similar to how Linux distro&#8217;s work, where you have the same core operating system, but extensive customization results in a different experience (Fedora, Ubuntu, Debian, etc). This allows us to employ rapid application development (RAD) after finalizing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.drupal.org" target="_blank">Drupal</a> ships with a powerful method of packaging and redistributing your platform configuration called Install Profiles. It is similar to how Linux distro&#8217;s work, where you have the same core operating system, but extensive customization results in a different experience (Fedora, Ubuntu, Debian, etc). This allows us to employ rapid application development (RAD) after finalizing a build of a customized <a href="http://www.drupal.org" target="_blank">Drupal application</a>.</p>
<p>There are some &#8216;gotchas&#8217; though if you develop custom <a href="http://www.drupal.org" target="_blank">Drupal</a> modules like we do. During the install process, <a href="http://www.drupal.org" target="_blank">Drupal</a> only bootstraps the bare minimum to get the job done. I&#8217;ve noticed that if a module&#8217;s install routine calls functions outside of the .install file, the expected result tends to fail because files other than .install are not included during this loading process. It seems there is a special case for the file to be included, or you have to specify in your install profile to explicitly include the file (which takes a lot of time to do). To be specific, I have seen this happen with <a href="http://www.drupal.org/project/boost" target="_blank">Drupal Boost</a>, <a href="http://www.drupal.org/project/gallery_assist" target="_blank">Drupal Gallery Assist</a>, and our custom module <a href="http://www.delawarewebdesigner.com/web-applications/billboard-management-now-available.htm">Billboard</a>, which tipped me off to this problem. The issue has since been fixed in <a href="http://www.drupal.org/project/boost" target="_blank">Boost</a> (and <a href="http://www.delawarewebdesigner.com/web-applications/billboard-management-now-available.htm">Billboard</a>).</p>
<p>For us, the issue was creating custom <a href="http://www.drupal.org/project/imagecache" target="_blank">ImageCache</a> presets during a module&#8217;s install routine. This worked perfectly if you were going to the <a href="http://www.drupal.org" target="_blank">Drupal</a> Modules page and enabling <a href="http://www.delawarewebdesigner.com/web-applications/billboard-management-now-available.htm">Billboard</a>. What happens was the hook_install() function fired, included a definition file, and created presets based on that file. This fails during a <a href="http://www.drupal.org" target="_blank">Drupal</a> install profile, where you use a script to install and configure <a href="http://www.drupal.org" target="_blank">Drupal</a> automatically. This same issue occurs in <a href="http://www.drupal.org/project/gallery_assist" target="_blank">Gallery Assist</a>, and here is how I got around it:</p>
<p>It was pretty apparent that the code needed to come out of the install function. However, I needed to be sure that where I put the code would be compatible to the module loading process, and I&#8217;d need to be sure <a href="http://www.drupal.org/project/imagecache" target="_blank">ImageCache</a> was both installed and loaded before running the following code. Otherwise it would error out, and no <a href="http://www.drupal.org/project/imagecache" target="_blank">ImageCache</a> presets would be created.</p>
<p><a href="http://www.drupal.org" target="_blank">Drupal</a> has a crucial hook for modules. hook_init() allows you to perform tasks every time the module is loaded. In this case, I wanted to tell it to run a function and check for two default <a href="http://www.drupal.org/project/imagecache" target="_blank">ImageCache</a> presets. If they didn&#8217;t exist, create them. This approach solves three issues:</p>
<ol>
<li>Getting around install profile limitations</li>
<li>Provide default <a href="http://www.drupal.org/project/imagecache" target="_blank">ImageCache</a> presets for Billboard module when it is enabled</li>
<li>Recreate the <a href="http://www.drupal.org/project/imagecache" target="_blank">ImageCache</a> presets if they are accidentally deleted by the user (or developer <img src='http://www.delawarewebdesigner.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</li>
</ol>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mymodule_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    mymodule_create_default_imagecache_presets<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mymodule_create_default_imagecache_presets<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000088;">$default_size</span> <span style="color: #339933;">=</span> imagecache_preset_by_name<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mymodule-default'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$thumb_size</span> <span style="color: #339933;">=</span> imagecache_preset_by_name<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mymodule-thumb'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$default_size</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">||</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumb_size</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$default_size</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
            <span style="color: #000088;">$mymodule_default_size</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;600&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$mymodule_thumbnail_size</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;80&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$presets</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Default size.</span>
            <span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'presetname'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mymodule-default'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'actions'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
&nbsp;
                  <span style="color: #0000ff;">'weight'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">,</span>
                  <span style="color: #0000ff;">'module'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mymodule'</span><span style="color: #339933;">,</span>
                  <span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'imagecache_scale'</span><span style="color: #339933;">,</span>
                  <span style="color: #0000ff;">'data'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
                    <span style="color: #0000ff;">'width'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$mymodule_default_size</span><span style="color: #339933;">,</span>
                    <span style="color: #0000ff;">'height'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
                    <span style="color: #0000ff;">'upscale'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
                  <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
              <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            imagecache_preset_save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'actions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'presetid'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> db_last_insert_id<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'imagecache_preset'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'presetid'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            imagecache_action_save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'actions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            imagecache_preset_flush<span style="color: #009900;">&#40;</span><span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            imagecache_presets<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$default_size</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
            <span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'thumb'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'presetname'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mymodule-thumb'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'actions'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
&nbsp;
                  <span style="color: #0000ff;">'weight'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">,</span>
                  <span style="color: #0000ff;">'module'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mymodule'</span><span style="color: #339933;">,</span>
                  <span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'imagecache_resize'</span><span style="color: #339933;">,</span>
                  <span style="color: #0000ff;">'data'</span> <span style="color: #339933;">=&gt;</span> 
                    <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
                      <span style="color: #0000ff;">'width'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$mymodule_thumbnail_size</span><span style="color: #339933;">,</span>
                      <span style="color: #0000ff;">'height'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$mymodule_thumbnail_size</span><span style="color: #339933;">,</span>
                      <span style="color: #0000ff;">'upscale'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
                  <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
              <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            imagecache_preset_save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'thumb'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'thumb'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'actions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'presetid'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> db_last_insert_id<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'imagecache_preset'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'presetid'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            imagecache_action_save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'thumb'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'actions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            imagecache_preset_flush<span style="color: #009900;">&#40;</span><span style="color: #000088;">$presets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'thumb'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            imagecache_presets<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>What that says basically is &#8216;hey, do our default <a href="http://www.drupal.org/project/imagecache" target="_blank">ImageCache</a> presets exist?&#8217; if not, it will create them at runtime.</p>
<p>I have tested this a handful of times with positive results, and, it works with install profiles since hook_init() is called after <a href="http://www.drupal.org" target="_blank">Drupal</a> loads. Food for thought for all you <a href="http://www.drupal.org" target="_blank">Drupal</a> developers out there. If there is a better way to achieve this feel free to leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-applications/make-a-drupal-module-compatible-with-install-profiles.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
