Database PublishingDatabase Publishing
Jon WhitenerWeb Communications Specialist
University of Detroit Mercy
Jon WhitenerWeb Communications Specialist
University of Detroit Mercy
How many of you…How many of you…New to Cascade Server?
Are adminstrators?
Use Cascade for multiple, separate but related sites?
Have worked on any Web site that pulled data dynamically from a DB?
Have used Cascade’sDatabase Publishing?
New to Cascade Server?
Are adminstrators?
Use Cascade for multiple, separate but related sites?
Have worked on any Web site that pulled data dynamically from a DB?
Have used Cascade’sDatabase Publishing?
What isDatabase Publishing?
What isDatabase Publishing?
Cascade ServerCascade Server
Cascade ServerCascade Server
External External DatabaseDatabase
Cascade ServerCascade Server
External External DatabaseDatabase
Site ASite A
Site DSite D
Site 5Site 5
Site BSite B Site CSite C
Dynamic sites are…Dynamic sites are…
Dynamic sites are…Dynamic sites are…
Example:UDM news articles
Example:UDM news articles
UDM’s sitesUDM’s sitesCollege ofCollege of
HealthHealthProfessionsProfessions
College ofCollege ofBusinessBusinessAdmin.Admin.
wwwwww(General site)(General site)
School ofSchool ofDentistryDentistry
College ofCollege ofLiberal ArtsLiberal Arts& Education& Education
AlumniAlumni
College ofCollege ofEngineeringEngineering& Science& Science
The idea: share newsThe idea: share news
Enable each site to share (access / use) the news articles of every other site
Selective inclusionE.g.
The Business site can include news from the Engineering site, like Ford CEO visit
The Alumni site can pull articles from any site where alumni are mentioned
Enable each site to share (access / use) the news articles of every other site
Selective inclusionE.g.
The Business site can include news from the Engineering site, like Ford CEO visit
The Alumni site can pull articles from any site where alumni are mentioned
Sharing isn’t always easySharing isn’t always easy
Sharing articles withinCascade was difficult and/or inefficientIndex blocksHighly contorted XSL
Publishing to various sites also tricky Publish all news pages on all sites
We did get it working …
Sharing articles withinCascade was difficult and/or inefficientIndex blocksHighly contorted XSL
Publishing to various sites also tricky Publish all news pages on all sites
We did get it working …
Sharing isn’t always easySharing isn’t always easy
Upgrade to version 5broke it
Upgrade to version 5broke it
Database Publishingoffers a better way
Database Publishingoffers a better way
“DBP” for short“DBP” for short
(“DaBaPu” didn’t test well)(“DaBaPu” didn’t test well)
The goalsThe goals
Enable separate sites to share news articles
Avoid duplication of content
Avoid multiple publishes for each article creation / edit
Use a tested, familiar technique
Enable separate sites to share news articles
Avoid duplication of content
Avoid multiple publishes for each article creation / edit
Use a tested, familiar technique
How to do it with DBP?How to do it with DBP?
In addition to their separate target sites, all sites publish to the shared, external database
In addition to their separate target sites, all sites publish to the shared, external database
Sites can now select from all news articles
Sites can now select from all news articles
Tagging articlesTagging articles
Articles have custom metadata to indicate appropriate audiencesAlumni, current students, faculty, etc.
Also, path and Site ID are informative
Live sites can select appropriate articles using these criteria
Articles have custom metadata to indicate appropriate audiencesAlumni, current students, faculty, etc.
Also, path and Site ID are informative
Live sites can select appropriate articles using these criteria
How does it work?How does it work?
OverviewOverview
Set up external database
Set up Administration assets in Cascade
Create content assets in Cascade
Create PHP Web page that can perform live queries of external database
Set up external database
Set up Administration assets in Cascade
Create content assets in Cascade
Create PHP Web page that can perform live queries of external database
Set up external databaseSet up external database
MySQL 5.0+ required
Grant access to Cascade Server
Grant access to production Web servers
May want direct access (e.g. Navicat)
Follow security practices (omitted here)
MySQL 5.0+ required
Grant access to Cascade Server
Grant access to production Web servers
May want direct access (e.g. Navicat)
Follow security practices (omitted here)
Set up external databaseSet up external database
External database schema is set by Hannon Hill
We’ll look at schema later
External database schema is set by Hannon Hill
We’ll look at schema later
Set up CascadeAdministration assets
Set up CascadeAdministration assets
TransportTargetDestinationTemplate
TransportTargetDestinationTemplate
Configuration Set
Metadata SetData DefinitionContent Type
Configuration Set
Metadata SetData DefinitionContent Type
TransportTransport
TransportTransport
Site Id
User
TransportTransport
Test
“Test Transport” option appears when a Transport is selected
TargetTarget
Out. File Ext.
Base Folder
DestinationDestination
DB Transport
Test DestinationTest Destination
Test DestinationTest Destination
TemplateTemplate
Configuration SetConfiguration Set
We create a new Set here
One Configuration pointing to new DBP Template
Would likely make sense to add DBP Configuration to one of your existing Configuration Sets
We create a new Set here
One Configuration pointing to new DBP Template
Would likely make sense to add DBP Configuration to one of your existing Configuration Sets
Configuration SetConfiguration Set
Bear with me …Bear with me …
Data DefinitionData Definition
Metadata SetMetadata Set
Custom (“dynamic”) metadata will be used to make the news articles easily selectable
Here, we add “audience” information, i.e. indicate which audiences would be interested in the news article
Custom (“dynamic”) metadata will be used to make the news articles easily selectable
Here, we add “audience” information, i.e. indicate which audiences would be interested in the news article
Metadata SetMetadata Set
Metadata SetMetadata Set
When creating / editing a page, custom metadata will look like:
When creating / editing a page, custom metadata will look like:
Content TypeContent Type
Site ID cascades upSite ID cascades upSome administrative assets are
specific to a site number, i.e. the Site ID
TransportDestinationTargetTemplateConfiguration Configuration SetContent Type
Some administrative assets are specific to a site number, i.e. the Site ID
TransportDestinationTargetTemplateConfiguration Configuration SetContent Type
Create content assetsCreate content assetsCreate Page with new Content TypeCreate Page with new Content Type
Create content assetsCreate content assetsCreate Page with new Content TypeCreate Page with new Content Type
Now we’re getting tothe good stuff
Now we’re getting tothe good stuff
Let’s publish a page from the general site – Site ID 1
Let’s publish a page from the general site – Site ID 1
Peek at the DBPeek at the DB
External database contains five tablespagemetadatametadata_customfilefolder
We’re concerned with the first three
External database contains five tablespagemetadatametadata_customfilefolder
We’re concerned with the first three
Table: pageTable: pageAfter first Page publish, we have 1 record:After first Page publish, we have 1 record:
id 4
account_id 1
site_id 1
cms_id cef30e52c66d185201260e7b6b1a1634
folder_id 67597412c66d1852000369bbff883f8b
metadata_id
1736
name www-page-1
path www.udmercy.edu/dbp/page-1
content <region-render><system-data-structure><headline>This is a headline</headline><body-text><p>This is REVISED body text, in a p element.</p><p>This is some more, plus a picture, below:</p><p><img alt="Basketball" src="www.udmercy.edu/dbp/basketball.jpg"/></p><p>A link to the <a href="www.udmercy.edu/index">home page</a>.</p></body-text></system-data-structure></region-render>
Table: pageTable: pageAfter first Page publish, we have 1 record:After first Page publish, we have 1 record:
id 4 Table’s auto-increment key
account_id 1 Always 1
site_id 1 Set in Transport
cms_id cef30e52c66d185201260e7b6…
Page’s ID in Cascade
folder_id 67597412c66d1852000369bbf…
Folder’s ID in Cascade
metadata_id
1736 Foreign key metadata table
name www-page-1 Cascade system name
path www.udmercy.edu/dbp/page-1
Cascade path (≠ published path)
content <region-render><system-data-structure><headline>This is a headline</headline><body-text><p>This is REVISED body text, in a p element.</p> … </body-text></system-data-structure></region-render>
XML of the page’s DEFAULT region.
(Would include any transformations applied to the DEFAULT region.)
Table: metadataTable: metadataOne record, with the fields you know
from a Cascade’s Wired Metadata pane:One record, with the fields you know
from a Cascade’s Wired Metadata pane:
id
account_id
site_id
display_name
title
summary
teaser
keywords
description
author
review_date
start_date
end_date
last_published_at
last_published_by
created_by
created_at
updated_by
updated_at
idhere matches page.metadata_id
Table: metadata_customTable: metadata_customHere, we have two records for the page,
because we selected two checkbox valuesHere, we have two records for the page,
because we selected two checkbox values
id 51
account_id
1
site_id 1
file_id [Null]
folder_id [Null]
page_id 4
field audiences
value Alumni
id 52
account_id
1
site_id 1
file_id [Null]
folder_id [Null]
page_id 4
field audiences
value Students
Foreign key page.id
First record Second record
Time to shareTime to shareRepeat steps, from Transport up, for
another site (Business) with Site ID 2
Publish a page from the Business site to the external database
Now the DB contains data published from two separate sitesSite ID 1: general site (www)Site ID 2: College of Business site
Repeat steps, from Transport up, for another site (Business) with Site ID 2
Publish a page from the Business site to the external database
Now the DB contains data published from two separate sitesSite ID 1: general site (www)Site ID 2: College of Business site
Tables after Site 2 publishTables after Site 2 publish(Selected fields)(Selected fields)
pagepage
metadatametadata
Tables after Site 2 publishTables after Site 2 publish(Selected fields)(Selected fields)
metadata_custommetadata_custom
Create PHP Web pageCreate PHP Web page
PHP to connect to databasePHP to connect to database
Create PHP Web pageCreate PHP Web page
The SQL we’ll use in this PHP pageThe SQL we’ll use in this PHP page
Create PHP Web pageCreate PHP Web page
PHP that queries DB and creates link list
PHP that queries DB and creates link list
Note http://and .htm
The resultThe result
The resultThe resultYou will need to add another Configuration to actually publish the news article to the Web server so the links will work
Thank you!Thank you!