<?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</title>
	<atom:link href="http://www.delawarewebdesigner.com/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>Sun, 28 Feb 2010 22:42:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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>Leif Osmundson Joins the Team</title>
		<link>http://www.delawarewebdesigner.com/inclind/leif-osmundson-joins-the-team.htm</link>
		<comments>http://www.delawarewebdesigner.com/inclind/leif-osmundson-joins-the-team.htm#comments</comments>
		<pubDate>Thu, 18 Feb 2010 18:09:32 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Delaware Web Developer]]></category>
		<category><![CDATA[Delaware Web Development]]></category>
		<category><![CDATA[Inclind]]></category>
		<category><![CDATA[Teamwork]]></category>
		<category><![CDATA[delaware wedding photographer]]></category>
		<category><![CDATA[leif osmundson]]></category>
		<category><![CDATA[leif osmundson photography]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=563</guid>
		<description><![CDATA[After hanging with Leif and chatting about the crazy blizzard that hit the eastern shore earlier this year, we knew he would be a great addition to our growing team. He jumped at the opportunity to join us and we are glad to have him on board.
Leif has a background in photography, web design, SEO, [...]]]></description>
			<content:encoded><![CDATA[<p>After hanging with Leif and chatting about the crazy blizzard that hit the eastern shore earlier this year, we knew he would be a great addition to our growing team. He jumped at the opportunity to join us and we are glad to have him on board.</p>
<p>Leif has a <a href="http://www.leafo.us/" target="_blank">background in photography</a>, web design, SEO, project/client management, and <a href="http://twitter.com/leafophoto">social media</a> with a likeable personality to boot. He&#8217;s very active with social media (and we don&#8217;t mind that!) such as <a href="http://www.facebook.com/leafophoto?ref=sgm" target=_"blank">Facebook</a> and <a href="http://twitter.com/leafophoto" target="_blank">Twitter</a>. He&#8217;s also active in the community with his photography.</p>
<p>Welcome Leif!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/inclind/leif-osmundson-joins-the-team.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Year, New Browser.</title>
		<link>http://www.delawarewebdesigner.com/web-standards/new-year-new-browser.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-standards/new-year-new-browser.htm#comments</comments>
		<pubDate>Thu, 04 Feb 2010 15:24:13 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[ditch IE6]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[stop using ie6]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=553</guid>
		<description><![CDATA[At Inclind, we&#8217;ve always gone above and beyond the call of duty (no, not the worlds most popular video game) to play ball with Internet Explorer 6. It commanded a large part of the market, especially the public sector (schools, offices, government) who&#8217;s IT budgets don&#8217;t deem this a worthy expense. It also commanded a [...]]]></description>
			<content:encoded><![CDATA[<p>At Inclind, we&#8217;ve always gone above and beyond the call of duty (no, not the worlds most popular video game) to play ball with Internet Explorer 6. It commanded a large part of the market, especially the public sector (schools, offices, government) who&#8217;s IT budgets don&#8217;t deem this a worthy expense. It also commanded a large part of development time to make certain things work for that browser. But know this.</p>
<p>It&#8217;s 2010. It&#8217;s time to <a href="http://www.stopie6.com/" target="_blank">stop using Internet Explorer 6</a>.</p>
<p>Internet Explorer 6 was released like a virus on August 27, 2001 with Windows XP. That makes the browser almost 9 years old. Most of you don&#8217;t keep cars for that long. You trust your car to protect you from danger, that it has efficient gas usage and quality parts. As soon as it gets old, or you have service issues, you go get a new car. Yet, some of you don&#8217;t seem to be bothered that when you sit down to do your banking or purchase things online, you use a browser that has little to no security, easily delivers malware/virii/spyware, and does not adhere to the internet standards created by some of the top minds of internet architecture at W3C. That&#8217;s like going 80 miles an hour in a car made of glass, bald tires, and powered by a leaky nuclear core. Eventually you are going to get hurt.</p>
<p>With so many super sexy options out there for browsers, you owe it to yourself to upgrade. And why not? Browsers are free. You&#8217;re lucky. I remember <strong>paying</strong> for Netscape Navigator 4 just to escape Internet Explorer in the 90s. That&#8217;s how much I loathed it- and that&#8217;s how popular Netscape used to be. For the stubborn who refuse to upgrade, you are about to be left behind. Companies like Google are <a href="http://arstechnica.com/microsoft/news/2010/02/ie6-users-to-be-evicted-from-gmail-google-calendar.ars" target="_blank">discontinuing support for Internet Explorer 6</a>. Google knows whats up.</p>
<p>It&#8217;s time for you to take action. Please upgrade your browser today. Choose a flavor and enjoy better, and safer, internet browsing today. All of these browsers offer bookmark importing, so you can take your favorites from IE with you.</p>
<p><strong><a href="http://www.google.com/chrome" target="_blank">Google Chrome</a></strong><br />
<strong><a href="http://www.getfirefox.com/" target="_blank">Mozilla Firefox</a></strong><br />
<strong><a href="http://www.opera.com/" target="_blank">Opera</a></strong><br />
<strong><a href="http://www.apple.com/safari" target="_blank">Apple Safari</a></strong></p>
<p>If you need assistance upgrading, we&#8217;re here to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-standards/new-year-new-browser.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>Still Using Internet Explorer?</title>
		<link>http://www.delawarewebdesigner.com/web-applications/still-using-internet-explorer.htm</link>
		<comments>http://www.delawarewebdesigner.com/web-applications/still-using-internet-explorer.htm#comments</comments>
		<pubDate>Tue, 19 Jan 2010 15:17:30 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[chinese exploit internet explorer]]></category>
		<category><![CDATA[drop internet explorer]]></category>
		<category><![CDATA[google hacked with internet explorer]]></category>
		<category><![CDATA[internet explorer is not secure]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=519</guid>
		<description><![CDATA[If you haven&#8217;t been keeping up with the latest internet news, Google (Google China) was hacked in 2009 by sophisticated Chinese hackers. Google wasn&#8217;t the only one attacked, though (but the largest company, no doubt):
&#8220;At least 34 companies, including Adobe, Symantec, Yahoo and Dow Chemical, were attacked, according to industry sources.&#8221;
Whether or not it was [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t been keeping up with the latest internet news, <a href="http://www.nydailynews.com/news/world/2010/01/14/2010-01-14_security_experts_china_hacked_google_to_steal_us_defense_secrets.html" target="_blank">Google (Google China) was hacked in 2009</a> by sophisticated Chinese hackers. Google wasn&#8217;t the only one attacked, though (but the largest company, no doubt):</p>
<p><strong><em>&#8220;At least 34 companies, including Adobe, Symantec, Yahoo and Dow Chemical, were attacked, according to industry sources.&#8221;</em></strong></p>
<p>Whether or not it was a government sponsored attack is irrelevant here (let the FBI/NSA/CIA figure it out, our tax dollars pay for that sort of thing). The common thread in all the attacks is that Internet Explorer was exploited and used to gain access to the infrastructures of these companies.</p>
<p>Do you still use Internet Explorer? The version doesn&#8217;t matter, even 8 still sucks. Ask yourself why. If Symantec, Google, Adobe and Yahoo couldn&#8217;t protect themselves from an Internet Explorer exploit, what makes you think you can? <a href="http://arstechnica.com/microsoft/news/2010/01/microsoft-wants-you-to-ditch-windows-xp-and-ie6-for-security.ars" target="_blank">Google even has the cajones to come out and publicly lambast China and denounce Microsoft XP/IE6 and urge users to move away from Internet Explorer</a> (props to Google).</p>
<p>Switch today. There are plenty of better and more secure browsing options out there. Our personal favorite in the office is <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a>. It is lightweight, extremely fast, secure, and works great with web apps like Gmail and Google Wave. It has the fastest javascript engine and pages load lightening quick. <a href="http://www.apple.com/safari/" target="_blank">Apple&#8217;s Safari</a> is also secure, but not as fast as <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a>. <a href="http://www.opera.com/" target="_blank">Opera</a> is also plenty fast and secure as well. There is also <a href="http://www.mozilla.com/en-US/firefox/firefox.html" target="_blank">Mozilla Firefox</a>, which isn&#8217;t as fast, and becomes more insecure the more plugins you add into to it, due to how plugins run with all permissions. Personally I think Firefox is bloated and slow, but it was the first real alternative to Internet Explorer after Netscape left the scene some years ago.</p>
<p>Lastly, if you are still using Windows 98, 2000, XP, its time to move on. Don&#8217;t leave your front door open and then complain when your home is robbed. Windows 7 is great, OSX is great, and if you are feeling adventurous, try out Ubuntu.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/web-applications/still-using-internet-explorer.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep Passwords Safe with Keepass and GoodPassword</title>
		<link>http://www.delawarewebdesigner.com/security/keep-passwords-safe-with-keepass-and-goodpassword.htm</link>
		<comments>http://www.delawarewebdesigner.com/security/keep-passwords-safe-with-keepass-and-goodpassword.htm#comments</comments>
		<pubDate>Thu, 07 Jan 2010 16:43:27 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[good passwords]]></category>
		<category><![CDATA[keepass]]></category>
		<category><![CDATA[password records]]></category>
		<category><![CDATA[secure passwords]]></category>
		<category><![CDATA[track your passwords]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=508</guid>
		<description><![CDATA[Working with websites, content management systems, and secure data, you get to see your fair share of passwords. Over the years we have educated customers about why their passwords need to be better than &#8216;password&#8217; or &#8216;bill&#8217; and should be hard to guess. Using a service like GoodPassword will help you generate a more secure [...]]]></description>
			<content:encoded><![CDATA[<p>Working with websites, content management systems, and secure data, you get to see your fair share of passwords. Over the years we have educated customers about why their passwords need to be better than &#8216;password&#8217; or &#8216;bill&#8217; and should be hard to guess. Using a service like <a href="http://www.goodpassword.com" target="_blank">GoodPassword</a> will help you generate a more secure password with random letters, case, numbers, and symbols. Of course, its not going to generate the kind of password you will be able to remember (which is a good thing). Some online services like Twitter have <a href="http://www.gaj-it.com/14253/twitter-bans-370-passwords-too-easy-to-hack/" target="_blank">taken measures to prevent users from creating passwords that are too common or not secure</a>.</p>
<p>Fortunately, there is a program out there that will help you keep track of your passwords in a secure way. <a href="http://keepass.info" target="_blank">KeePass</a> is a free program for Windows, Linux, iPhone, and OSX and other portable devices. <a href="http://keepass.info" target="_blank">KeePass</a> allows you to store login information for reference. For example, if you have an Amazon account and you go to log into the website, you can open <a href="http://keepass.info" target="_blank">KeePass</a> and grab your password to paste into the login form at Amazon.</p>
<p><img alt="" src="http://keepass.info/screenshots/main_big.png" title="Keepass" class="aligncenter" width="550" /></p>
<p><a href="http://keepass.info" target="_blank">KeePass</a> keeps your data in an encrypted database that must be opened with a master password. Think of it like the key to your front door. This is the only password you need to remember, because it will prevent you from getting to your data if you cannot remember it (just like losing your key to the house will have you locked out).</p>
<p>The best way I have found to use <a href="http://keepass.info" target="_blank">KeePass</a> is to install the software on the machines you frequently use, and store your <a href="http://keepass.info" target="_blank">KeePass</a> database on a USB stick for safekeeping. That way, you can access your passwords anywhere you are, so long as <a href="http://keepass.info" target="_blank">KeePass</a> software is installed.</p>
<p>If you do a lot of commerce online, it would be a good idea to look into this solution for yourself. Better safe than sorry!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/security/keep-passwords-safe-with-keepass-and-goodpassword.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>Welcome 2010, Welcome Matthew Oseland</title>
		<link>http://www.delawarewebdesigner.com/websites/welcome-2010-welcome-matthew-oseland.htm</link>
		<comments>http://www.delawarewebdesigner.com/websites/welcome-2010-welcome-matthew-oseland.htm#comments</comments>
		<pubDate>Fri, 01 Jan 2010 17:13:06 +0000</pubDate>
		<dc:creator>Kevin Quillen</dc:creator>
				<category><![CDATA[Custom Website Design]]></category>

		<guid isPermaLink="false">http://www.delawarewebdesigner.com/?p=482</guid>
		<description><![CDATA[Happy New Year!
We&#8217;re kick starting this year with some website launches and the hiring of web developer Matthew Oseland. Matthew came to us eager to collaborate on the cool stuff we work on and has a strong background in web development.
]]></description>
			<content:encoded><![CDATA[<p>Happy New Year!</p>
<p>We&#8217;re kick starting this year with some website launches and the hiring of web developer Matthew Oseland. Matthew came to us eager to collaborate on the cool stuff we work on and has a strong background in web development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delawarewebdesigner.com/websites/welcome-2010-welcome-matthew-oseland.htm/feed</wfw:commentRss>
		<slash:comments>0</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>1</slash:comments>
		</item>
	</channel>
</rss>
