You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2005/12/07 16:26:08 UTC

[RT] Workflow and publishing using JCR

Hi Lenya devs,

I'm currently working on a draft of a "proper" JCR-based Lenya
repository API. When it came to the notorious "area" concept, the
following optiones appeared to be reasonable:

1) Use different subtrees in the same workspace for different areas.

2) Use different workspaces for different areas.

3) Use version history labels.

---

Option (1) has the disadvantage that corresponding nodes in different
areas have no implicit connection to each other. All areas have to be
maintained "manually", without support from the JCR API.

---

Option (2) has the disadvantage that copying (cloning) nodes from one
workspace to the other can't be done inside a session. Nevertheless,
they can be bracketed in transactions. A major advantage of option (2)
over option (1) is that correpsonding nodes in different workspaces
share the same UUID and the same version history, which means there is
an implicit connection. A node can be updated (merged) from its
corresponding node in another workspace. You can think of workspaces
as SVN branches.

---

Option (3) is a totally different approach. Some introductionary points:

- each versionable node has a history (version graph)
- versions can have labels
- labels can be moved from one version to another

This means, publishing a node could mean to add the label "live" to
the last checked-in version (and remove it from a potential previous
version). Deactivating the node would mean to entirely remove the
label "live" from the version history.

For option (3), Session.save() has no effect as well, but it can be
executed in a transaction. This would allow to publish a large number
of nodes with the possibility of rolling back the whole operation.

The particularity of option (3) is that no copies are created, which
means it's rather a snapshot of the version history of the site.
You can think of it as an SVN tag. Live nodes can't be altered,
only replaced with new versions.

I'm not yet sure how the site structure would be handled in option (3).

---

I'll think this over a little, comments are greatly appreciated.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [RT] Workflow and publishing using JCR

Posted by so...@apache.org.
On 12/8/05, Felix Röthenbacher <fe...@wyona.com> wrote:
> solprovider@apache.org wrote:
> I also think that the language attribute should be implemented as
> a property but if it comes to a language document it should be
> implemented as a separate node.

You agreed with me.  If Language configuration is necessary, the nodes
are probably at the publication level rather than the document level.

> > "versions" could be creation-time-based names for each revision
> > "200512071751.xml", plus "index.xml" or "live.xml" for the currently
> > published version.  "archive" could prefix an "a".  Trash could prefix
> > a "d" (for about to be "deleted").  Publishing is simply overwriting
> > "live.xml" with the desired revision.
> Are you referring to JCR versioning or do you propose to implement
> a versioning system on its own. To me, the latter seems the case
> in your argumentation. If so, can you give us some more details what
> would be the advantages over JCR versioning?

I do not know.  I only started with Jackrabbit and JCR on Saturday,
and have not researched JCR's versioning yet  The paragraph above was
how I wanted Lenya1.2 to handle it.  I hope Jackrabbit improves the
implementation/structure.  As a CMS, Lenya may have additional
requirements than JCR provides.

> > The advantages are every revision of a document is in one place.  The
> > disadvantage was the live version would not be distinct in the file
> > system, which was useful.  That disadvantage does not apply when using
> > Jackrabbit because file operations are very difficult.
> >
> > ===
> > In JCR terms, use properties for the revision nodes:
> > - status = "archived", "deleted", "active", "draft" (useful so someone
> > else does not publish it before it is ready)
> > - created = {time}
> > - edited = {time of last edit}
> > - language (??)
> It seems that the vocabulary is not clearly defined. Are you referring
> to workflow states or to revisions in the sense used in a versioning
> system like SVN or CVS?

My "status" field (property) refers to your "workflow state".  I am
applying it to each "revision" node.  This is where JCR's versions may
not be usable (but I do not know.)  Each   "revision" is marked as:
 -  draft = new, not ready to be published
 -  review = needs review before publishing
 -  active = was once published, may be the live document
 -  archive = obsolete needing archiving
 -  delete = obsolete, archived and ready for deletion
The live document is chosen from the "active" revision nodes by a
property of the parent "document" node.  The live revision must remain
"active"; it cannot be set to "archive" or "delete" until another
"active" revision is set as the "live" one.

Off-topic: Workflow needs easy configuration.  Someone will need to
add a second review "reviewLegal".  Others may want to eliminate the
"archive" step.

Off-topic: Archive should compare the "last full archive" date of the
publication with the date of the revision, and delete (or at least
mark as "ready for deletion" ) the documents already archived.

> > There should also be a history (for each language) at the document
> > node for which revisions were published and when.  The document node
> > should also specify which revision is the live one (unless that node
> > is duplicated with a special identifier.)
> >
> > Combining all this into the simplest structure (N=Node, P=Property,
> > -=1, +=many):
> > N:Content
> > + N:DocumentID
> > - + N:SubdocumentID (same structure as DocumentID)
> > - - N:Document (extra node to ease distunguishing between the
> > Document's Nodes and Nodes for the subdocuments.)
> > - - - P:Type (DocumentType = XHTML...)
> > - - - P:LiveRevision (for each language)
> > - - - P:Status = Draft, Review, Published, Version (published but
> > another version is ready)
> > - - - P:Visibility
> > - - - P:Creator
> > - - - P:Languages Available
> > - - - P:{Other document properties}
> > - - - N:History of publishing for each language
> > - - + N:Revision
> > - - - - P:Status
> > - - - - P:Language
> > - - - - P:Editor
> > - - - - P:{Other revision properties}
> > - - - - N:ContentInformation
> > - - - - - N|P:Document-type-specific fields
> As discussed before, one possibility is to keep the actual content
> separate from any representation (MVC model) meaning that the
> content has a flat hierarchy and the actual hierarchy is built
> on a sitetree which is in a separate place apart from the data.
> Are you referring to the sitetree or the document content?
> Should the information be stored with the document or within
> the sitetree?

I discussed the flat hierarchy later.  My opinion is all information
should be stored with the document.  A special child of the content
node is the "Hierarchy", which contains the tree structure stored in
Lenya1.2's "sitetree.xml".

> > Which properties apply to the document and which apply to the
> > revision?  Title, Navigation Title, Subject, and Description could be
> > either.  They could also be moved to Nodes with their own versioning,
> > but that may be overkill.  Does rollback to a revision also rollback
> > those fields?  Do we need a history of changes to those fields?
> > Should changing the Title create a new revision?  Those answers will
> > determine the best structure.
> I think every modification should result in a new revision.

That is the easiest approach, and I have no objections.  This
paragraph declared that it was  a design choice.  Lenya1.2 maintained
the Navigation Title separate (in sitetree.xml) from the document. I
wanted to everyone to understand this was a change that might warrant
discussion.

> > Lenya 1.2's various sitemap.xml files should be built dynamically from
> > the content.  That may require caching for good performance.
> Do you mean sitetree.xml or sitemap.xmap?

That was a typo.  I meant sitetree.xml.  "sitemap.xmap" is part of
functionality, and of little concern to this discussion about the
datastore structure.

> > ===
> > Another decision is whether subdocuments are Nodes of the document.
> > There has been much discussion about using a unique identifier for
> > every document.  This can be implemented as a minor change to the
> > above.  First, discard the "N:Document" node because it would not be
> > necessary, because there would be no N:SubdocumentID nodes.  Second,
> > add a P:ParentDocumentID.
> >
> > Now use a flat structure:
> > N:Content
> > - N:Hierarchy (created from the Document Nodes, could include
> > information such as Visibility, substitute for sitetree.xml)
> > + N:DocumentUniqueID
> > - - P:ParentDocumentID - only if a subdocument
> > - - P:Path
> > - - Everything under N:Document above
> >
> > This is really good for many reasons:
> > 1. No need to distinguish between content Node and subdocument Nodes.
> > 2. Easy operation on multiple or all documents, such as building the
> > Search index.
> Right.
> > 3. Easy moving of subdocuments. Just change the ParentID, rather than
> > moving Nodes.
>
> Would you like to have UID stored with each document for modeling the
> parent/child relationship? Or would it be better to have a separate
> sitetree?

Yes and yes.
The UID is stored with each document.
The Hierarchy node is stored at the top level of Content, and is
simply a tree of UIDs used to improve performance when using a tree
view such as menus.

The UID is the primary key used internally.  A great advantage of this
approach is the editors' Create Internal Link can display a list of
documents, and store the UID. <link uid="xxx"/>.  For display, the
document is found by UID, and the link replaced by the UrlPath and
Title <a href="urlpath">title</a> (or "Broken Link" if the UID is not
found.)  We could allow the Title to be overridden by the link's
creator.  This allows links to survive documents being moved.  Someone
could create a view where all references to a document are displayed,
so the links can be fixed before the document is deleted.

An easier method for displaying links is an action like
"?openUID=xxx".  This could be implemented first.  It should redirect
browsers to the UrlPath so the browser sees the normal address.  This
would not automatically use the Title from the target document, but it
would still show in the "references" view.

> > 4. Easy creation of flat views.  See all documents by Title, Author,
> > Status, Type.  The Status view will show all documents having versions
> > waiting to be published.  The Type view can show all Employees, even
> > if they are created as subdocuments of Departments.
> > 5. All information is stored in the Document Nodes, so "Visibility"
> > and "Navigation Title" are  available when working with the document.
> >
> > It also imposes additional concerns:
> > 1. The tree of documents (N:Hierarchy) must be maintained for easy
> > transversal.  It should only contain the DocumentUniqueIDs.  Creating
> > sitetree.xml should access the document Nodes for the Visibility
> > property.  This allows creating menus based on other properties.
> > Eventually someone will add individual document security, and menus
> > will be built to show only the documents allowed to each person (based
> > on their name and/or Groups).
> >
> > 2. What happens to orphans?  Subdocuments will not automatically be
> > deleted when the Document Node is deleted.  It would be easy to create
> > a view of documents that have ParentDocumentIDs that no longer exist.
> > Or the Delete process could also delete all subdocuments recursively.
> I think there should be some kind of referential integrity to avoid any
> orphans.

This paragraph suggests there are choices.
1. No orphans allowed.  All child nodes must be deleted or moved
(reassigned to another parent) before a node may be deleted.
1. No orphans allowed.  Deletion of a Node also deletes all child
nodes.  This is probably your "referential integrity".
2. Orphans allowed.  Deletion of a Node marks the child node as
orphaned.  Admins then must decide how to handle each child node.

Best would be for Lenya to allow decision for each document type
during development.
Examples:
1. All Employee documents should be reassigned before deleting a
Department parent document.
2. All Blog children of an Article should be deleted when the Article
is deleted.
3. All Task children of an Employee may be orphaned when the Employee
is terminated.  They will eventually be reassigned or deleted, but
removing the Employee is an urgent task that cannot wait for the
manual reassignment.

I am using "Delete" to mean "set Status to Archive in preparation for
deletion", which should be the usual workflow.  Of course the workflow
may be defined in many ways.

Lenya is a development platform.  More flexibilty allows more
applicability.  All 3 of these choices will be desired by somebody
someday.  I suggest configuring it on a per-child-type basis in the
document-type configuration.  Example:
<DocType name="Department" deleteParentActionDefault="no">
 <Child type="Employee" deleteParentAction="no"/>
 <Child type="Reservation" deleteParentAction="delete">
 <Child type="Project" deleteParentAction="orphan"/>
</DocType>
A Department cannot be deleted if it has Employees or child documents
of Types not mentioned.  Otherwise Reservations are cancelled, and
Projects are orphaned for manual decision.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [RT] Workflow and publishing using JCR

Posted by Felix Röthenbacher <fe...@wyona.com>.

solprovider@apache.org wrote:
> On 12/7/05, Felix Röthenbacher <fe...@wyona.com> wrote:
> 
>>Andreas Hartmann wrote:
>>
 >> [...]
> 
> I have always been critical of the "area" concept, and I dislike #1
> and #2 for the reasons stated.  This sounds like the time to improve
> the architecture by using something like #3.
> 
> In Lenya 1.2 terms, I would prefer:
> content/docpath/doc-id/language/versions
> 
> There have been suggestions to move "language" even earlier in the
> path.  As JCR, language could be either a node or a property.  I
> cannot think of any reasons to have it as a node.

I also think that the language attribute should be implemented as
a property but if it comes to a language document it should be
implemented as a separate node.

> 
> "versions" could be creation-time-based names for each revision
> "200512071751.xml", plus "index.xml" or "live.xml" for the currently
> published version.  "archive" could prefix an "a".  Trash could prefix
> a "d" (for about to be "deleted").  Publishing is simply overwriting
> "live.xml" with the desired revision.

Are you referring to JCR versioning or do you propose to implement
a versioning system on its own. To me, the latter seems the case
in your argumentation. If so, can you give us some more details what
would be the advantages over JCR versioning?

> 
> The advantages are every revision of a document is in one place.  The
> disadvantage was the live version would not be distinct in the file
> system, which was useful.  That disadvantage does not apply when using
> Jackrabbit because file operations are very difficult.
> 
> ===
> In JCR terms, use properties for the revision nodes:
> - status = "archived", "deleted", "active", "draft" (useful so someone
> else does not publish it before it is ready)
> - created = {time}
> - edited = {time of last edit}
> - language (??)

It seems that the vocabulary is not clearly defined. Are you referring
to workflow states or to revisions in the sense used in a versioning
system like SVN or CVS?

> 
> There should also be a history (for each language) at the document
> node for which revisions were published and when.  The document node
> should also specify which revision is the live one (unless that node
> is duplicated with a special identifier.)
> 
> Combining all this into the simplest structure (N=Node, P=Property,
> -=1, +=many):
> N:Content
> + N:DocumentID
> - + N:SubdocumentID (same structure as DocumentID)
> - - N:Document (extra node to ease distunguishing between the
> Document's Nodes and Nodes for the subdocuments.)
> - - - P:Type (DocumentType = XHTML...)
> - - - P:LiveRevision (for each language)
> - - - P:Status = Draft, Review, Published, Version (published but
> another version is ready)
> - - - P:Visibility
> - - - P:Creator
> - - - P:Languages Available
> - - - P:{Other document properties}
> - - - N:History of publishing for each language
> - - + N:Revision
> - - - - P:Status
> - - - - P:Language
> - - - - P:Editor
> - - - - P:{Other revision properties}
> - - - - N:ContentInformation
> - - - - - N|P:Document-type-specific fields

As discussed before, one possibility is to keep the actual content
separate from any representation (MVC model) meaning that the
content has a flat hierarchy and the actual hierarchy is built
on a sitetree which is in a separate place apart from the data.
Are you referring to the sitetree or the document content?
Should the information be stored with the document or within
the sitetree?

> 
> Which properties apply to the document and which apply to the
> revision?  Title, Navigation Title, Subject, and Description could be
> either.  They could also be moved to Nodes with their own versioning,
> but that may be overkill.  Does rollback to a revision also rollback
> those fields?  Do we need a history of changes to those fields? 
> Should changing the Title create a new revision?  Those answers will
> determine the best structure.

I think every modification should result in a new revision.

> 
> Lenya 1.2's various sitemap.xml files should be built dynamically from
> the content.  That may require caching for good performance.

Do you mean sitetree.xml or sitemap.xmap?

> 
> ===
> Another decision is whether subdocuments are Nodes of the document. 
> There has been much discussion about using a unique identifier for
> every document.  This can be implemented as a minor change to the
> above.  First, discard the "N:Document" node because it would not be
> necessary, because there would be no N:SubdocumentID nodes.  Second,
> add a P:ParentDocumentID.
> 
> Now use a flat structure:
> N:Content
> - N:Hierarchy (created from the Document Nodes, could include
> information such as Visibility, substitute for sitetree.xml)
> + N:DocumentUniqueID
> - - P:ParentDocumentID - only if a subdocument
> - - P:Path
> - - Everything under N:Document above
> 
> This is really good for many reasons:
> 1. No need to distinguish between content Node and subdocument Nodes.
> 2. Easy operation on multiple or all documents, such as building the
> Search index.

Right.

> 3. Easy moving of subdocuments. Just change the ParentID, rather than
> moving Nodes.

Would you like to have UID stored with each document for modeling the
parent/child relationship? Or would it be better to have a separate
sitetree?

> 4. Easy creation of flat views.  See all documents by Title, Author,
> Status, Type.  The Status view will show all documents having versions
> waiting to be published.  The Type view can show all Employees, even
> if they are created as subdocuments of Departments.
> 5. All information is stored in the Document Nodes, so "Visibility"
> and "Navigation Title" are  available when working with the document.
> 
> It also imposes additional concerns:
> 1. The tree of documents (N:Hierarchy) must be maintained for easy
> transversal.  It should only contain the DocumentUniqueIDs.  Creating
> sitetree.xml should access the document Nodes for the Visibility
> property.  This allows creating menus based on other properties. 
> Eventually someone will add individual document security, and menus
> will be built to show only the documents allowed to each person (based
> on their name and/or Groups).
> 
> 2. What happens to orphans?  Subdocuments will not automatically be
> deleted when the Document Node is deleted.  It would be easy to create
> a view of documents that have ParentDocumentIDs that no longer exist. 
> Or the Delete process could also delete all subdocuments recursively.

I think there should be some kind of referential integrity to avoid any
orphans.

Thanks for some clarifications of your ideas!

- Felix

> 
> solprovider
> 
> 

-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [RT] Workflow and publishing using JCR

Posted by so...@apache.org.
On 12/7/05, Felix Röthenbacher <fe...@wyona.com> wrote:
> Andreas Hartmann wrote:
> > I'm currently working on a draft of a "proper" JCR-based Lenya
> > repository API. When it came to the notorious "area" concept, the
> > following options appeared to be reasonable:
> > 1) Use different subtrees in the same workspace for different areas.
> > 2) Use different workspaces for different areas.
> > 3) Use version history labels.
> > ---
> > Option (1) has the disadvantage that corresponding nodes in different
> > areas have no implicit connection to each other. All areas have to be
> > maintained "manually", without support from the JCR API.
> I wonder if there is any good reason to maintain the correspondency
> between nodes in different areas by hand than rather use the mechanisms
> supported by JCR?
> > ---
> > Option (2) has the disadvantage that copying (cloning) nodes from one
> > workspace to the other can't be done inside a session. Nevertheless,
> > they can be bracketed in transactions. A major advantage of option (2)
> > over option (1) is that correpsonding nodes in different workspaces
> > share the same UUID and the same version history, which means there is
> > an implicit connection. A node can be updated (merged) from its
> > corresponding node in another workspace. You can think of workspaces
> > as SVN branches.
> As mentioned, a transaction can be used. One reason for updating
> to Jetty Plus and to include JOTM was exactly with this usecase
> in mind. One issue we should consider though is that transaction
> support wasn't fully implemented in Jackrabbit six months ago
> when I played around with it: the problem was that a transaction
> could be set to ready-to-commit but it was commited in this phase
> already, meaning a rollback was not possible anymore. This was
> the status-quo six months ago and I don't know how far transaction
> support goes these days in Jackrabbit.
> > ---
> > Option (3) is a totally different approach. Some introductionary points:
> > - each versionable node has a history (version graph)
> > - versions can have labels
> > - labels can be moved from one version to another
> > This means, publishing a node could mean to add the label "live" to
> > the last checked-in version (and remove it from a potential previous
> > version). Deactivating the node would mean to entirely remove the
> > label "live" from the version history.
> How is versioning of different areas handled? I think of a live
> area which I can easily revert if something bad happend during
> publishing. Same applies to the authoring area. I can't see
> how it's accomplished to get a snapshot of both
> live and authoring area with a certain time stamp.
> > For option (3), Session.save() has no effect as well, but it can be
> > executed in a transaction. This would allow to publish a large number
> > of nodes with the possibility of rolling back the whole operation.
> > The particularity of option (3) is that no copies are created, which
> > means it's rather a snapshot of the version history of the site.
> > You can think of it as an SVN tag. Live nodes can't be altered,
> > only replaced with new versions.
> > I'm not yet sure how the site structure would be handled in option (3).

