|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mmbase.remotepublishing.PublishManager
The primary functionality of the Publishmanager is to publish
nodes to the live / staging cloud which depends on the context in which this
class is being used. The problem with publishing is that nodes in different
contexts have different numbers. The mapping between node numbers in different
cloud contexts is maintained in the table remotenodes. This table
contains 4 important fields: sourcecloud, sourcenumber, destinationcloud and
destinationnumber. The source fields always keep track of where a node was
first produced. The destination indicates to what cloud the node was published.
The cloud fields keep a reference to one of the clouds stored in the
cloud table. The number fields are a reference to a node in one
of the clouds.
Example: if a node is published from the staging to the live context the sourcecloud
and sourcenumber in both contexts refer to the sourcenode in the staging context.
The sourcecloud field will contain different numbers for the records in the
table will have different id's in both clouds. The sourcenumber
field will be exact the same in both contexts. The same goes for the destination
fields with this difference that the destinationnumber field in both clouds will
refer to the number of the node in the live cloud.
The PublishManager distinguishes two different processes which are
a) publishing - which is the process of copying a node from cloud X to cloud Y and
b) importing - which is the process of copying a node from cloud Y to cloud X
| Method Summary | |
protected static org.mmbase.bridge.Node |
cloneNode(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
Clone a node to a cloud, including any fields without keeping administrative information |
protected static void |
cloneNodeField(org.mmbase.bridge.Node sourceNode,
org.mmbase.bridge.Node destinationNode,
org.mmbase.bridge.Field field)
cloneNodeField copies node fields from one node to an other |
static void |
deletePublishedNode(org.mmbase.bridge.Cloud localCloud,
int localNumber)
delete the remote instances of a node(with relations and relation information) |
static void |
deletePublishedNode(org.mmbase.bridge.Node localNode)
delete the remote instances of a node(with relations and relation information) |
static org.mmbase.bridge.Node |
getPublishedNode(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
Get the published nodes from a remote cloud. |
static org.mmbase.bridge.NodeList |
getPublishedNodes(org.mmbase.bridge.Cloud localCloud,
int localNumber)
Get the published nodes from all remote clouds |
static org.mmbase.bridge.NodeList |
getPublishedNodes(org.mmbase.bridge.Node localNode)
Get the published nodes from all remote clouds |
static org.mmbase.bridge.Node |
getPublishInfoNode(org.mmbase.bridge.Cloud localCloud,
int destinationNumber,
org.mmbase.bridge.Cloud destinationCloud)
|
static org.mmbase.bridge.Node |
getSourceNode(org.mmbase.bridge.Node localNode)
Get the source node of this localNode if this localNode is imported |
static boolean |
isImported(int localNumber,
org.mmbase.bridge.Cloud localCloud)
From the perspective of one cloud a node is said to be imported when the node number is available in the destinationnumber of the remotenodes table and the destinationcloud equals the cloud context (so if the context is staging the destinationcloud should refer the staging record in the cloud table) |
static boolean |
isImported(int localNumber,
org.mmbase.bridge.Cloud localCloud,
org.mmbase.bridge.Cloud remoteCloud)
Tests whether the node has been published from another cloud to this cloud |
static boolean |
isImported(org.mmbase.bridge.Node localNode)
From the perspective of one cloud a node is said to be imported when the node number is available in the destinationnumber of the remotenodes table and the destinationcloud equals the cloud context (so if the context is staging the destinationcloud should refer the staging record in the cloud table) |
static boolean |
isImported(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
Tests whether the node has been published from another cloud to this cloud |
static boolean |
isPublished(int localNumber,
org.mmbase.bridge.Cloud localCloud)
Test whether a node is published to one or more other clouds. |
static boolean |
isPublished(int localNumber,
org.mmbase.bridge.Cloud localCloud,
org.mmbase.bridge.Cloud remoteCloud)
Test whether a node is published to another cloud. |
static boolean |
isPublished(org.mmbase.bridge.Node localNode)
Test whether a node is published to one or more other clouds. |
static boolean |
isPublished(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
Test whether a node is published to another cloud. |
protected static boolean |
isRelation(org.mmbase.bridge.Node node)
quick test to see if node is a relation by testing fieldnames |
static org.mmbase.bridge.Node |
publishNode(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
Publish a node to a different cloud, keeping records This will also publish all relations inNode has with other published nodes |
static void |
unLinkNode(org.mmbase.bridge.Cloud sourceCloud,
org.mmbase.bridge.Cloud destinationCloud,
int sourceNumber,
int destinationNumber)
Remove the publish-info between a source node and a published version |
static void |
unLinkNode(org.mmbase.bridge.Node localNode)
Unlink node from all other nodes (means you can then edit/delete them) This method can also be used to republish the node from the remoteCloud to this localCloud if the localNode is deleted too. |
static void |
unLinkNode(org.mmbase.bridge.Node sourceNode,
org.mmbase.bridge.Node destinationNode)
Remove the publish-info between a source node and a published version |
static void |
updatePublishedNodes(org.mmbase.bridge.Node localNode)
syncronize all nodes that are published from this one |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
protected static boolean isRelation(org.mmbase.bridge.Node node)
public static org.mmbase.bridge.Node publishNode(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
throws PublishException
localNode - the node to be publishedremoteCloud - the external cloud
PublishException
protected static org.mmbase.bridge.Node cloneNode(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
localNode - the node to cloneremoteCloud - the cloud to clone the node to
protected static void cloneNodeField(org.mmbase.bridge.Node sourceNode,
org.mmbase.bridge.Node destinationNode,
org.mmbase.bridge.Field field)
sourceNode - the source nodedestinationNode - destination nodefield - the field to clonepublic static boolean isPublished(org.mmbase.bridge.Node localNode)
localNode - The node to be checked
true if the node has been published to the other cloud
public static boolean isPublished(int localNumber,
org.mmbase.bridge.Cloud localCloud)
localNumber - the number of the nodelocalCloud - the cloud from which the node has been published
true if the node has been published to the other cloud
public static boolean isPublished(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
localNode - the node to testremoteCloud - the cloud to which the node is published
true if node has been published to cloud
public static boolean isPublished(int localNumber,
org.mmbase.bridge.Cloud localCloud,
org.mmbase.bridge.Cloud remoteCloud)
localNumber - the node numberlocalCloud - the cloud from which the node was publishedremoteCloud - the cloud to which the node is published
true if node has been published to cloudpublic static boolean isImported(org.mmbase.bridge.Node localNode)
localNode - Node to test
public static boolean isImported(int localNumber,
org.mmbase.bridge.Cloud localCloud)
localNumber - Node to testlocalCloud - the Cloud to which the node might be published
public static boolean isImported(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
localNode - the node to testremoteCloud - the Cloud from which the node might be published
public static boolean isImported(int localNumber,
org.mmbase.bridge.Cloud localCloud,
org.mmbase.bridge.Cloud remoteCloud)
localNumber - the node to testlocalCloud - the Cloud to which the node might be publishedremoteCloud - the Cloud from which the node might be published
public static void unLinkNode(org.mmbase.bridge.Node localNode)
localNode - Node from which to remove the publish info
public static void unLinkNode(org.mmbase.bridge.Node sourceNode,
org.mmbase.bridge.Node destinationNode)
sourceNode - the original nodedestinationNode - the published copy
public static void unLinkNode(org.mmbase.bridge.Cloud sourceCloud,
org.mmbase.bridge.Cloud destinationCloud,
int sourceNumber,
int destinationNumber)
sourceCloud - destinationCloud - sourceNumber - destinationNumber -
public static org.mmbase.bridge.Node getPublishedNode(org.mmbase.bridge.Node localNode,
org.mmbase.bridge.Cloud remoteCloud)
localNode - the node that has been publishedremoteCloud - the remote cloud
public static org.mmbase.bridge.NodeList getPublishedNodes(org.mmbase.bridge.Node localNode)
localNode - The node thas has been published
public static org.mmbase.bridge.NodeList getPublishedNodes(org.mmbase.bridge.Cloud localCloud,
int localNumber)
localCloud - The source cloudlocalNumber - The node number that has been published
public static org.mmbase.bridge.Node getSourceNode(org.mmbase.bridge.Node localNode)
localNode - a published node
public static org.mmbase.bridge.Node getPublishInfoNode(org.mmbase.bridge.Cloud localCloud,
int destinationNumber,
org.mmbase.bridge.Cloud destinationCloud)
localCloud - destinationNumber - destinationCloud -
public static void updatePublishedNodes(org.mmbase.bridge.Node localNode)
throws PublishException
localNode - the source node
NOTE for WEB-IN-A-BOX developers:
Use of this method is NOT RECOMMENDED as it encourages inplace modifications
to nodes and that allows editing of published information
** use an editNode() saveNode() combination if workflow content **
PublishExceptionpublic static void deletePublishedNode(org.mmbase.bridge.Node localNode)
localNode - the local node to remove
public static void deletePublishedNode(org.mmbase.bridge.Cloud localCloud,
int localNumber)
localCloud - localNumber -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||