php course 8

30
7/21/2019 Php Course 8 http://slidepdf.com/reader/full/php-course-8 1/30 Date : 2/25/2014 Web Technology Solutions Class: Application Syndication: Pase and Publish !SS " #$% Data

Upload: t

Post on 05-Mar-2016

19 views

Category:

Documents


0 download

DESCRIPTION

php

TRANSCRIPT

Page 1: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 1/30

Date : 2/25/2014

Web Technology SolutionsClass: Application Syndication: Pase and Publish !SS " #$% Data

Page 2: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 2/30

 Tonight

&ntoduction to #$%

Ceating #$%' !SS' and (S)* +ith P,P

using si-ple#$% .o #$%!SS%ab

Page 3: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 3/30

%ab Peie+

Application Deelop-ent

!egistation eatue

%ogin%ogout

$aintain State

Ad-in C!D .o Suey

Publish #$% and !SS

Page 4: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 4/30

%ab Peie+

Application Deelop-ent:

Adding #$% and !SS

Publish an !SS .eed o. you sueyesponses

Publish an #$% du-p o. you suey

esponses

 3ou +ill i-ple-ent an C) to poide#$% publication o. a table in youdatabase Poide a !% o. .eed

Page 5: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 5/30

inal Po6ect!eie+

inal Po6ect 7 Web App 8lin9

egistation .eatue 8+ee9 ;

login logout 8+ee9 <

ad-in ability toceateeadupdatedelete 8C!D8+ee9 475

$aintain State thoughout app8coo9iessessions 8+ee9 <

#$% and !SS .eeds 8+ee9 =

>alid #,T$% and CSS design

Page 6: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 6/30

Web Apps

Poble- +ith apps:

Data stoed in othesyste-s can?t be shaedeasily

Data is in di@eent

.o-ats

Data has no -eaning toothe syste-s' 6ust itso+n natie syste-

Page 7: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 7/30

Web Apps

oals:

Shae in.o-ation acoss-ultiple enion-ents

)pen' Beible language to

shae data

Poide sche-atic -eaningto data ele-ents

Page 8: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 8/30

Solution:XML

Page 9: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 9/30

&nto to #$%

$a9up language .o docu-entscontaining stuctued in.o-ation

tensible $a9up %anguage 8a9into ,T$%

Suppoted by WC as a standad

Poides 9no+n stuctue and

eleant -eaning to that datastuctue

Widely used 8iTunes' eg

Pe.ect .o P,P deelopes to

shae data

Page 10: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 10/30

 Te-s o. #$%

$eta: liteally Epoides-eaningF

Sche-a: A logical oganiGedstuctue o. data

 Tags: le-ents in #$% that aedata containes

Attibutes: tend -eaning o. atag

SeialiGe: saing o stoing data

*odes: a D)$ stuctue o. a dataob6ect 8tee

Page 11: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 11/30

#$% Sa-ple

Conside this ea-ple:

HI-l esionJF10FIK

Hpoduct bacodeJF2242FK

  H-a9eKS-ithsonH/-a9eK

  Hna-eKApe D>D Playe 12H/na-eK

  HLuantityKH/LuantityK

  HsiGeKc-H/siGeK

  HcoloKblac9H/coloK

H/poductK

Page 12: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 12/30

#$% Synta Stuctue

Conside this ea-ple:

HI-l esionJF10FIK // #$% DeMnition 8esion

Hpoduct bacodeJF2242FK

  H-a9eKS-ithsonH/-a9eK

  Hna-eKApe D>D Playe 12H/na-eK

  HLuantityKH/LuantityK

  HsiGeKc-H/siGeK

  HcoloKblac9H/coloK

H/poductK

Page 13: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 13/30

#$% Synta Stuctue

Conside this ea-ple:

HI-l esionJF10FIK // #$% DeMnition 8esion

Hpoduct bacodeJF2242FK // tending Tagging Syste- 8use deMned -a9up adds -eaning

  H-a9eKS-ithsonH/-a9eK

  Hna-eKApe D>D Playe 12H/na-eK

  HLuantityKH/LuantityK

  HsiGeKc-H/siGeK

  HcoloKblac9H/coloK

H/poductK

Page 14: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 14/30

#$% Synta Stuctue

Conside this ea-ple:

HI-l esionJF10FIK // #$% DeMnition 8esion

Hpoduct bacodeJF2242FK // tending Tagging Syste- 8use deMned -a9up adds -eaning

  H-a9eKS-ithsonH/-a9eK //Tags ae ceated and deMned by the deelope 8#SD #$% Sche-a

  Hna-eKApe D>D Playe 12H/na-eK

  HLuantityKH/LuantityK

  HsiGeKc-H/siGeK

  HcoloKblac9H/coloK

