Author: sshyrkov
Date: Tue Oct 30 10:06:15 2007
New Revision: 18999
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18999&repname=
=3Djahia
Log:
[trunk r18986] Correctly set the EntryLoadRequest "withMarkForDeletion" fla=
g in order to see the marked for deletion content objects in EDIT mode
Modified:
branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/data/containe=
rs/JahiaContainerSet.java
branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/hibernate/man=
ager/JahiaContainerManager.java
branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/params/Proces=
singContext.java
branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/services/cont=
ainers/ContainerListFactoryProxy.java
Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/data/co=
ntainers/JahiaContainerSet.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/src/java/org/jahia/data/containers/JahiaContainerSet.java=
&rev=3D18999&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/data/containe=
rs/JahiaContainerSet.java (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/data/containe=
rs/JahiaContainerSet.java Tue Oct 30 10:06:15 2007
@@ -1206,13 +1206,16 @@
EntryLoadRequest loadRequest =3D (EntryLoadRequest=
)ctnLoadRequest.clone();
if (loadRequest.isVersioned()) {
if (this.jData.getProcessingContext().showRevi=
sionDiff()) {
- // @todo :
- // not fully handle so we dont load delete=
d yet
+ // todo not fully handle so we dont load d=
eleted yet
loadRequest.setWithDeleted(true);
loadRequest.setWithMarkedForDeletion(true);
} else {
loadRequest.setWithDeleted(false);
- loadRequest.setWithMarkedForDeletion(false=
);
+ if (jData.getProcessingContext().getOpMode=
().equals(ProcessingContext.EDIT)) {
+ loadRequest.setWithMarkedForDeletion(t=
rue);
+ } else {
+ loadRequest.setWithMarkedForDeletion(f=
alse);
+ }
}
}
try {
@@ -1299,7 +1302,11 @@
loadRequest.setWithMarkedForDeletion(true);
} else {
loadRequest.setWithDeleted(false);
- loadRequest.setWithMarkedForDeletion(false);
+ if (jData.getProcessingContext().getOpMode().equal=
s(ProcessingContext.EDIT)) {
+ loadRequest.setWithMarkedForDeletion(true);
+ } else {
+ loadRequest.setWithMarkedForDeletion(false);
+ }
}
ContainerFactory.getInstance()
.fullyLoadContainerList(aList, LoadFlags.ALL,
@@ -1415,7 +1422,11 @@
loadRequest.setWithMarkedForDeletion(true);
} else {
loadRequest.setWithDeleted(false);
- loadRequest.setWithMarkedForDeletion(false);
+ if (jData.getProcessingContext().getOpMode().equal=
s(ProcessingContext.EDIT)) {
+ loadRequest.setWithMarkedForDeletion(true);
+ } else {
+ loadRequest.setWithMarkedForDeletion(false);
+ }
}
=
if (theContainerList =3D=3D null) {
Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/hiberna=
te/manager/JahiaContainerManager.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/src/java/org/jahia/hibernate/manager/JahiaContainerManage=
r.java&rev=3D18999&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/hibernate/man=
ager/JahiaContainerManager.java (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/hibernate/man=
ager/JahiaContainerManager.java Tue Oct 30 10:06:15 2007
@@ -675,7 +675,7 @@
if ( request !=3D null ){
staged =3D new EntryLoadRequest(0,diffVersionID,re=
quest.getLocales());
staged.setWithDeleted(false);
- staged.setWithMarkedForDeletion(false);
+ //staged.setWithMarkedForDeletion(false);
}
}
JahiaContainer container =3D this.loadContainer(containerI=
d,staged,false);
@@ -693,7 +693,7 @@
if ( request !=3D null ){
staged =3D new EntryLoadRequest(0,diffVersionID,re=
quest.getLocales());
staged.setWithDeleted(false);
- staged.setWithMarkedForDeletion(false);
+ // staged.setWithMarkedForDeletion(false);
}
}
JahiaContainer container =3D this.loadContainer(containerI=
d,staged,false);
Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/params/=
ProcessingContext.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/src/java/org/jahia/params/ProcessingContext.java&rev=3D18=
999&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/params/Proces=
singContext.java (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/params/Proces=
singContext.java Tue Oct 30 10:06:15 2007
@@ -784,12 +784,11 @@
EntryLoadRequest.ACTIVE_WORKFLOW_STATE, 0, getLocales());
// compute version info
if (this.getSiteID() !=3D -1) {
- if (((EDIT.equals(getOpMode())) || (PREVIEW.equals(getOpMode()=
)) || (COMPARE
- .equals(getOpMode())))
- && (REGISTRY.getJahiaVersionService().isStagingEnabled=
(this
- .getSiteID()))) {
+ if (((EDIT.equals(getOpMode())) || (PREVIEW.equals(getOpMode()=
)) || (COMPARE.equals(getOpMode())))
+ && (REGISTRY.getJahiaVersionService().isStagingEnabled=
(this.getSiteID()))) {
newLoadRequest =3D new EntryLoadRequest(
- EntryLoadRequest.STAGING_WORKFLOW_STATE, 0,
+ EntryLoadRequest.STAGING_WORKFLOW_STATE,
+ 0,
getLocales());
// this.cacheStatus =3D ProcessingContext.CACHE_OFF; deact=
ivated because
// we can't see a reason to have this here.
@@ -1097,12 +1096,10 @@
// reset the locales
setLocaleList(null);
getSessionState().setAttribute(SESSION_LOCALE, locale);
- setEntryLoadRequest(new EntryLoadRequest(getEntryLoadRequest()
- .getWorkflowState(), getEntryLoadRequest().getVersionID(),
- getLocales()));
+ setEntryLoadRequest(new EntryLoadRequest(getEntryLoadRequest().get=
WorkflowState(), getEntryLoadRequest().getVersionID(),
+ getLocales(), getEntryLoadRequest().isWithMarkedForDeletio=
n()));
resetSubstituteEntryLoadRequest();
- setParameter(ProcessingContext.LANGUAGE_CODE, this.getCurrentLocal=
e()
- .toString());
+ setParameter(ProcessingContext.LANGUAGE_CODE, this.getCurrentLocal=
e().toString());
resolveJahiaPage();
}
=
@@ -3136,23 +3133,20 @@
=
final int deleteVersionID =3D getContentPage().getDeleteVersio=
nID();
if (deleteVersionID !=3D -1) {
-
// page has been recently deleted, let's check if we can
// display it or not.
-
if (NORMAL.equals(getOpMode())) {
// this is the case of try to access a deleted page in=
NORMAL
// mode which is not allowed.
throw new JahiaPageNotFoundException(pageID);
+
} else if (CORE_ENGINE_NAME.equals(this.getEngine())
&& EDIT.equals(getOpMode())
- && (!getContentPage().hasStagingEntries() || getCo=
ntentPage()
- .isMarkedForDelete())) {
- // try to access a deleted page or yet market for dele=
te in EDIT
- // mode is not allowed.
+ && (!getContentPage().hasStagingEntries() /* || ge=
tContentPage().isMarkedForDelete() */ )) {
+ // try to access a deleted page in EDIT mode is not al=
lowed.
throw new JahiaPageNotFoundException(pageID);
- } else if ((COMPARE.equals(getOpMode()) || (PREVIEW
- .equals(getOpMode())))
+
+ } else if ((COMPARE.equals(getOpMode()) || (PREVIEW.equals=
(getOpMode())))
&& (!getContentPage().checkWriteAccess(getTheUser(=
)))) {
// we can view a deleted page in compare and preview m=
ode
// only if we can do edition operations on the page.
@@ -3160,12 +3154,15 @@
}
}
=
- // if (CORE_ENGINE_NAME.equals(getEngine()) &&
- // EDIT.equals(getOpMode()) &&
- // getContentPage().isMarkedForDelete()) {
- // // try to access a marked for delete in EDIT mode is not al=
lowed.
- // throw new JahiaPageNotFoundException(pageID);
- // }
+ if (CORE_ENGINE_NAME.equals(getEngine()) && EDIT.equals(getOpM=
ode()) &&
+ ! getEntryLoadRequest().isWithMarkedForDeletion()) {
+ // try to access a marked for delete in EDIT mode is not a=
llowed.
+ setEntryLoadRequest(new EntryLoadRequest(
+ EntryLoadRequest.STAGING_WORKFLOW_STATE, 0,
+ getLocales(), true));
+ // reset substitute entry load request
+ resetSubstituteEntryLoadRequest();
+ }
=
// if the page is not found, throw the associated exception
if (NORMAL.equals(getOpMode())
@@ -3186,11 +3183,9 @@
=
if ((getContentPage() =3D=3D null)
|| ((getOpMode().equals(NORMAL) || getOpMode().equals(COMP=
ARE))
- && getEntryLoadRequest().isCurrent() && !getConten=
tPage()
- .hasActiveEntries())
+ && getEntryLoadRequest().isCurrent() && !getConten=
tPage().hasActiveEntries())
|| ((getOpMode().equals(NORMAL) || getOpMode().equals(COMP=
ARE))
- && getEntryLoadRequest().isCurrent() && getContent=
Page()
- .getTitle(getEntryLoadRequest()) =3D=3D null)) {
+ && getEntryLoadRequest().isCurrent() && getContent=
Page().getTitle(getEntryLoadRequest()) =3D=3D null)) {
throw new JahiaPageNotFoundException(pageID);
}
// Ensure if the requested page is a page of the current site
Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/service=
s/containers/ContainerListFactoryProxy.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/src/java/org/jahia/services/containers/ContainerListFacto=
ryProxy.java&rev=3D18999&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/services/cont=
ainers/ContainerListFactoryProxy.java (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/services/cont=
ainers/ContainerListFactoryProxy.java Tue Oct 30 10:06:15 2007
@@ -103,8 +103,12 @@
currentLoadRequest.setWithMarkedForDeletion(true);
} else {
currentLoadRequest.setWithDeleted(false);
- currentLoadRequest.setWithMarkedForDeletion(false);
- } =
+ if (jParams.getOpMode().equals(ProcessingContext.EDIT)) {
+ currentLoadRequest.setWithMarkedForDeletion(true);
+ } else {
+ currentLoadRequest.setWithMarkedForDeletion(false);
+ }
+ }
ContainerFactory.getInstance()
.fullyLoadContainerList(containerList,
loadFlag, jParams, currentLoadRequest, cachedFieldsFromCon=
tainers,
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list