tdraier     2005/11/15 20:04:20 CET

  Modified files:
    core/src/java/org/jahia/services/fields 
                                            ContentBigTextField.java 
                                            ContentField.java 
  Log:
  fixed activation when using existing versionid (especially for no workflow) - 
just delete existing version and replace by new one
  
  Revision  Changes    Path
  1.12      +5 -2      
jahia/core/src/java/org/jahia/services/fields/ContentBigTextField.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/fields/ContentBigTextField.java.diff?r1=1.11&r2=1.12&f=h
  1.39      +4 -13     
jahia/core/src/java/org/jahia/services/fields/ContentField.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/fields/ContentField.java.diff?r1=1.38&r2=1.39&f=h
  
  
  
  Index: ContentBigTextField.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/java/org/jahia/services/fields/ContentBigTextField.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ContentBigTextField.java  8 Aug 2005 14:46:18 -0000       1.11
  +++ ContentBigTextField.java  15 Nov 2005 19:04:20 -0000      1.12
  @@ -251,8 +251,11 @@
                   languageCodes + ", lang States = " + getLanguagesStates());
           
           final ActivationTestResults results = new ActivationTestResults();
  -        final Locale bigTextLocale = new Locale 
((String)getLanguagesStates().keySet().
  -                iterator().next());
  +        Iterator iterator = getLanguagesStates().keySet().iterator();
  +        if (!iterator.hasNext()) {
  +            return results;
  +        }
  +        final Locale bigTextLocale = new Locale ((String)iterator.next());
   
           final ArrayList currentLocales = jParams.getLocales();
           final Locale currentLocale = jParams.getLocale();
  
  
  
  Index: ContentField.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/java/org/jahia/services/fields/ContentField.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- ContentField.java 10 Nov 2005 10:31:36 -0000      1.38
  +++ ContentField.java 15 Nov 2005 19:04:20 -0000      1.39
  @@ -490,19 +490,10 @@
           ActivationTestResults activationResults = new ActivationTestResults 
();
   
           // check that we are not going to create a new version entry that 
already exist!
  -        int activeVersionId = this.getActiveVersionID();
  +
           int deletedVersionId = this.getDeleteVersionID();
  -        if ( activeVersionId == newVersionID
  -             || deletedVersionId == newVersionID ){
  -            // has been already activated! Do not activate again
  -            // because we will create same save version date ( a corrupted 
situation )
  -
  -            // If this case happens, this means the activation process is 
running twice
  -            // on content already activated with same activation time and 
this case
  -            // should'nt happen or catched before reaching this point.
  -            // FIXME : This issue was bring out with Document Listing 
template and LastPublishingDate metadata field
  -            //         When the Doc Listing page is activated before its 
childs Docs page, resulting in
  -            //         incomplete Doc container activation ( 
LastPublishingDate is going to be activated twice at same activation time )
  +        if ( deletedVersionId == newVersionID ){
  +            // has been already deleted! Do not activate deletion again
               activationResults.appendWarning("Field " + getID() +
                       " is already activated with newVersionID=" + 
newVersionID);
               return activationResults;
  @@ -574,7 +565,7 @@
                       if (actEntryState.getLanguageCode ().equals (
                               staEntryState.getLanguageCode ())) {
                           // ok appollo, we catched an active entry here! we 
handle this..
  -                        if (needBackup && versioningEnabled) {
  +                        if (needBackup && versioningEnabled && newVersionID 
!= actEntryState.getVersionID()) {
                               try {
                                   ContentObjectEntryState backupEntryState = 
fieldsDataManager.backupField(this,
                                                                                
                           actEntryState); // we backup the active version
  

Reply via email to