jcrwebdavread.docx
《jcrwebdavread.docx》由会员分享,可在线阅读,更多相关《jcrwebdavread.docx(78页珍藏版)》请在冰豆网上搜索。
![jcrwebdavread.docx](https://file1.bdocx.com/fileroot1/2023-4/17/cfb83645-ef35-41dc-8fb0-2b665548fa5c/cfb83645-ef35-41dc-8fb0-2b665548fa5c1.gif)
jcrwebdavread
1Introduction
ThisdocumentdescribeshowJSR170canberemotedviaHTTPusingthefunctionalitydescribedbyWebDAVcoveredbythefollowingRFCdocuments:
http:
//www.webdav.org/specs/rfc2518.html
http:
//www.webdav.org/specs/rfc3253.html
http:
//www.webdav.org/specs/rfc3648.html
http:
//greenbytes.de/tech/webdav/draft-reschke-webdav-search-latest.html
VariancestothelistedRFCdocumentsaremarkedthroughoutthedocument.AnimplementationoftheprotocoldescribedinthisdocumentisavailablefromtheApacheJackrabbitJCR-Serverproject.
2Protocol:
UsageofWebDAVMethodsdefinedbyRFC2518
2.1General
2.1.1NamespaceforJCRspecificextensions
ForJCRspecificextensionstotheWebDAVprotocolsuchasWebDAVpropertiesandXmlelements,thefollowingnamespaceisused:
Withinthisdocumentthisnamespaceisabbreviatedwiththe‘jcr’prefix.
2.2OPTIONS
Additionalmethodsandcomplianceclassesarelistedaccordingtotheiravailabilityonagivenresource.
2.3PROPFIND
ProvidesmetadataforresourcesaccordingtoRFC2518.
PropertiesfromRFC2518
seehttp:
//www.webdav.org/specs/rfc2518.html-dav.properties
2.3.1PropertiesfromRFC3252
NOTE:
propertiesrequiredforBASELINE,ACTIVITY,WORKING-RESOURCEandV-C-COLLECTIONfeaturesarenotlisted.
Namespace:
Name
Accessibility
Description
JCRequivalent
GeneralResource
DAV:
workspace
r
(protec.)
ELEMENTworkspace(href)>
TheDAV:
workspacepropertyofaworkspaceresourceMUSTidentifyitself.TheDAV:
workspacepropertyofanyothertypeofresourceMUSTbethesameastheDAV:
workspaceofitsparentcollection.
GeneralDeltaV-Resource
DAV:
supported-method-set
r
(protec.)
Calculatedonresource
-
DAV:
supported-live-property-set
r
(protec.)
Calculatedonresource
-
DAV:
comment
r
(protec.)
-
cannotberetrievedfromJCRversions
DAV:
creator-displayname
r
(protec.)
-
cannotberetrievedfromJCRversions
DAV:
supported-report-set
r
(protec.)
Calculatedonresource
-
GeneralVersion-ControlledResource
DAV:
version-history
r
(comp.)
Node.getVersionHistory().getPath()
DAV:
auto-version
ELEMENTauto-version(checkout-checkin|checkout-unlocked-checkin
|checkout|locked-checkout)?
>
ELEMENTcheckout-checkinEMPTY>
ELEMENTcheckout-unlocked-checkinEMPTY>
ELEMENTcheckoutEMPTY>
ELEMENTlocked-checkoutEMPTY>
DetermineshowaDeltaVservershouldtreatrequesttoVC-resourcesiftheclientdoesnotknowCHECKIN/CHECKOUT.
JCR:
emptyauto-versionproperty,forexplicitCHECKOUTisrequired.
Implementation:
r-only,serverdefined.
Checked-InVersion-ControlledResource
DAV:
checked-in
r
(protec.)
ELEMENTchecked-out(href)>
wherehrefpointstothebaseversion
Node.isCheckedOut()
Node.getBaseVersion()
Checked-OutVersion-ControlledResource
DAV:
checked-out
r
(protec.)
ELEMENTchecked-out(href)>
wherehrefpointstothebaseversion
Node.isCheckedOut()
Node.getBaseVersion()
DAV:
predecessor-set
r/w
Onchecked-outVC-resourcethispropertydeterminestheDAV:
predecessor-setpropertyoftheversionthatresultsfromcheckinginthisresource.
Node.getProperty(“jcr:
Predecessors”)
Note:
JCRdoesnotallowtosetthepredecessor-set.howeverthatpropertyisusedtoresolvemergeconflicts.
see:
ResolvingMergeConflicts
DAV:
checkout-fork
-
NOTIMPLEMENTED
DAV:
checkin-fork
-
NOTIMPLEMENTED
DAV:
merge-set
r,w
Listsmergesourceswhosemergebehaviourcannotberesolvedunambiguously(IfDAV:
no-auto-mergeisset).
NOcorrespondence.
no-auto-mergewouldcorrespondtoMERGEwithbestEffort=falsewhichresultsinMergeExceptiononanyfailure.
DAV:
auto-merge-set
r,w
Listsmergesourceswhosemergebehaviourcannotberesolvedunambiguously(IfDAV:
no-auto-mergeisNOTset).
jcr:
mergeFailedproperty.
MERGEwithbestEffort=true
VersionResource
DAV:
predecessor-set
r
(protec.)
OnaVersion-resourcethispropertyidentifieseachpredecessorofthisversion
PathsofVersion.getPrecessors()
DAV:
successor-set
r
(comp.)
OnaVersion-resourcethispropertyidentifieseachversionthathasthisversionbeingpartofit’sDAV:
predecessor-set.
PathsofVersion.getSuccessors()
DAV:
checkout-set
(comp.)
OnaVersionresourcethispropertyidentifieseachchecked-outresourcewhoseDAV:
checked-outpropertyidentifiesthisversion.
RetrievedbyfollowingtheReferencesoftheVersion-Nodeanddisplaythosethatareoriginatingfromthejcr:
baseVersionpropertyofachecked-outnode.
DAV:
version-name
Aserver-definedstringthatisdifferentforeachversioninagivenversionhistory
Version.getName()
DAV:
checkout-fork
-
NOTIMPLEMENTED
DAV:
checkin-fork
-
NOTIMPLEMENTED
DAV:
version-history
(comp.)
PathofhistoryretrievedbyVersion.getContainingVersionHistory()
DAV:
label-name-set
r
(protec.)
Thispropertycontainsthelabelsthatcurrentlyselectthisversion.
Version.getVersionLabels()
Version-HistoryResource
DAV:
version-set
r
(protec.)
OnaVersion-resourcethispropertyidentifieseachpredecessorofthisversion
PathsofVersionHistory.getVersions()
DAV:
root-version
VersionHistory.getRootVersion().getPath()
WorkspaceResource
DAV:
workspace-checkout-set)
r
(protec.)
ELEMENTworkspace-checkout-set(href*)>
containingallchecked-outresources.
NOTIMPLEMENTED
2.3.2PropertiesfromRFC3648
Namespace:
Name
Accessibility
Description
JCRequivalent
DAV:
ordering-type
r
(protec.)
Indicatestheorderingtypeofagivenresource.AtthemomenttheonlypossiblevalueisDAV:
custom,indicatingthattheresourceallowsreorderingofitsinternalmembers.
Node.getPrimaryType().
hasOrderableChildNodes()
DAV:
supported-method-set
r
(protec.)
Calculatedonresources
-
DAV:
supported-live-property-set
r
(protec.)
Calculatedonresources
NOTIMPLEMENTEDYET
2.3.3PropertiesrelatedtoSEARCH
Namespace:
Name
Accessibility
Description
DAV:
supported-query-grammar-set
r
(protec.)
QueryManager.getSupportedQueryLanguages()
2.3.4JCRitemspecificproperties
Namespace:
Name
Description
Non-Collection
Collection
jcr:
name
r
Item.getName()
x
x
jcr:
path
r
Item.getPath()
x
x
jcr:
depth
r
Item.getDepth()
x
x
jcr:
type
r
Property.getType()
x
jcr:
value
r,w
Property.getValue()
x
jcr:
values
r,w
Property.getValues()
x
jcr:
length
r
(protec.)
Property.getLength()
x
jcr:
lengths
r
(protec.)
Property.getLengths()
x
jcr:
primarynodetype
r
(woncreationwithMKCOL)
Node.getPrimaryNodeType().
getName()
x
jcr:
mixinnodetypes
r,w
Node.getMixinNodeTypes(),Node.addMixin(String),Node.removeMixin(String)
x
jcr:
index
r
(protec.)
Node.getIndex()
x
jcr:
references
r
(protec.)
Node.getReferences()
x
jcr:
uuid
r
(protec.)
Node.getUUID
x
jcr:
primaryitem
r
(protec.)
Node.getPrimaryItem()
x
jcr:
isnew
r
(protec.)
Item.isNew()
x
x
jcr:
ismodified
r
(protec.)
Item.isModified()
x
x
jcr:
definition
r
(protec.)
Node.getDefinition
Property.getDefinition
x
x
jcr:
namespaces
r,w
Workspace.getNamespaceRegistry()
NamespaceRegistry....
x(Workspace)
jcr:
versionableuuid
r
(protec.)
VersionHistory.getVersionableUUID()
x(VersionHistory)
2.4HEAD
AsdefinedwithRFC2518.
2.5GET
2.5.1GETonresourcesrepresentingaProperty
AGETrequestonanon-collectionresource(i.e.aJCR-Property)willreturnthevalueofthatproperty(equivalenttojavax.jcr.Property.getValue().getStream()orjavax.jcr.Property.getStream()respectively).
SincegetValue()willfailformultivalueproperties,GETwillnotrevealanydetailsonthoseproperties.InsteadPROPFINDforjcr:
values,jcr:
lengthsandjcr:
typearethepropermeanstodeterminthecharacteristicsofamultivalueproperty.
ThesameappliesforPUT.
2.5.2GEToncollections(representingNodes)
AGETrequestonacollectionresourcewillprovidethenon-recursivesystemviewofthegivennodeasitisprovidedbySession.exportSysView.BinaryJCRpropertieswillnotbeskipped.
Example
GET/bar-node/HTTP/1.1
Host:
Content-Type:
xxx;charset="xxx"
Content-Length:
xxxx
#response:
HTTP/1.1200OK
Content-Type:
text/xml;charset="utf-8"
Content-Length:
xxxx
xmlversion="1.0"encoding="UTF-8"?
>
nodesv:
name="bar-node"xmlns:
jcr="http:
//www.jcp.org/jcr/1.0"
xmlns:
mix="http:
//www.jcp.org/jcr/mix/1.0"
xmlns:
rep="internal"
xmlns:
nt="http:
//www.jcp.org/jcr/nt/1.0"
xmlns:
xs="http:
//www.w3.org/2001/XMLSchema"
xmlns:
fn="http:
//www.w3.org/2004/10/xpath-functions"
xmlns:
sv="http:
//www.jcp.org/jcr/sv/1.0"
xmlns=""
xmlns:
jcrfn="http:
//www.jcp.org/jcr/xpath-functions/1.0">
propertysv:
name="jcr:
primaryType"sv:
type="Name">
value>nt:
unstructured
value>
property>
propertysv:
name="jcr:
uuid"sv:
type="String">
value>b0b7b63e-1692-4c42-b579-b1f43c3f1001
value>
property>
propertysv:
name="jcr:
predecessors"sv:
type="Reference">
value>56abd345-59da-4327-b3a7-324918167ad1
value>
property>
propertysv:
name="bin-prop"sv:
type="Binary">
value>R0lGODlhBAAHAPEAAP////8A/wAAAAAAACH5BAEAAAIALAAAAA
AEAAcAAAIIjB4maeyrlCgAOw==
value>
property>
propertysv:
name="longs"sv:
type="Long">
value>22222222
value>
value>3333333333
value>
property>
node>
3Protocol:
UsageofWebDAVMethodsDefinedbyRFC3648
3.1ORDERPATCH
Usedinordertodefinetheorderingoforderablechildnodes.TherequestfollowstherequirementsofRFC3648withoneexception:
TheorderingtypecanonlybeDAV:
custom,fortheJCRspecificationdoesnotallowforparticularorderingrules.
Seealso:
7.3OrderingNodesandRFC3648section7.
Example
ORDERPATCH/default/coll-1/HTTP/1.1
Host:
Conte