Author: bpapez
Date: Mon Jul  2 16:31:33 2007
New Revision: 17861

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17861&repname=
=3Djahia
Log:
minor refactorings

Modified:
    trunk/core/src/java/org/jahia/data/fields/JahiaPageField.java

Modified: trunk/core/src/java/org/jahia/data/fields/JahiaPageField.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/data/fields/JahiaPageField.java&rev=3D17861&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
--- trunk/core/src/java/org/jahia/data/fields/JahiaPageField.java (original)
+++ trunk/core/src/java/org/jahia/data/fields/JahiaPageField.java Mon Jul  =
2 16:31:33 2007
@@ -29,7 +29,6 @@
 import org.jahia.exceptions.JahiaException;
 import org.jahia.exceptions.JahiaPageNotFoundException;
 import org.jahia.params.ProcessingContext;
-import org.jahia.params.ParamBean;
 import org.jahia.registries.ServicesRegistry;
 import org.jahia.services.fields.ContentField;
 import org.jahia.services.fields.ContentPageField;
@@ -42,7 +41,6 @@
 import org.jahia.services.workflow.WorkflowService;
 import org.jahia.settings.SettingsBean;
 import org.jahia.utils.JahiaConsole;
-import org.jahia.resourcebundle.JahiaResourceBundle;
 =

 import java.util.Properties;
 import java.util.Set;
@@ -181,7 +179,7 @@
 =

                                     if (def !=3D null) {
                                         //if ((def !=3D null) && (def.isVi=
sible())) {
-                                        this.setValue(thePage.getUrl(jPara=
ms));
+                                        this.setValue(thePage.getURL(jPara=
ms));
                                     } else {
                                         // FIXME : NK
                                         // If a direct page has its templa=
te deleted,
@@ -194,7 +192,7 @@
                                         }*/
 =

                                         // set the url to the page , but w=
e sure have a page template not found when accessing it
-                                        this.setValue(thePage.getUrl(jPara=
ms));
+                                        this.setValue(thePage.getURL(jPara=
ms));
 =

                                     }
                                     if ( ProcessingContext.COMPARE.equals(=
jParams.getOpMode()) ){
@@ -302,7 +300,6 @@
         } catch (NumberFormatException e) {
         }
 =

-        boolean pageUpdated =3D false;
         String tmpVal =3D this.getValue();
         if (!tmpVal.equals("<empty>")) {
             int pageID =3D -1;
@@ -317,7 +314,6 @@
                 if (thePage !=3D null) {
 =

                     thePage.commitChanges(true, jParams.getUser());
-                    pageUpdated =3D true;
                     ContentPage contentPage =3D ContentPage.getPage(thePag=
e.getID());
                     JahiaEvent objectCreatedEvent =3D new JahiaEvent(this,=
 jParams, contentPage);
                     ServicesRegistry.getInstance().getJahiaEventService()
@@ -327,14 +323,10 @@
                     //        getJahiaPageService().savePageInfo( thePage =
);
 =

                     this.setValue(Integer.toString(thePage.getID()));
-                    tmpVal =3D Integer.toString(thePage.getID()); // Very =
useful !???
                 } else {
                     this.setValue("");
-                    tmpVal =3D "<No Page>"; // Very useful !???
                 }
             }
-        } else {
-            tmpVal =3D "<No Page>"; // Very useful !???
         }
         int pageIDToSet;
         try {
@@ -454,13 +446,6 @@
             clonedField.setObject(this.getObject());
         }
 =

-        //toDebug("cloneField(): value =3D "+this.getValue());
-        if (clonedField =3D=3D null) {
-            throw new JahiaException("Could not clone field.",
-                    "Could not instanciate a new JahiaField object.",
-                    JahiaException.PAGE_ERROR, JahiaException.CRITICAL_SEV=
ERITY);
-        }
-
         clonedField.setRawValue(this.getRawValue());
         clonedField.setProperties((Properties) (this.getProperties()).clon=
e());
         clonedField.setForComparisonOnly(this.isForComparisonOnly());
@@ -480,7 +465,7 @@
                 new Integer(aclID),
                 new Integer(versionID),
                 new Integer(workflowState),
-                new String(getLanguageCode()));
+                getLanguageCode());
         pf.setObject(objItem);
         pf.setForComparisonOnly(this.isForComparisonOnly());
         return pf;

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to