Finished Metadata implementation

This commit is contained in:
Len Kranendonk 2004-07-23 21:03:59 +00:00
parent 3ef3248e61
commit cfceb1f68c
15 changed files with 272 additions and 82 deletions

View file

@ -1,6 +1,6 @@
insert into webguiVersion values ('6.2.0','upgrade',unix_timestamp());
DROP TABLE IF EXISTS metaData_fields;
CREATE TABLE metaData_fields (
DROP TABLE IF EXISTS metaData_properties;
CREATE TABLE metaData_properties (
fieldId int(11) NOT NULL default '0',
fieldName varchar(100) NOT NULL ,
description mediumtext NOT NULL ,
@ -11,8 +11,8 @@ CREATE TABLE metaData_fields (
UNIQUE KEY field_unique (fieldName)
) TYPE=MyISAM;
DROP TABLE IF EXISTS metaData_data;
CREATE TABLE metaData_data (
DROP TABLE IF EXISTS metaData_values;
CREATE TABLE metaData_values (
fieldId int(11) NOT NULL default '0',
wobjectId int(11) NOT NULL default '0',
value varchar(100) default NULL,

View file

@ -14,6 +14,8 @@ uploadsPath = /data/WebGUI/www/uploads
templateCacheType=file
passiveProfileInterval = 86400 # in seconds
emailRecoveryLoggingEnabled = 1
passwordChangeLoggingEnabled = 1

View file

@ -185,6 +185,10 @@ our $HELP = {
tag => 'message board add/edit',
namespace => 'MessageBoard'
},
{
tag => 'metadata manage',
namespace => 'WebGUI'
},
{
tag => 'poll add/edit',
namespace => 'Poll'
@ -1109,6 +1113,39 @@ our $HELP = {
}
]
},
'metadata manage'=> {
title => 'Metadata, Manage',
body => 'metadata manage body',
related => [
{
tag => 'user macros',
namespace => 'WebGUI'
},
{
tag => 'wobject add/edit',
namespace => 'WebGUI',
},
],
},
'metadata edit property' => {
title => 'Metadata, Edit property',
body => 'metadata edit property body',
related => [
{
tag => 'metadata manage',
namespace => 'WebGUI'
},
{
tag => 'user macros',
namespace => 'WebGUI'
},
{
tag => 'wobject add/edit',
namespace => 'WebGUI',
},
],
},
};
1;

View file

@ -8,7 +8,12 @@ our $HELP = {
{
tag => 'wobjects using',
namespace => 'WebGUI'
}
},
{
tag => 'metadata manage',
namespace => 'WebGUI'
},
]
},
};

View file