I have always been critical of the "area" concept, and I dislike #1
and #2 for the reasons stated.  This sounds like the time to improve
the architecture by using something like #3.

In Lenya 1.2 terms, I would prefer:
content/docpath/doc-id/language/versions

There have been suggestions to move "language" even earlier in the
path.  As JCR, language could be either a node or a property.  I
cannot think of any reasons to have it as a node.

"versions" could be creation-time-based names for each revision
"200512071751.xml", plus "index.xml" or "live.xml" for the currently
published version.  "archive" could prefix an "a".  Trash could prefix
a "d" (for about to be "deleted").  Publishing is simply overwriting
"live.xml" with the desired revision.

The advantages are every revision of a document is in one place.  The
disadvantage was the live version would not be distinct in the file
system, which was useful.  That disadvantage does not apply when using
Jackrabbit because file operations are very difficult.

===
In JCR terms, use properties for the revision nodes:
- status = "archived", "deleted", "active", "draft" (useful so someone
else does not publish it before it is ready)
- created = {time}
- edited = {time of last edit}
- language (??)

There should also be a history (for each language) at the document
node for which revisions were published and when.  The document node
should also specify which revision is the live one (unless that node
is duplicated with a special identifier.)

Combining all this into the simplest structure (N=Node, P=Property,
-=1, +=many):
N:Content
+ N:DocumentID
- + N:SubdocumentID (same structure as DocumentID)
- - N:Document (extra node to ease distunguishing between the
Document's Nodes and Nodes for the subdocuments.)
- - - P:Type (DocumentType = XHTML...)
- - - P:LiveRevision (for each language)
- - - P:Status = Draft, Review, Published, Version (published but
another version is ready)
- - - P:Visibility
- - - P:Creator
- - - P:Languages Available
- - - P:{Other document properties}
- - - N:History of publishing for each language
- - + N:Revision
- - - - P:Status
- - - - P:Language
- - - - P:Editor
- - - - P:{Other revision properties}
- - - - N:ContentInformation
- - - - - N|P:Document-type-specific fields

Which properties apply to the document and which apply to the
revision?  Title, Navigation Title, Subject, and Description could be
either.  They could also be moved to Nodes with their own versioning,
but that may be overkill.  Does rollback to a revision also rollback
those fields?  Do we need a history of changes to those fields? 
Should changing the Title create a new revision?  Those answers will
determine the best structure.

Lenya 1.2's various sitemap.xml files should be built dynamically from
the content.  That may require caching for good performance.

===
Another decision is whether subdocuments are Nodes of the document. 
There has been much discussion about using a unique identifier for
every document.  This can be implemented as a minor change to the
above.  First, discard the "N:Document" node because it would not be
necessary, because there would be no N:SubdocumentID nodes.  Second,
add a P:ParentDocumentID.

Now use a flat structure:
N:Content
- N:Hierarchy (created from the Document Nodes, could include
information such as Visibility, substitute for sitetree.xml)
+ N:DocumentUniqueID
- - P:ParentDocumentID - only if a subdocument
- - P:Path
- - Everything under N:Document above

This is really good for many reasons:
1. No need to distinguish between content Node and subdocument Nodes.
2. Easy operation on multiple or all documents, such as building the
Search index.
3. Easy moving of subdocuments. Just change the ParentID, rather than
moving Nodes.
4. Easy creation of flat views.  See all documents by Title, Author,
Status, Type.  The Status view will show all documents having versions
waiting to be published.  The Type view can show all Employees, even
if they are created as subdocuments of Departments.
5. All information is stored in the Document Nodes, so "Visibility"
and "Navigation Title" are  available when working with the document.

It also imposes additional concerns:
1. The tree of documents (N:Hierarchy) must be maintained for easy
transversal.  It should only contain the DocumentUniqueIDs.  Creating
sitetree.xml should access the document Nodes for the Visibility
property.  This allows creating menus based on other properties. 
Eventually someone will add individual document security, and menus
will be built to show only the documents allowed to each person (based
on their name and/or Groups).

2. What happens to orphans?  Subdocuments will not automatically be
deleted when the Document Node is deleted.  It would be easy to create
a view of documents that have ParentDocumentIDs that no longer exist. 
Or the Delete process could also delete all subdocuments recursively.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [RT] Workflow and publishing using JCR

Posted by Felix Röthenbacher <fe...@wyona.com>.
Andreas Hartmann wrote:
> Hi Lenya devs,
>
> I'm currently working on a draft of a "proper" JCR-based Lenya
> repository API. When it came to the notorious "area" concept, the
> following optiones appeared to be reasonable:
>
> 1) Use different subtrees in the same workspace for different areas.
>
> 2) Use different workspaces for different areas.
>
> 3) Use version history labels.
>
> ---
>
> Option (1) has the disadvantage that corresponding nodes in different
> areas have no implicit connection to each other. All areas have to be
> maintained "manually", without support from the JCR API.

I wonder if there is any good reason to maintain the correspondency
between nodes in different areas by hand than rather use the mechanisms
supported by JCR?

>
> ---
>
> Option (2) has the disadvantage that copying (cloning) nodes from one
> workspace to the other can't be done inside a session. Nevertheless,
> they can be bracketed in transactions. A major advantage of option (2)
> over option (1) is that correpsonding nodes in different workspaces
> share the same UUID and the same version history, which means there is
> an implicit connection. A node can be updated (merged) from its
> corresponding node in another workspace. You can think of workspaces
> as SVN branches.

As mentioned, a transaction can be used. One reason for updating
to Jetty Plus and to include JOTM was exactly with this usecase
in mind. One issue we should consider though is that transaction
support wasn't fully implemented in Jackrabbit six months ago
when I played around with it: the problem was that a transaction
could be set to ready-to-commit but it was commited in this phase
already, meaning a rollback was not possible anymore. This was
the status-quo six months ago and I don't know how far transaction
support goes these days in Jackrabbit.

>
> ---
>
> Option (3) is a totally different approach. Some introductionary points:
>
> - each versionable node has a history (version graph)
> - versions can have labels
> - labels can be moved from one version to another
>
> This means, publishing a node could mean to add the label "live" to
> the last checked-in version (and remove it from a potential previous
> version). Deactivating the node would mean to entirely remove the
> label "live" from the version history.

How is versioning of different areas handled? I think of a live
area which I can easily revert if something bad happend during
publishing. Same applies to the authoring area. I can't see
how it's accomplished to get a snapshot of both
live and authoring area with a certain time stamp.

For me, it's still option (2) which will fulfills best the requirements
I can see so far.

- Felix

>
> For option (3), Session.save() has no effect as well, but it can be
> executed in a transaction. This would allow to publish a large number
> of nodes with the possibility of rolling back the whole operation.
>
> The particularity of option (3) is that no copies are created, which
> means it's rather a snapshot of the version history of the site.
> You can think of it as an SVN tag. Live nodes can't be altered,
> only replaced with new versions.
>
> I'm not yet sure how the site structure would be handled in option (3).
>
> ---
>
> I'll think this over a little, comments are greatly appreciated.
>
> -- Andreas
>




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org