Tags:
twiki_func1Add my vote for this tag create new tag
, view all tags

Refactoring Proposal: More TWiki::Func API Functions

Motivation

To fill in some of the functionality missing from TWiki::Func. This means that plugin developers are less likely to violate Plugins API Policies and won't have to reinvent the wheel.

Additions

The following is a summary of the API functions that are proposed for inclusion in TWiki::Func.

In many cases they represent the exporting of APIs that already exist internal to the core. Note that exporting an API through Func does not freeze the core API, it only freezes the API in TWiki::Func. The core implementation of that API remains free to change.

  • readTopicMeta - complementary to readTopic, would just read meta. Advantage of this API is that if meta is cached separately from topic text, there is no need to read both. See WouldLikeReadTopicMetaInFuncDotPm
    • Status: not implemented
  • deleteFile($fileName) - complementary to readFile and writeFile, used for manipulating files in the plugin work area. See AddWorkareaFunctions - PeterThoeny
    • Status: not implemented, use unlink
  • getSessionKeys() -> %keys - get a hash of all the names of session variables. See AddGetSessionKeysToFunc.
    • Status: not implemented
  • changeTopic($web, $topic) -> ($oldweb, $oldtopic) - Change the topic context from a Contrib/Plugin. See ChangeTopicContextOnTheFly
    • CC considers this to be critically important.
    • Status: not implemented (should be a cut and paste from MailerContrib, though needs more research)
  • readWebMeta($web, $name) -> $text, writeWebMeta($web, $name, $text) - provide access to web meta-data - See ProvideAccessToWebMetaData
    • Status: not implemented, simple export of Store API
  • emailToWikiNames( $email, $dontAddWeb ) -> @wikiNames, wikiNameToEmails( $wikiname ) -> @emails, isAnAdmin( $user ) -> $boolean, isGroupMember( $group, $user ) -> $boolean, eachUser() -> $iterator, eachGroup() -> $iterator, isGroup( $group ) -> $boolean, eachGroupMember( $group ) -> $iterator, eachMembership($user) -> @iterator - see MergeFuncUsersContribWithFunc. Key user information APIs.
    • Status: implemented in MAIN, will release in 4.2
  • getExternalResource( $url ) -> $response - see AddGetUrlToTWikiFunc
    • Status: implemented in MAIN and TWiki04x01, will release in 4.1.2
  • sanitizeAttachmentName -> $name - AddSanitizeAttachmentNameToTWikiFunc - MartinCleaver
    • Status: not implemented, but it's a no-brainer
Contributors: MeredithLesly, CrawfordCurrie, PeterThoeny

Discussion

Note that there haven't been any specific proposals on how to handle the ordering issues in the <head> tag yet.

CC

I don't see the head issue listed above. We would need it for ProcessAddToHeadAdds.

-- ArthurClemens - 25 Feb 2007

I didn't add it because there have been no specific proposals, just a wish.

-- CrawfordCurrie - 26 Feb 2007

For tracking pursoses I think it is better to create a feature request topic for each new API function, and to list each in TWikiFeature04x02 (assuming there is an owner.)

-- PeterThoeny - 02 Mar 2007

And also assuming they are targeted at 4.2. I agree; that's why I was linking them from the list above, and tagging them all with twiki_func. This is an overview of the existing proposals specifically relating to Func, so we can see them all in one place and don;t lose any (several were lost in Codev, and dying of neglect).

-- CrawfordCurrie - 03 Mar 2007

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2007-03-03 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.