So, can I replace:
---------------------8<-----------------------8<------------------
public static synchronized ContentBooleanField
createBoolean ( int siteID,
int pageID,
int containerID,
int fieldDefID,
int parentAclID, int aclID,
boolean value,
ParamBean jParams)
throws JahiaException
{
ContentBooleanField result =
(ContentBooleanField)
ContentField.createField( siteID, pageID, containerID,
fieldDefID,
ContentFieldTypes.BOOLEAN,
ConnectionTypes.LOCAL, parentAclID,
aclID);
---------------------8<-----------------------8<------------------
EntrySaveRequest saveRequest =
new EntrySaveRequest( jParams.getUser(),
jParams.getLocale().toString());
---------------------8<-----------------------8<------------------
with:
---------------------8<-----------------------8<------------------
EntrySaveRequest saveRequest =
new EntrySaveRequest( jParams.getUser(),
"shared");
---------------------8<-----------------------8<------------------
result.setValue(value, saveRequest);
return result;
}
---------------------8<-----------------------8<------------------
?
Thanks,
Predrag
Le mardi 12 Octobre 2004 15:04, Serge Huber a �crit :
> Let's try that again... It seems that the field value should be set
> using the shared language, but in the create method it is done using the
> current language, which is not correct.
>
> Regards,
> Serge Huber.
>
> Serge Huber wrote:
> > I think this is a bug, it seems that boolean's field value is created
> > using the current language, but the field value is set using a language.
> >
> > Regards,
> > Serge Huber.
> >
> > Predrag Viceic wrote:
> >> Hi,
> >>
> >> I have the problem with automated generation of ContentBooleanField.
> >> The code that works perfectly for SmallText:
> >>
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >> ContentSmallTextField
> >> threadDescriptionField=ContentSmallTextField.createSmallText(
> >> siteID,
> >> newPage.getID(),
> >> threadDataHolderC.getID(), //container Id
> >> threadDescriptionFieldDefinition.getID(),
> >> newPageField.getPage(jData.params()).getAclID(),
> >> 0,
> >> newThreadDescription,
> >> jData.params());
> >>
> >> StateModificationContext smc6=new
> >> StateModificationContext(
> >> new ContentFieldKey(threadDescriptionField.getID()),
> >> languageCodes,
> >> true);
> >>
> >> threadDescriptionField.activate(languageCodes,
> >> 0,
> >> jData.params(),
> >> smc6);
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >>
> >> doesn't work for Boolean:
> >>
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >> ContentBooleanField
> >> threadUseValidationField=ContentBooleanField.createBoolean(
> >> siteID,
> >> newPage.getID(),
> >> threadDataHolderC.getID(), //container Id
> >> threadUseValidationFieldDefinition.getID(),
> >> newPageField.getPage(jData.params()).getAclID(),
> >> 0,
> >> false,
> >> jData.params());
> >>
> >>
> >>
> >>
> >> StateModificationContext smc7=new
> >> StateModificationContext(
> >> new ContentFieldKey(threadUseValidationField.getID()),
> >> languageCodes,
> >> true);
> >>
> >> threadUseValidationField.activate(languageCodes,
> >> 0,
> >> jData.params(),
> >> smc7);
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >>
> >> In fact, Jahia complains about :
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >> org.jahia.exceptions.JahiaException:
> >> Entry [ENTRY:workFlowState=2, versionID=0, languageCode=shared] not
> >> found for field 59831 using request : [SELECT value_jahia_fields_data
> >> FROM jahia_fields_data WHERE id_jahia_fields_data=59831 AND
> >> workflow_state>1 AND version_id=0 AND language_code='shared'], Entry
> >> [ENTRY:workFlowState=2, versionID=0, languageCode=shared] not found
> >> for field 59831
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >>
> >> So, I have checked, and in the dbthe field language_code is "fr". My
> >> languageCodes are defined as:
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >> HashSet languageCodes=new HashSet();
> >> languageCodes.add("en");
> >> languageCodes.add("fr");
> >> languageCodes.add("shared");
> >>
> >> ----------------8<-------------------------8<---------------------------
> >>--
> >>
> >>
> >> I have compared the code for methods
> >> ContentSmallTextField.createSmallText() and
> >> ContentBooleanField.createBoolean() and they are identical (ok,
> >> equivalent..)..
> >>
> >> Any help?
> >>
> >> Regards,
> >> Predrag Viceic