shuber 2004/09/24 18:29:23 CEST
Modified files: (Branch: JAHIA-4-0-BRANCH)
metadata/jbproject/jahia Jahia Libs.library
src/java/org/jahia/services/fields ContentPageField.java
src/java/org/jahia/services/version
UndoStagingContentTreeVisitor.java
Log:
Modified warnings in activation to be result objects instead of Strings so that we
generate the proper warning displays in the workflow page, showing links to edition
popups.
Revision Changes Path
No
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/.diff?r1=.-1&r2=No&f=h
No
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/.diff?r1=.-1&r2=No&f=h
1.74.4.3 +71 -21 jahia/src/java/org/jahia/services/fields/ContentPageField.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/java/org/jahia/services/fields/ContentPageField.java.diff?r1=1.74.4.2&r2=1.74.4.3&f=h
1.5.2.3 +1 -1
jahia/src/java/org/jahia/services/version/UndoStagingContentTreeVisitor.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/java/org/jahia/services/version/UndoStagingContentTreeVisitor.java.diff?r1=1.5.2.2&r2=1.5.2.3&f=h
Index: ContentPageField.java
===================================================================
RCS file:
/home/cvs/repository/jahia/src/java/org/jahia/services/fields/Attic/ContentPageField.java,v
retrieving revision 1.74.4.2
retrieving revision 1.74.4.3
diff -u -r1.74.4.2 -r1.74.4.3
--- ContentPageField.java 23 Sep 2004 16:31:23 -0000 1.74.4.2
+++ ContentPageField.java 24 Sep 2004 16:29:23 -0000 1.74.4.3
@@ -285,17 +285,34 @@
if (
!stateModifContext.getStartObject().equals(contentPage.getObjectKey()) ){
activationTestResults.setStatus(ActivationTestResults.
FAILED_OPERATION_STATUS);
- activationTestResults.appendWarning("Field " + getID() +
- " reffered to a moved page");
+ try {
+ IsValidForActivationResults activationResults = new
+ IsValidForActivationResults ( ContentFieldKey.FIELD_TYPE,
+ getID (),
+ jParams.getLocale ().toString
(),
+ "Field " + getID() +
+ " referred to a moved page");
+ activationTestResults.appendWarning(activationResults);
+ } catch (ClassNotFoundException cnfe) {
+ logger.error(cnfe);
+ }
return activationTestResults;
}
}
if (contentPage == null) {
// this could happen if the database had a jahia_link_only value
activationTestResults.setStatus
(ActivationTestResults.PARTIAL_OPERATION_STATUS);
- activationTestResults.appendWarning (
- "Field " + getID () + " value is not correctly set. Current
value=" + getValue (
- jParams));
+ try {
+ IsValidForActivationResults activationResults = new
+ IsValidForActivationResults (ContentFieldKey.FIELD_TYPE,
+ getID (),
+ jParams.getLocale ().toString (),
+ "Field " + getID () + " value is
not set. Current value=" +
+ getValue (jParams));
+ activationTestResults.appendWarning (activationResults);
+ } catch (ClassNotFoundException cnfe) {
+ logger.error(cnfe);
+ }
return activationTestResults;
}
try {
@@ -313,7 +330,16 @@
if (thePage == null) {
activationTestResults.setStatus
(ActivationTestResults.FAILED_OPERATION_STATUS);
- activationTestResults.appendWarning ("Could not lookup page " +
pageID + " !");
+ try {
+ IsValidForActivationResults activationResults = new
+ IsValidForActivationResults (ContentFieldKey.FIELD_TYPE,
+ getID (),
+ jParams.getLocale ().toString
(),
+ "Could not lookup page " +
pageID + " !");
+ activationTestResults.appendWarning (activationResults);
+ } catch (ClassNotFoundException cnfe) {
+ logger.error(cnfe);
+ }
return activationTestResults;
}
@@ -329,10 +355,19 @@
// this page is either active or deleted
activationTestResults.setStatus(ActivationTestResults.COMPLETED_OPERATION_STATUS);
} else {
- activationTestResults.setStatus (
- ActivationTestResults.FAILED_OPERATION_STATUS);
- activationTestResults.appendWarning (
- "Page " + pageID + " only has staged entries
and recursive activation is not activated.");
+ activationTestResults.setStatus
(ActivationTestResults.FAILED_OPERATION_STATUS);
+ try {
+ IsValidForActivationResults activationResults = new
+ IsValidForActivationResults
(ContentFieldKey.FIELD_TYPE,
+ getID (),
+ jParams.getLocale
().toString (),
+ "Page " +
+ pageID +
+ " exists only in
staging and needs to be validated.");
+ activationTestResults.appendWarning
(activationResults);
+ } catch (ClassNotFoundException cnfe) {
+ logger.error(cnfe);
+ }
}
break;
case JahiaPage.TYPE_LINK:
@@ -352,22 +387,37 @@
ActivationTestResults.
COMPLETED_OPERATION_STATUS);
} else {
- activationTestResults.setStatus (
- ActivationTestResults.
- PARTIAL_OPERATION_STATUS);
- activationTestResults.appendWarning (
- "Page " +
- pageID +
- " only has staged entries and recursive
activation is not activated.");
+ activationTestResults.setStatus
(ActivationTestResults.PARTIAL_OPERATION_STATUS);
+ try {
+ IsValidForActivationResults activationResults =
new
+ IsValidForActivationResults (
ContentFieldKey.FIELD_TYPE,
+ getID (),
+
jParams.getLocale ().toString (),
+ "Page " +
+ pageID +
+ " exists only
in staging and needs to be validated.");
+ activationTestResults.appendWarning
(activationResults);
+ } catch (ClassNotFoundException cnfe) {
+ logger.error(cnfe);
+ }
}
} else {
activationTestResults.setStatus (
ActivationTestResults.
PARTIAL_OPERATION_STATUS);
- activationTestResults.appendWarning ("Page " +
- pageID +
- " has a link to a page that couldn't be found :
" +
- thePage.getPageLinkID () + " !");
+ try {
+ IsValidForActivationResults activationResults = new
+ IsValidForActivationResults (
ContentFieldKey.FIELD_TYPE,
+ getID (),
+ jParams.getLocale
().toString (),
+ "Page " +
+ pageID +
+ " has a link to a
page that couldn't be found : " +
+
thePage.getPageLinkID () + " !");
+ activationTestResults.appendWarning (activationResults);
+ } catch (ClassNotFoundException cnfe) {
+ logger.error(cnfe);
+ }
}
break;
Index: UndoStagingContentTreeVisitor.java
===================================================================
RCS file:
/home/cvs/repository/jahia/src/java/org/jahia/services/version/Attic/UndoStagingContentTreeVisitor.java,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -r1.5.2.2 -r1.5.2.3
--- UndoStagingContentTreeVisitor.java 23 Sep 2004 16:31:26 -0000 1.5.2.2
+++ UndoStagingContentTreeVisitor.java 24 Sep 2004 16:29:23 -0000 1.5.2.3
@@ -45,7 +45,7 @@
private ParamBean jParams = null;
// The id of the start page ( which is not the root content object, but the
- // page for which, we can apply undo staging on reffered parent page fields.
+ // page for which, we can apply undo staging on referred parent page fields.
// We need this information to handle page move issue.
private int startPageId = -1;