H/poductK

Page 15: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 15/30

#$% Synta Stuctue

Conside this ea-ple:

HI-l esionJF10FIK // #$% DeMnition 8esion

Hpoduct bacodeJF2242FK // tending Tagging Syste- 8use deMned -a9up adds -eaning

  H-a9eKS-ithsonH/-a9eK //Tags ae ceated and deMned by the deelope 8#SD #$% Sche-a

  Hna-eKApe D>D Playe 12H/na-eK //Tags contain stictly stings

  HLuantityKH/LuantityK //eLuies: stat tag HLuantityK and end tag H/LuantityK

  HsiGeKc-H/siGeK // sting alue is .ound bet+een the tags

  Hcolo healueJF0000000FKblac9H/coloK //tags can hae attibutes

H/poductK

Page 16: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 16/30

*odes in #$%

 The *ode:

Contains all eleant dataabout an ele-ent

o ea-ple: HpoductK' +hichcontains all the data .o thatindiidual poduct

 This node has EchildnodesF'such as HcoloK

Data can be a sting 8but-oe

Page 17: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 17/30

Page 18: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 18/30

Ceate #$% +ith P,P

.open8 7 allo+s you to open a docu-ent on the Mlesyste- // esouce

you can QMleJ .open8Rpesidents-lR' R+R // note sa.e-ode 'openbasedi

ead only 8

ead and +ite8U

+ite only8+

+ite and ceate8+U

+ite to end o. Mle 8a

+ite to end and ceate 8aU

pe-issions ae an issueN Ty ch-od to <<< to stat and thottle bac9

Page 19: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 19/30

Ceate #$% +ith P,P

.+ite8

Wite to the esouce you +ee using

Allo+s you to co-plete the +ite to the Mle syste-

+ill etun the bytes +itten i. success.ul

Ve a+ae o. pe-issionsN ch-od <<< to stat and go lo+e as needed

Page 20: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 20/30

Ceate #$% +ith P,P

.close8

closes the cuent esouce

etuns boolean +oth chec9ingN

Page 21: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 21/30

XML Example

Page 22: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 22/30

Ceate !SS

+ith P,P Stands .o E!eal Si-ple

SyndicationF

geat .o shaing o syndicatingyou content to outside syste-s

co--only only holds Eso-eecent dataF

natiely uses #$% as a tanspot

,as seeal standadiGed .o-ats

We?ll use !SS 20' co--on usage

Page 23: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 23/30

Ceate !SS

+ith P,P !SS has a deMned .o-at:

A Channel +hich allo+s to add

-eta about +hat you syndicating

Should Contain a title' lin9' anddesciption' 8optional date'language'etc

!SS should hae a deMned tabbedstuctue

!elated %in9s: o.ten .ound onblogs to send a peson to thecoect page to get -oe details

Page 24: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 24/30

Ceate !SS

+ith P,P

Vo+ses Esni@F .o !SS .eeds ona site

 3ou let the bo+se 9no+ you?epublishing !SS by e-bedding a-eta data tag:

Hlin9 elJRaltenateRtypeJRapplication/ssU-lR titleJR!SSRhe.JR/pathto/ss-lR /K

Page 25: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 25/30

RSS Example

Page 26: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 26/30

Si-ple#$%

Si-ple #$% is P,P5?s long7

a+aited class that allo+sP,P deelopes to easilyand e@ectiely pase #$%dataN

Si-ple to se 8its in thena-e

%ets see it in action

Page 27: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 27/30

Path

What is Path and +hy do & caeI

#S%T Standad by the WC

Path is a synta .o Mndingin.o-ation in #$% docu-ents

Can Mnd alues in nodes o

attibutes

Path is pat o. Si-ple#$%

%ean -oe about itN

Page 28: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 28/30

 (S)*

 (aaScipt )b6ect *otation

supe .ast' doesn?t use bul9y-a9up that has to be pased

good .o seialiGing data andtanspot oe a net+o9

co--only used no+ in +ebseices .o +eb and -obile apps

its easy: its 6aasciptN

Page 29: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 29/30

 JSON Example

Page 30: Php Course 8

7/21/2019 Php Course 8

http://slidepdf.com/reader/full/php-course-8 30/30

%ab " *etWee9

%ab

i-ple-ent -lss in app

+o9ing session .o Mnal

!eading: Web Seices

See you TuesdayN