@ -21,7 +21,7 @@ sub process {
@param = WebGUI::Macro::getParams($_[0]);
my $key = $param[0];
my $value = $param[1];
my $sql = "select count from passiveProfileAOI a, metaData_fields f
my $sql = "select count from passiveProfileAOI a, metaData_properties f
where a.fieldId=f.fieldId
and userId=".quote($session{user}{userId})."
and fieldName=".quote($key)."

View file

@ -22,7 +22,7 @@ sub process {
my $key = $param[0];
my $rank = $param[1] || 1; # 1 is highest rank
$rank--; # Rank is zero based
my $sql = "select value from passiveProfileAOI a, metaData_fields f
my $sql = "select value from passiveProfileAOI a, metaData_properties f
where a.fieldId=f.fieldId
and userId=".quote($session{user}{userId})."
and fieldName=".quote($key)." order by a.count desc";

View file

@ -33,8 +33,16 @@ This package provides an interface to the MetaData system.
=head1 SYNOPSIS
use WebGUI::MetaData;
$wid = getWobjectByCriteria($hashRef);
$hashRef = WebGUI::MetaData::getField( $fieldId );
$hashRef = WebGUI::MetaData::getMetaDataFields();
$wid = getWobjectByCriteria($hashRef);
$arrayRef = WebGUI::MetaData::getFieldTypes;
$hashRef = WebGUI::MetaData::getMetaDataFields;
WebGUI::MetaData::metaDataSave( $wobjectId )
WebGUI::MetaData::metaDataDelete( $wobjectId )
WebGUI::MetaData::MetaDataDuplicate( $fromWobjectId , $toWobjectId )
WebGUI::MetaData::deleteField( $fieldId );
=head1 METHODS
@ -75,8 +83,8 @@ The fieldId to be deleted.
sub deleteField {
my $fieldId = shift;
return unless ($fieldId =~ /^\d+$/);
WebGUI::SQL->write("delete from metaData_fields where fieldId = ".quote($fieldId));
WebGUI::SQL->write("delete from metaData_data where fieldId = ".quote($fieldId));
WebGUI::SQL->write("delete from metaData_properties where fieldId = ".quote($fieldId));
WebGUI::SQL->write("delete from metaData_values where fieldId = ".quote($fieldId));
}
#-------------------------------------------------------------------
@ -147,8 +155,8 @@ sub getMetaDataFields {
f.fieldType,
f.possibleValues,
d.value
from metaData_fields f
left join metaData_data d on f.fieldId=d.fieldId and d.wobjectId=".quote($wobjectId);
from metaData_properties f
left join metaData_values d on f.fieldId=d.fieldId and d.wobjectId=".quote($wobjectId);
$sql .= " where f.fieldId = ".quote($fieldId) if ($fieldId);
$sql .= " order by f.fieldName";
my $sth = WebGUI::SQL->read($sql);
@ -182,19 +190,19 @@ sub metaDataSave {
foreach my $form (keys %{$session{form}}) {
if ($form =~ /^metadata_(\d+)$/) {
my $fieldId = $1;
my ($exists) = WebGUI::SQL->quickArray("select count(*) from metaData_data
my ($exists) = WebGUI::SQL->quickArray("select count(*) from metaData_values
where wobjectId = ".quote($wobjectId)."
and fieldId = ".quote($fieldId));
if(! $exists && $session{form}{$form} ne "") {
WebGUI::SQL->write("insert into metaData_data (fieldId, wobjectId)
WebGUI::SQL->write("insert into metaData_values (fieldId, wobjectId)
values (".quote($fieldId).",".quote($wobjectId).")");
}
if($session{form}{$form} eq "") {
# Keep it clean
WebGUI::SQL->write("delete from metaData_data where wobjectId = ".
WebGUI::SQL->write("delete from metaData_values where wobjectId = ".
quote($wobjectId)." and fieldId = ".quote($fieldId));
} else {
WebGUI::SQL->write("update metaData_data set value = ".quote($session{form}{$form})."
WebGUI::SQL->write("update metaData_values set value = ".quote($session{form}{$form})."
where wobjectId = ".quote($wobjectId)." and fieldId = ".
quote($fieldId));
}
@ -220,7 +228,7 @@ The Id from the wobject you want to delete metadata for.
sub metaDataDelete {
my $wobjectId = shift;
return WebGUI::SQL->write("delete from metaData_data where wobjectId = ".quote($wobjectId));
return WebGUI::SQL->write("delete from metaData_values where wobjectId = ".quote($wobjectId));
}
#-------------------------------------------------------------------
@ -246,9 +254,9 @@ The new wobject Id
sub MetaDataDuplicate {
my $fromWobjectId = shift;
my $toWobjectId = shift;
my $sth = WebGUI::SQL->read("select * from metaData_data where wobjectId = ".quote($fromWobjectId));
my $sth = WebGUI::SQL->read("select * from metaData_values where wobjectId = ".quote($fromWobjectId));
while( my $h = $sth->hashRef) {
WebGUI::SQL->write("insert into metaData_data (fieldId, wobjectId, value) values (".
WebGUI::SQL->write("insert into metaData_values (fieldId, wobjectId, value) values (".
quote($h->{fieldId}).",".quote($toWobjectId).",".quote($h->{value}).")");
}
$sth->finish;
@ -341,7 +349,7 @@ sub getWobjectByCriteria {
$constraint =~ s/\Q$expression/$replacement/;
}
my $sql = " select w.wobjectId
from metaData_data d, metaData_fields f, wobject w
from metaData_values d, metaData_properties f, wobject w
where f.fieldId = d.fieldId
and w.wobjectId = d.wobjectId
and w.namespace = ".quote($namespace);

View file

@ -56,8 +56,7 @@ sub www_editMetaDataField {
return WebGUI::Privilege::vitalComponent() if ($session{form}{fid} < 1000 && $session{form}{fid} > 0);
my ($output, $fieldName, $defaultValue, $description, $fieldInfo);
# TODO: add help / internationlize
$output = helpIcon(22);
$output = helpIcon('metadata edit property');
$output .= '<h1>'.WebGUI::International::get('Edit Metadata','MetaData').'</h1>';
if($session{form}{fid} && $session{form}{fid} ne "new") {
@ -66,7 +65,6 @@ sub www_editMetaDataField {
my $fid = $session{form}{fid} || "new";
#TODO: internatioa
my $f = WebGUI::HTMLForm->new;
$f->hidden("op", "editMetaDataFieldSave");
$f->hidden("fid", $fid);
@ -95,7 +93,7 @@ sub www_editMetaDataFieldSave {
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::vitalComponent() if ($session{form}{fid} < 1000 && $session{form}{fid} > 0);
# Check for duplicate field names
my $sql = "select count(*) from metaData_fields where fieldName = ".
my $sql = "select count(*) from metaData_properties where fieldName = ".
quote($session{form}{fieldName});
if ($session{form}{fid} ne "new") {
$sql .= " and fieldId <> ".quote($session{form}{fid});
@ -106,9 +104,13 @@ sub www_editMetaDataFieldSave {
$error =~ s/\%field\%/$session{form}{fieldName}/;
return $error . www_editMetaDataField();
}
if($session{form}{fieldName} eq "") {
return WebGUI::International::get("errorEmptyField", "MetaData")
. www_editMetaDataField();
}
if($session{form}{fid} eq 'new') {
$session{form}{fid} = getNextId("metaData_fieldId");
WebGUI::SQL->write("insert into metaData_fields (fieldId, fieldName, defaultValue, description, fieldType, possibleValues) values (".
WebGUI::SQL->write("insert into metaData_properties (fieldId, fieldName, defaultValue, description, fieldType, possibleValues) values (".
quote($session{form}{fid}).",".
quote($session{form}{fieldName}).",".
quote($session{form}{defaultValue}).",".
@ -116,7 +118,7 @@ sub www_editMetaDataFieldSave {
quote($session{form}{fieldType}).",".
quote($session{form}{possibleValues}).")");
} else {
WebGUI::SQL->write("update metaData_fields set fieldName = ".quote($session{form}{fieldName}).", ".
WebGUI::SQL->write("update metaData_properties set fieldName = ".quote($session{form}{fieldName}).", ".
"defaultValue = ".quote($session{form}{defaultValue}).", ".
"description = ".quote($session{form}{description}).", ".
"fieldType = ".quote($session{form}{fieldType}).", ".
@ -160,7 +162,7 @@ sub www_manageMetaData {
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
my $output;
# TODO: add help
$output = helpIcon(22);
$output = helpIcon('metadata manage');
$output .= '<h1>'.WebGUI::International::get('Manage Metadata','MetaData').'</h1>';
my $f = new WebGUI::HTMLForm;
$f->hidden("op","saveSettings");

View file

@ -119,7 +119,7 @@ sub summarizeAOI {
d.fieldId,
d.wobjectId,
d.value
from metaData_data d , metaData_fields f
from metaData_values d , metaData_properties f
where f.fieldId = d.fieldId
and d.wobjectId = ".$data->{wobjectId};

View file

@ -1470,6 +1470,12 @@ sub www_edit {
my $meta = WebGUI::MetaData::getMetaDataFields($self->get("wobjectId"));
foreach my $field (keys %$meta) {
my $fieldType = $meta->{$field}{fieldType} || "text";
my $options;
# Add a "Select..." option on top of a select list to prevent from
# saving the value on top of the list when no choice is made.
if($fieldType eq "selectList") {
$options = {"", WebGUI::International::get("Select...","MetaData")};
}
$f->getTab("metadata")->dynamicField($fieldType,
-name=>"metadata_".$meta->{$field}{fieldId},
-label=>$meta->{$field}{fieldName},
@ -1477,9 +1483,15 @@ sub www_edit {
-value=>$meta->{$field}{value},
-extras=>qq/title="$meta->{$field}{description}"/,
-possibleValues=>$meta->{$field}{possibleValues},
-options=>{"", WebGUI::International::get("Select...","MetaData")}
-options=>$options
);
}
# Add a quick link to add field
$f->getTab("metadata")->readOnly(
-value=>'<p><a href="'.WebGUI::URL::page("op=editMetaDataField&fid=new").'">'.
WebGUI::International::get('Add new field','MetaData').
'</a></p>'
);
}
my $output;
$output = helpIcon($helpId,$self->get("namespace")) if ($helpId);

View file

@ -124,11 +124,12 @@ sub www_edit {
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
-value=>'<a href="'.WebGUI::URL::gateway($data[0]).'">'.$data[1].'</a> ('.$_[0]->get("proxiedWobjectId").')'
);
$properties->yesNo(
-name=>"proxyByCriteria",
-value=>$_[0]->getValue("proxyByCriteria"),
-label=>WebGUI::International::get("Proxy by alternate criteria?",$_[0]->get("namespace")),
-extras=>q|Onchange="
if($session{setting}{metaDataEnabled}) {
$properties->yesNo(
-name=>"proxyByCriteria",
-value=>$_[0]->getValue("proxyByCriteria"),
-label=>WebGUI::International::get("Proxy by alternate criteria?",$_[0]->get("namespace")),
-extras=>q|Onchange="
if (this.form.proxyByCriteria[0].checked) {
this.form.resolveMultiples.disabled=false;
this.form.proxyCriteria.disabled=false;
@ -137,26 +138,25 @@ sub www_edit {
this.form.proxyCriteria.disabled=true;
}"|
);
my $extras;
if ($_[0]->getValue("proxyByCriteria") == 0) {
$extras = 'disabled=true';
}
$properties->selectList(
-name=>"resolveMultiples",
-value=>[ $_[0]->getValue("resolveMultiples") ],
-label=>WebGUI::International::get("Resolve Multiples?",$_[0]->get("namespace")),
-options=>{
if ($_[0]->getValue("proxyByCriteria") == 0) {
$_[0]->{_disabled} = 'disabled=true';
}
$properties->selectList(
-name=>"resolveMultiples",
-value=>[ $_[0]->getValue("resolveMultiples") ],
-label=>WebGUI::International::get("Resolve Multiples?",$_[0]->get("namespace")),
-options=>{
mostRecent=>WebGUI::International::get("Most Recent",$_[0]->get("namespace")),
random=>WebGUI::International::get("Random",$_[0]->get("namespace")),
},
-extras=>$extras
-extras=>$_[0]->{_disabled}
);
$properties->readOnly(
-value=>$_[0]->_drawQueryBuilder(),
-label=>WebGUI::International::get("Criteria",$_[0]->get("namespace")),
);
$properties->readOnly(
-value=>$_[0]->_drawQueryBuilder(),
-label=>WebGUI::International::get("Criteria",$_[0]->get("namespace")),
);
}
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly,
@ -197,6 +197,7 @@ sub _drawQueryBuilder {
my $proxyCriteriaField = WebGUI::Form::textarea({
name=>"proxyCriteria",
value=>$_[0]->getValue("proxyCriteria"),
extras=>'style="width: 100%" '.$_[0]->{_disabled}
});
my $conjunctionField = WebGUI::Form::selectList({
name=>"conjunction",
@ -216,7 +217,7 @@ sub _drawQueryBuilder {
$output .= qq|<table cellspacing="0" cellpadding=0 border=0 >
<tr>
<td colspan="5">$proxyCriteriaField</td>
<td colspan="5" align="right">$proxyCriteriaField</td>
</tr>
<tr>
<td></td>

View file

@ -6,16 +6,20 @@ our $I18N = {
lastUpdated => 1089039511,
context => 'Label for tab'
},
'errorEmptyField' => {
message => q|<p><b>Error: Field name may not be empty.</b></p>|,
lastUpdated => 1089039511,
},
'duplicateField' => {
message => q|<p><b>Error: Fieldname "%field%" is already in use.</b></p>|,
lastUpdated => 1089039511,
},
'Delete Metadata field' => {
message => q|Delete Metadata field|,
message => q|Delete Metadata property|,
lastUpdated => 1089039511,
},
'deleteConfirm' => {
message => q|Are you certain you want to delete this Metadata field ?|,
message => q|Are you certain you want to delete this Metadata property ?|,
lastUpdated => 1089039511,
},
'Manage Metadata' => {
@ -27,15 +31,15 @@ our $I18N = {
lastUpdated => 1089039511,
},
'Add new field' => {
message => q|Add new field|,
message => q|Add new metadata property|,
lastUpdated => 1089039511,
},
'Manage Metadata fields' => {
message => q|Manage Metadata fields|,
message => q|Manage metadata properties|,
lastUpdated => 1089039511,
},
'Edit Metadata' => {
message => q|Edit Metadata|,
message => q|Edit Metadata property|,
lastUpdated => 1089039511,
},
'Field Id' => {

View file

@ -3008,6 +3008,7 @@ The style-sheet id is the word "wobjectId" plus the Wobject Id for that wobject
<P><B>Title</B> The title of the wobject. This is typically displayed at the top of each wobject.
<P><I>Note:</I> You should always specify a title even if you are going to turn it off (with the next property). This is because the title shows up in the trash and clipboard and you'll want to be able to distinguish which wobject is which.
<P><B>Display title?</B><BR>Do you wish to display the title you specified? On some sites, displaying the title is not necessary.
<P><B>Metadata</B><BR>Under the Metadata tab you can set the metadata properties for this content. Metadata must be enabled in the Manage Settings menu.
<P><B>Process macros?</B><BR>Do you wish to process macros in the content of this wobject? Sometimes you'll want to do this, but more often than not you'll want to say "no" to this question. By disabling the processing of macros on the wobjects that don't use them, you'll speed up your web server slightly.
<P><B>Template Position</B><BR>Template positions range from 0 (zero) to any number. How many are available depends upon the Template associated with this page. The default template has only one template position, others may have more. By selecting a template position, you're specifying where this wobject should be placed within the template.
<P><B>Start Date</B><BR>On what date should this wobject become visible? Before this date, the wobject will only be displayed to Content Managers.
@ -4537,6 +4538,14 @@ Displays a small text message to a user who is in admin mode. Example: &#94;Admi
Places a link on the page which is only visible to content managers and adminstrators. The link toggles on/off admin mode. You can optionally specify other messages to display like this: &#94;AdminToggle("Edit On","Edit Off"); This macro optionally takes a third parameter that allows you to specify an alternate template name in the Macro/AdminToggle namespace.
<p>
<b>&#94;AOIHits();</b><br>
Displays the number of views for a metadata property/value pair. Example: &#94;AOIHits(contenttype,sport); would display 99 if this user has looked at content that was tagged "contenttype = sport" 99 times.
<p>
<b>&#94;AOIRank();</b><br>
Diplays the highest ranked metadata property for this user. Example &#94;AOIRank(contenttype); would display "sport" if this user has looked mostly to content tagged "contenttype = sport". Optionally the rank can also be displayed. Example &#94;AOIRank(contenttype, 2); would return the second highest ranked contenttype.
<p>
<b>&#94;CanEditText();</b><br>
Display a message to a user that can edit the current page.
<p>
@ -7025,7 +7034,103 @@ Following a guide like the above will help you get good ranking on search engine
message => q|Decimal|,
lastUpdated => 1089039511,
context => q|A label that tells the user that this field uses a floating point number, aka a Decimal number, aka a Real number.|
}
},
'Metadata, Edit property' => {
message => q|Metadata, Edit property|,
lastUpdated => 1089039511,
context => q|Metadata edit property help title|
},
'metadata edit property body' => {
message => q|
You may add as many Metadata properties as you like.<br>
<br>
<b>Field Name</b><br>
The name of this metadata propertie.It must be unique. <br>
It is advisable to use only letters (a-z), numbers (0-9) or underscores (_) for
the field names.
<p><b>Description<br>
</b>An optional description for this metadata property. This text is displayed
as mouseover text in the wobject properties tab.</p>
<p><b>Data Type<br>
</b>Choose the type of form element for this field.<b><br>
<br>
Possible Values<br>
</b>This field is used for the list types (Radio List and Select List). Enter
the values you wish to appear, one per line.</p>
|,
lastUpdated => 1089039511,
context => q|Metadata edit property help|
},
'Metadata, Manage' => {
message => q|Metadata, Manage|,
lastUpdated => 1089039511,
context => q|Metadata help title|
},
'metadata manage body' => {
message => q|
<p>The metadata system in WebGUI allows you to identify content. Metadata is
information about the content, and is defined in terms of property-value pairs.</p>
<p>Examples of metadata:</p>
<ul>
<li>contenttype: sport</li>
<li>adult content: no</li>
<li>source: newspaper</li>
</ul>
<p>In the example <b>source: newspaper</b> is <i>source</i> the <i>property</i>
and <i>newspaper</i> the <i>value</i>.</p>
<p>Metadata properties are defined globally, while Metadata values are set for
each wobject under the tab &quot;Metadata&quot; in the wobject properties.</p>
<p>Before you can use metadata, you'll have to switch the &quot;Enable Metadata
?&quot; setting to Yes.</p>
<p>Usage of metadata:</p>
<ul>
<li><b>Passive Profiling</b><br>
When passive profiling is switched on, every wobject viewed by a user will
be logged.&nbsp;<br>
The WebGUI scheduler summarizes the profiling information on a regular
basis.&nbsp;<br>
The metadata is used to generate the summary. This is basically content
ranking based upon the user's Areas of Interest (AOI).<br>
By default the summarizer runs once a day. However you can change that by
setting: <b>passiveProfileInterval = &lt;number of seconds&gt; </b>in the
WebGUI config file. <br>
</li>
</ul>
<ul>
<li><b>Areas of Interest Ranking<br>
</b>Metadata in combination with passive profiling produces AOI (Areas of
Interest) information. You can retrieve the value of a metadata property
with the ^AOIRank macro:<br>
<br>
^AOIRank(contenttype); <br>
This would return the highest ranked contenttype for this user, such as
&quot;sport&quot;.<br>
<br>
^AOIRank(contenttype,2);<br>
This would return the second highest ranked contenttype for this user.<br>
<br>
You can also retrieve the number of hits a particular AOI has gotten:<br>
<br>
^AOIHits(contenttype,sport); <br>
This would return 99 is this user has looked at content that was tagged
&quot;contenttype = sport&quot; 99 times. </li>
</ul>
<ul>
<li><b>Show content based upon criteria<br>
</b>The Wobject Proxy allows you to select content based upon criteria like:<br>
contenttype = sport AND source != newspaper<br>
<br>
You can use the AOI macro's described above in the criteria, so you can
present content based upon the users Areas of Interest. Example:<br>
type = ^AOIRank(contenttype);</li>
</ul>|,
lastUpdated => 1089039511,
context => q|Metadata help|
},
};

View file

@ -27,31 +27,45 @@ our $I18N = {
},
'6' => {
message => q|With the Wobject Proxy (aka Shortcut) you can mirror a wobject from another page to any other page. This is useful if you want to reuse the same content in multiple sections of your site.
<p>
<b>NOTE:</b> The wobject proxy is not available through the Add Content menu, but instead through the shortcut icon on each wobject's toolbar.
<p>
<b>Wobject To Proxy</b><br>
Provides a link to the orignal wobject being proxied.
<p>
<b>Override title?</b><br>
Set to "yes" to use the title of the wobject proxy instead of the original title of the wobject.
<p>
<b>Override description?</b><br>
Set to "yes" to use the description of the wobject proxy instead of the original description of the wobject.
<p>
<b>Override display title?</b><br>
Set to "yes" to use the display title setting of the wobject proxy instead of the original display title setting of the wobject.
<p>
<b>Override template?</b><br>
Set to "yes" to use the template of the wobject proxy instead of the original template of the wobject.
<p>
message => q|With the Wobject Proxy (aka Shortcut) you can mirror a wobject from another page to any other page. This is useful if you want to reuse the same content in multiple sections of your site.
<p>
<b>NOTE:</b> The wobject proxy is not available through the Add Content menu, but instead through the shortcut icon on each wobject's toolbar.
<p>
<b>Wobject To Proxy</b><br>
Provides a link to the orignal wobject being proxied.
<p>
<b>Override title?</b><br>
Set to "yes" to use the title of the wobject proxy instead of the original title of the wobject.
<p>
<b>Override description?</b><br>
Set to "yes" to use the description of the wobject proxy instead of the original description of the wobject.
<p>
<b>Override display title?</b><br>
Set to "yes" to use the display title setting of the wobject proxy instead of the original display title setting of the wobject.
<p>
<b>Override template?</b><br>
Set to "yes" to use the template of the wobject proxy instead of the original template of the wobject.
<p>
<b>Proxy by alternate criteria?</b><br>
Set to "yes" to enable selecting a wobject based upon custom criteria. Metadata must be enabled for this option to function properly.
<p>
<b>Resolve Multiples?</b><br>
Sets the order to use when multiple wobjects are selected. Random means that if multiple wobjects match the proxy criteria then the wobject proxy will select a random wobject to proxy.<br>
Most Recent will select the most recent wobject that match the proxy criteria.
<p>
<b>Criteria</b><br>
A statement to determinate what to proxy, in the form of "color = blue and weight != heavy". Multiple expressions may be joined with "and" and "or". <br>
A property or value must be quoted if it contains spaces. Feel free to use the criteria builder to build your statements.
<p>
|,
lastUpdated => 1057091098
},

View file

@ -11,7 +11,7 @@ function addCriteria ( fieldname, opform, valform ) {
if(/\s+/.test(fieldname)) {
fieldname = '"' + fieldname + '"';
}
if(/^\D+$/.test(value)) {
if(/^\D*$/.test(value)) {
value = '"' + value + '"';
}
var statement = fieldname + " " + operator + " " + value;