Skip to content

Instantly share code, notes, and snippets.

@ebrehault
Created July 18, 2013 07:09
Show Gist options
  • Save ebrehault/6027283 to your computer and use it in GitHub Desktop.
Save ebrehault/6027283 to your computer and use it in GitHub Desktop.
plomino db sample to index docs in portal catalog's Subject index
<plominodatabase id="test-subjects">
<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">True</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="frmtest" title="Test" type="PlominoForm">
<id type="Products.Archetypes.Field.StringField">frmtest</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[context.setItem('Subject', context.getItem('doc_subjects', []))]]></onSaveDocument>
<onDeleteDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onDeleteDocument>
<onSearch type="Products.Archetypes.Field.TextField"><![CDATA[]]></onSearch>
<beforeCreateDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></beforeCreateDocument>
<FormLayout type="Products.Archetypes.Field.TextField"><![CDATA[
<p>title:<span class="plominoFieldClass">doc_title</span></p>
<p>subjects:<span class="plominoFieldClass">doc_subjects</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">False</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="doc_subjects" title="doc_subjects" type="PlominoField">
<id type="Products.Archetypes.Field.StringField">doc_subjects</id>
<FieldType type="Products.Archetypes.Field.StringField">SELECTION</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">True</ToBeIndexed>
<IndexType type="Products.Archetypes.Field.StringField">DEFAULT</IndexType>
<params>
<param>
<value><struct>
<member>
<name>selectionlist</name>
<value><array><data>
<value><string>Poetry</string></value>
<value><string>Science</string></value>
<value><string>History</string></value>
<value><string>Architecture</string></value>
</data></array></value>
</member>
<member>
<name>dynamictableparam</name>
<value><string>'bPaginate': true,
'bLengthChange': true,
'bFilter': true,
'bSort': true,
'bInfo': true,
'bAutoWidth': false</string></value>
</member>
<member>
<name>widget</name>
<value><string>CHECKBOX</string></value>
</member>
</struct></value>
</param>
</params>
</element>
<element id="doc_title" title="doc_title" type="PlominoField">
<id type="Products.Archetypes.Field.StringField">doc_title</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">True</ToBeIndexed>
<IndexType type="Products.Archetypes.Field.StringField">DEFAULT</IndexType>
</element>
</elements>
</element>
<element id="allfrmtest" title="All Test" type="PlominoView">
<id type="Products.Archetypes.Field.StringField">allfrmtest</id>
<SelectionFormula type="Products.Archetypes.Field.TextField"><![CDATA[plominoDocument.getItem("Form")=="frmtest"]]></SelectionFormula>
<SortColumn type="Products.Archetypes.Field.StringField"/>
<Categorized type="Products.Archetypes.Field.BooleanField">False</Categorized>
<FormFormula type="Products.Archetypes.Field.TextField"><![CDATA[]]></FormFormula>
<ReverseSorting type="Products.Archetypes.Field.BooleanField">False</ReverseSorting>
<ActionBarPosition type="Products.Archetypes.Field.StringField">TOP</ActionBarPosition>
<HideDefaultActions type="Products.Archetypes.Field.BooleanField">False</HideDefaultActions>
<HideCheckboxes type="Products.Archetypes.Field.BooleanField">False</HideCheckboxes>
<HideInMenu type="Products.Archetypes.Field.BooleanField">False</HideInMenu>
<Widget type="Products.Archetypes.Field.StringField">BASIC</Widget>
<DynamicTableParameters type="Products.Archetypes.Field.TextField"><![CDATA[
'bPaginate': false,
'bLengthChange': false,
'bFilter': true,
'bSort': true,
'bInfo': true,
'bAutoWidth': false]]></DynamicTableParameters>
<ViewTemplate type="Products.Archetypes.Field.StringField"/>
<onOpenView type="Products.Archetypes.Field.TextField"><![CDATA[]]></onOpenView>
<Position type="Products.Archetypes.Field.IntegerField"/>
<excludeFromNav type="Products.Archetypes.Field.BooleanField">False</excludeFromNav>
<elements>
<element id="docsubjects" title="docsubjects" type="PlominoColumn">
<id type="Products.Archetypes.Field.StringField">docsubjects</id>
<SelectedField type="Products.Archetypes.Field.StringField">frmtest/doc_subjects</SelectedField>
<Formula type="Products.Archetypes.Field.TextField"><![CDATA[]]></Formula>
<HiddenColumn type="Products.Archetypes.Field.BooleanField">False</HiddenColumn>
<DisplaySum type="Products.Archetypes.Field.BooleanField">False</DisplaySum>
</element>
<element id="doctitle" title="doctitle" type="PlominoColumn">
<id type="Products.Archetypes.Field.StringField">doctitle</id>
<SelectedField type="Products.Archetypes.Field.StringField">frmtest/doc_title</SelectedField>
<Formula type="Products.Archetypes.Field.TextField"><![CDATA[]]></Formula>
<HiddenColumn type="Products.Archetypes.Field.BooleanField">False</HiddenColumn>
<DisplaySum type="Products.Archetypes.Field.BooleanField">False</DisplaySum>
</element>
<element id="add_new" title="Add a new Test" type="PlominoAction">
<id type="Products.Archetypes.Field.StringField">add_new</id>
<ActionType type="Products.Archetypes.Field.StringField">OPENFORM</ActionType>
<ActionDisplay type="Products.Archetypes.Field.StringField">BUTTON</ActionDisplay>
<Content type="Products.Archetypes.Field.TextField"><![CDATA[frmtest]]></Content>
<Hidewhen type="Products.Archetypes.Field.TextField"><![CDATA[]]></Hidewhen>
<InActionBar type="Products.Archetypes.Field.BooleanField">True</InActionBar>
</element>
</elements>
</element>
</design>
</plominodatabase>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment