| Chunk |
|---|
| Conflicting content |
|---|
list = remote.getChildren(root.getRef());
assertEquals(1, list.size());
<<<<<<< HEAD
// create folder to hold proxies
DocumentModel folder = new DocumentModelImpl(root.getPathAsString(),
"folder", "Folder");
folder = remote.createDocument(folder);
remote.save();
folder = remote.getDocument(folder.getRef());
// publishDocument API
proxy = remote.publishDocument(doc, root);
remote.save(); // needed for publish-by-copy to work
assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
assertTrue(proxy.isProxy());
// republish a proxy
DocumentModel proxy2 = remote.publishDocument(proxy, folder);
remote.save();
assertTrue(proxy2.isProxy());
assertEquals(1, remote.getChildrenRefs(folder.getRef(), null).size());
assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
// a second time to check overwrite
// XXX this test fails for mysterious reasons (hasNode doesn't detect
// the child node that was added by the first copy -- XASession pb?)
// remote.publishDocument(proxy, folder);
// remote.save();
// assertEquals(1, remote.getChildrenRefs(folder.getRef(),
// null).size());
// assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
// and without overwrite
remote.publishDocument(proxy, folder, false);
remote.save();
assertEquals(2, remote.getChildrenRefs(folder.getRef(), null).size());
assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
=======
>>>>>>> d7caa73e023f1d840448fc42986ee81c5f64ea67
}
} |
| Solution content |
|---|
list = remote.getChildren(root.getRef());
assertEquals(1, list.size());
// create folder to hold proxies
DocumentModel folder = new DocumentModelImpl(root.getPathAsString(),
"folder", "Folder");
folder = remote.createDocument(folder);
remote.save();
folder = remote.getDocument(folder.getRef());
// publishDocument API
proxy = remote.publishDocument(doc, root);
remote.save(); // needed for publish-by-copy to work
assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
assertTrue(proxy.isProxy());
// republish a proxy
DocumentModel proxy2 = remote.publishDocument(proxy, folder);
remote.save();
assertTrue(proxy2.isProxy());
assertEquals(1, remote.getChildrenRefs(folder.getRef(), null).size());
assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
// a second time to check overwrite
// XXX this test fails for mysterious reasons (hasNode doesn't detect
// the child node that was added by the first copy -- XASession pb?)
// remote.publishDocument(proxy, folder);
// remote.save();
// assertEquals(1, remote.getChildrenRefs(folder.getRef(),
// null).size());
// assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
// and without overwrite
remote.publishDocument(proxy, folder, false);
remote.save();
assertEquals(2, remote.getChildrenRefs(folder.getRef(), null).size());
assertEquals(3, remote.getChildrenRefs(root.getRef(), null).size());
}
} |
| File |
|---|
| TestLocalAPI.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Comment |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}
=======
/*
DocumentModel section, boolean overwriteExistingProxy)
throws ClientException {
<<<<<<< HEAD
DocumentRef docRef = docToPublish.getRef();
DocumentRef sectionRef = section.getRef();
if (docToPublish.isProxy()) {
try {
Document doc = resolveReference(docRef);
Document sec = resolveReference(sectionRef);
checkPermission(doc, READ);
checkPermission(sec, ADD_CHILDREN);
if (overwriteExistingProxy) {
removeExistingProxies(doc, sec);
}
// publishing a proxy is just a copy
// TODO copy also copies security. just recreate a proxy
DocumentModel newDocument = copy(docRef, sectionRef,
docToPublish.getName());
Map |
| Solution content |
|---|
try {
DocumentModel section, boolean overwriteExistingProxy)
throws ClientException {
DocumentRef docRef = docToPublish.getRef();
DocumentRef sectionRef = section.getRef();
if (docToPublish.isProxy()) {
Document doc = resolveReference(docRef);
Document sec = resolveReference(sectionRef);
checkPermission(doc, READ);
checkPermission(sec, ADD_CHILDREN);
if (overwriteExistingProxy) {
removeExistingProxies(doc, sec);
}
// publishing a proxy is just a copy
// TODO copy also copies security. just recreate a proxy
DocumentModel newDocument = copy(docRef, sectionRef,
docToPublish.getName());
Map |
| File |
|---|
| AbstractSession.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method invocation |
| Return statement |
| Try statement |
| Variable |