Hello
WikiGuest
Log In
or
Register
Users
About
Blog
Extensions
Documentation
Community
Development
Tasks
Download
Support
You are here:
Foswiki
>
Development Web
>
ReleaseProcess
>
FeatureRequest
>
AddCreateTopicToFunc
(revision 9) (raw view)
---+!! Feature Proposal: Add a new function createTopic to Func %TOC% ---++ Motivation More intuitive for novices starting to develop extensions ---++ Description and Documentation Much along the line of the *createWeb* function in *lib/Foswiki/Func.pm* there should also be a *createTopic* function. The current method of using *saveTopic* is confusing if you do not know about it. This does not even need to be a function per-say other than a placeholder to inform the developer to use the *saveTopic* function. <span style="color: #009900; font-size: 20px; line-height: 19px;">Examples</span> <pre>---+++ createTopic() See saveTopic function If you want to create an empty topic simply set the text to empty as follows: $text = ''; </pre> <span style="color: #009900; font-size: 20px; line-height: 19px;">Impact</span> %EDITTABLE{format="|label,1|text,70|" changerows="off"}% | WhatDoesItAffect: | %WHATDOESITAFFECT% | ---++ Implementation -- __Contributors:__ Main.PadraigLennon - 24 Nov 2011 ---++ Discussion At first blush, adding a new function that is the same as, and just refers to another function's docco __feels__ like a net negative. I'm presuming that you (er, and I) are likely to do a _find_ in =Func.pm= so it should be pretty trivial to add some docco to saveTopic that would do the same thing as adding a new function call. On the other hand :) Store2 is working in a similar direction - in that there are explicit calls to =load()=, =create()= - so I am clearly not sure. -- Main.SvenDowideit - 24 Nov 2011 Why not just add "if you were looking for createTopic, just use saveTopic" added to the saveTopic doc? Won't that achieve the same thing? -- Main.CrawfordCurrie - 25 Nov 2011 I'd also vote for more docs in this case. Especially as Sven is carefully considering the issues around this with Store2 which may or may not give us a create method. -- Main.JulianLevens - 25 Nov 2011 Crawford thats more or less along the lines of what I was suggesting. I'm just not sure what the correct way to do this is.. Do I just add a note to the *Func.pm* file? I'm thinking about how the http://www.foswiki.org/System/PerlDoc?module=Foswiki%3A%3AFunc works for example.. What format does it need to take? I'm not suggesting any new code here at all.. -- Main.PadraigLennon - 25 Nov 2011 I'm thinking that this would suffice.. though it would be useful for the novice user to know how to create an empty topic i.e. without reading in the contents of an existing topic first. Thoughts? <pre> =begin TML ---+++ createTopic( ) See saveTopic() =cut </pre> -- Main.PadraigLennon - 25 Nov 2011 Actually creating a topic from thin air, then attaching a form and populate it with stuff isnt that easy. Making this more plugin friendly would actually be nice. For now to add a new topic from thin air you'd have to construct a new Meta object and the use putKeyed(FORM) and friends to manually attach a form in the hope it matches the data form definition ... though this is more of _data forms_ being a hassle on perl land rather than just a createTopic. -- Main.MichaelDaum - 25 Nov 2011 Right; but what you describe is more of a "build topic" function. For example, =attachForm=, =populateForm= would be a more appropriate API (c.f. addAttachment). After buildint meta this way, =saveTopic= is still the business. -- Main.CrawfordCurrie - 25 Nov 2011 No follow-up from proposer, so rejecting this proposal. -- Main.CrawfordCurrie - 17 Feb 2012 %COMMENT%
ChangeProposalForm
edit
TopicSummary
Add a new function createTopic to Func
CurrentState
RejectedProposal
CommittedDeveloper
ReasonForDecision
None
DateOfCommitment
ConcernRaisedBy
BugTracking
RelatedTopics
PlannedFor
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r9
<
r8
<
r7
<
r6
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r9 - 17 Feb 2012,
CrawfordCurrie
Development
Quick Links
Tasks and Bugs
Developers Bible
Release Plan
Feature Proposals
Topic Classification
Tools
Tasks
Index
Changes
Changes in all webs
Notifications
Statistics
Sandbox
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see
CopyrightStatement
.