Skip to content

Instantly share code, notes, and snippets.

@ivanteoh
Created July 8, 2013 01:10
Show Gist options
  • Save ivanteoh/5945586 to your computer and use it in GitHub Desktop.
Save ivanteoh/5945586 to your computer and use it in GitHub Desktop.
plomino sample database for unicode error. Insert 'someone’s text' in sample_field
<plominodatabase id="sampledb">
<design>
<dbsettings version="1.16">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
<DateTimeFormat type="Products.Archetypes.Field.StringField">%Y-%m-%d</DateTimeFormat>
<StartPage type="Products.Archetypes.Field.StringField"/>
<i18n type="Products.Archetypes.Field.StringField"/>
<DoNotListUsers type="Products.Archetypes.Field.BooleanField">False</DoNotListUsers>
<DoNotReindex type="Products.Archetypes.Field.BooleanField">False</DoNotReindex>
<excludeFromNav type="Products.Archetypes.Field.BooleanField">False</excludeFromNav>
<acl AnomynousAccessRight="NoAccess" AuthenticatedAccessRight="NoAccess">
<params id="UserRoles">
<param>
<value><struct>
</struct></value>
</param>
</params>
<params id="SpecificRights">
<param>
<value><struct>
<member>
<name>specific_deletedocument</name>
<value><string>PlominoAuthor</string></value>
</member>
</struct></value>
</param>
</params>
</acl>
</dbsettings>
<element id="pgSample" title="pgSample" type="PlominoForm">
<id type="Products.Archetypes.Field.StringField">pgSample</id>
<onCreateDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onCreateDocument>
<onOpenDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onOpenDocument>
<beforeSaveDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></beforeSaveDocument>
<onSaveDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onSaveDocument>
<onDeleteDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onDeleteDocument>
<onSearch type="Products.Archetypes.Field.TextField"><![CDATA[]]></onSearch>
<beforeCreateDocument type="Products.Archetypes.Field.TextField"><![CDATA[req = getattr(plominoContext, 'REQUEST')
submitted = req.get('submit', None)
if not submitted:
return
db = plominoContext.getParentDatabase()
sample_field = req.get('sample_field')
sample_document = db.createDocument()
sample_document.setItem('sample_field', sample_field)
form = db.getForm('pgSample')
sample_document.save(form=form, creation=True)
#req.RESPONSE.redirect(db.absolute_url())]]></beforeCreateDocument>
<FormLayout type="Products.Archetypes.Field.TextField"><![CDATA[
<p><span class="plominoHidewhenClass">start:is_submit</span></p>
<p>this is a field: <span class="plominoFieldClass">sample_field</span></p>
<p>Enter some unicode character</p>
<p><span class="plominoActionClass">submit</span></p>
<p>Help me</p>
<p><span class="plominoHidewhenClass">end:is_submit</span></p>
<p><span class="plominoHidewhenClass">start:is_thank_you</span>Thank you.<span class="plominoHidewhenClass">end:is_thank_you</span></p>
]]></FormLayout>
<DocumentTitle type="Products.Archetypes.Field.TextField"><![CDATA[]]></DocumentTitle>
<DocumentId type="Products.Archetypes.Field.TextField"><![CDATA[]]></DocumentId>
<ActionBarPosition type="Products.Archetypes.Field.StringField">TOP</ActionBarPosition>
<HideDefaultActions type="Products.Archetypes.Field.BooleanField">False</HideDefaultActions>
<HideInMenu type="Products.Archetypes.Field.BooleanField">False</HideInMenu>
<isSearchForm type="Products.Archetypes.Field.BooleanField">False</isSearchForm>
<isPage type="Products.Archetypes.Field.BooleanField">True</isPage>
<SearchView type="Products.Archetypes.Field.StringField"/>
<SearchFormula type="Products.Archetypes.Field.TextField"><![CDATA[]]></SearchFormula>
<Position type="Products.Archetypes.Field.IntegerField"/>
<excludeFromNav type="Products.Archetypes.Field.BooleanField">False</excludeFromNav>
<elements>
<element id="sample_field" title="sample_field" type="PlominoField">
<id type="Products.Archetypes.Field.StringField">sample_field</id>
<FieldType type="Products.Archetypes.Field.StringField">TEXT</FieldType>
<FieldMode type="Products.Archetypes.Field.StringField">EDITABLE</FieldMode>
<Formula type="Products.Archetypes.Field.TextField"><![CDATA[]]></Formula>
<FieldReadTemplate type="Products.Archetypes.Field.StringField"/>
<FieldEditTemplate type="Products.Archetypes.Field.StringField"/>
<Mandatory type="Products.Archetypes.Field.BooleanField">False</Mandatory>
<ValidationFormula type="Products.Archetypes.Field.TextField"><![CDATA[]]></ValidationFormula>
<ToBeIndexed type="Products.Archetypes.Field.BooleanField">False</ToBeIndexed>
<IndexType type="Products.Archetypes.Field.StringField">DEFAULT</IndexType>
<params>
<param>
<value><struct>
<member>
<name>widget</name>
<value><string>TEXTAREA</string></value>
</member>
<member>
<name>size</name>
<value><string>10</string></value>
</member>
</struct></value>
</param>
</params>
</element>
<element id="submit" title="Submit" type="PlominoAction">
<id type="Products.Archetypes.Field.StringField">submit</id>
<ActionType type="Products.Archetypes.Field.StringField">SAVE</ActionType>
<ActionDisplay type="Products.Archetypes.Field.StringField">SUBMIT</ActionDisplay>
<Content type="Products.Archetypes.Field.TextField"><![CDATA[]]></Content>
<Hidewhen type="Products.Archetypes.Field.TextField"><![CDATA[]]></Hidewhen>
<InActionBar type="Products.Archetypes.Field.BooleanField">False</InActionBar>
</element>
<element id="is_submit" title="is_submit" type="PlominoHidewhen">
<id type="Products.Archetypes.Field.StringField">is_submit</id>
<Formula type="Products.Archetypes.Field.TextField"><![CDATA[req = getattr(plominoContext, 'REQUEST')
submit_success = req.get('submit', None)
sample_field = req.get('sample_field', None)
if submit_success and sample_field:
return True
return False]]></Formula>
<isDynamicHidewhen type="Products.Archetypes.Field.BooleanField">False</isDynamicHidewhen>
</element>
<element id="is_thank_you" title="is_thank_you" type="PlominoHidewhen">
<id type="Products.Archetypes.Field.StringField">is_thank_you</id>
<Formula type="Products.Archetypes.Field.TextField"><![CDATA[req = getattr(plominoContext, 'REQUEST')
submit_success = req.get('submit', None)
sample_field = req.get('sample_field', None)
if submit_success and sample_field:
return False
return True]]></Formula>
<isDynamicHidewhen type="Products.Archetypes.Field.BooleanField">False</isDynamicHidewhen>
</element>
</elements>
</element>
</design>
</plominodatabase>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment