You are here: Foswiki>Tasks Web>Item10208 (06 Jan 2011, PaulHarvey)Edit Attach

Item10208: Add length operator to arrays in query search

pencil
Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: ArthurClemens
Waiting For:
Last Change By: PaulHarvey
So it is easier to get the number of attachments.

-- ArthurClemens - 29 Dec 2010

%QUERY{"length('System.DocumentGraphics'/attachments)"}%
765

-- PaulHarvey - 31 Dec 2010

This is trunk only. See Development.AddOperatorsToQueries

-- PaulHarvey - 31 Dec 2010

Added to the query cookbook

-- PaulHarvey - 31 Dec 2010

For Item10221 to work it would be necessary to retrieve the number of shown (not hidden) attachments. Is this currently possible?

-- ArthurClemens - 06 Jan 2011

Hidden attachments: %QUERY{"length('System.FamFamFamContrib'/attachments[lc(attr)=~'h'])"}% Shown attachments: %QUERY{"length('System.FamFamFamContrib'/length(attachments[NOT lc(attr)=~'h'])"}%

Hidden attachments: 6 Shown attachments: 0

Let's do a SEARCH for topics in Extensions that has have some of both:
%SEARCH{
  "length(attachments[lc(attr)=~'h']) > 0 AND length(attachments[NOT lc(attr)=~'h']) > 0"
  type="query"
  web="Extensions"
  header="---++ [[$web.%HOMETOPIC%][$web]]
| *Topic* | *Shown* | *Hidden* |"
  format="| [[$web.$topic][$topic]] | $percntQUERY{\"length('$web.$topic'/attachments[lc(attr)=~'h'])\"}$percnt | $percntQUERY{\"length('$web.$topic'/attachments[NOT lc(attr)=~'h'])\"}$percnt |"
}%

Searched: length(attachments[lc(attr)=~'h']) > 0 AND length(attachments[NOT lc(attr)=~'h']) > 0

Extensions

Topic Shown Hidden
ActionTrackerPlugin 4 5
AliasPlugin 9 5
BarcodePlugin 2 5
BehaviourContrib 11 5
BookmakerPlugin 2 5
BuildContrib 9 6
ChartPlugin 13 5
ChecklistTablePlugin 2 5
ClamAVScanPlugin 9 5
CommentPlugin 6 5
CompareRevisionsAddOn 2 5
ConfigurePlugin 30 5
ContributorsPlugin 3 5
ControlWikiWordPlugin 9 5
DebianRepositoryPlugin 11 5
DelayMacroPlugin 11 5
DirectedGraphPlugin 37 5
DpSyntaxHighlighterPlugin 9 5
EasyTimelinePlugin 28 5
EditRowPlugin 27 5
EditTablePlugin 13 5
ExplicitNumberingPlugin 9 5
FamFamFamContrib 6 5
FilesysVirtualPlugin 9 5
FirebugLitePlugin 3 5
FlotChartPlugin 11 6
FormPlugin 3 6
FreeMarkerPlugin 11 5
GaugePlugin 5 5
GenPDFAddOn 2 9
GenPDFPrincePlugin 9 5
GluePlugin 11 5
GoogleAnalyticsPlugin 2 6
GraphvizPlugin 2 5
HistoryPlugin 9 5
HolidaylistPlugin 2 5
IfDefinedPlugin 9 5
ImageGalleryPlugin 9 8
ImagePlugin 3 5
JEditableContrib 2 5
JHotDrawPlugin 17 5
JQTablePlugin 9 5
JQueryLibPlugin 8 5
JQueryMenuSkin 9 5
JQueryPlugin 9 5
JSCalendarContrib 37 5
JSPopupPlugin 11 4
JsonRpcContrib 7 5
LatexModePlugin 3 5
LdapNgPlugin 9 5
LightboxPlugin 11 5
MailInContrib 2 5
MailerContrib 2 5
MathModePlugin 9 5
MediaWikiTablePlugin 9 5
MediaWikiToFoswikiContrib 2 5
MeetingBingoPlugin 11 5
MetaCommentPlugin 9 5
MicroformatsPlugin 4 4
MirrorWebPlugin 2 5
MultiTopicSavePlugin 9 5
NatEditPlugin 9 5
NatSkin 36 5
NativeSearchContrib 2 5
NewUserPlugin 9 5
OrphansPlugin 2 5
PatchFoswikiContrib 5 5
PatternSkin 43 5
PerlPlugin 2 5
PersonalInfoAddOn 7 11
PhotoGalleryPlugin 7 5
PiwikPlugin 9 5
PublishPlugin 2 5
QuickMenuSkin 2 5
RenderFormPlugin 9 5
RenderListPlugin 26 5
RenderTableDataPlugin 11 6
RevCommentPlugin 2 5
SafeWikiPlugin 2 5
SectionPermissionPlugin 11 3
SkillsPlugin 3 6
SlickSitemapContrib 11 2
SlideShowPlugin 10 5
SmartEditContrib 8 5
SmiliesPlugin 112 5
SmsTwoStepAuthContrib 2 5
SubscribePlugin 4 5
TagMePlugin 10 5
TalkContrib 11 5
TinyMCEPlugin 4 5
TocPlugin 9 5
ToolTipPlugin 22 4
TopicNameValidationPlugin 2 5
TopicVotePlugin 11 3
TreePlugin 8 5
UnitTestContrib 2 5
UpdatesPlugin 5 5
VarCachePlugin 11 5
VirtualHostingContrib 11 5
VotePlugin 2 5
WebPermissionsPlugin 2 5
WikiDrawPlugin 11 5
WorkflowPlugin 3 5
WysiwygPlugin 9 5
Number of topics: 104

-- PaulHarvey - 06 Jan 2011
 

ItemTemplate edit

Summary Add length operator to arrays in query search
ReportedBy ArthurClemens
Codebase trunk
SVN Range
AppliesTo Engine
Component
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r7 - 06 Jan 2011, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy