WebMatrix Task Based extensibility for Web App Gallery Applications

WebMatrix allows you to enhance the user experience for your application with a feature called “Task-based extensibility (TBEX) “for Web App Gallery application. This allows you to customize the WebMatrix user interface for a specific application with just a simple XML file included in your package at the root level alongside the manifest.xml and parameters.xml files in the application package. Applications like Wordpress , Umbraco , Dotnetnuke , Joomla to name a few have adopted TBEX in their application packages.

The XML file will allow you to:

  • Modify the dashboard to include one or more links to your website, or articles to help the user get started with your application.

wpsiteitems

  • Modify the ribbon in WebMatrix to include shortcuts, such as your community resources or the administrative console of your application.

ribbon

  • Protect core application files from being edited.

warning

  • Provide enhanced Intellisense or code completion for your application’s API as seen here

intellisense

TBEX File Template

Here is a Template of a sample TBEX file that can be used to build your own TBEX file for your application:

<WebPlatform>
<!--LINKS SECTION -->
<!-- This section allows you to add Links on your Web Matrix dashboard  . You can include the links to documentation for your application; forums; blog etc.      -->
<Links>

<!--AddLink here creates a link to Getting started page of your website -->

    <AddLink InDashboard="True" InLearn="True">
      <Title>Getting started</Title>
      <Description>This is a tutorial for beginners.</Description>
      <Uri>
http://somewebsite.com/</Uri>
      <Uri xml:lang="es">
http://somewebsite.com/es/gettingstarted</Uri>
      <Uri xml:lang="fr">
http://somewebsite.com/fr/gettingstarted</Uri>       
      <ImageUri>
http://somewebsite.com/images/icon.png</ImageUri>
    </AddLink>

<!--AddLink here creates a link to Support Forums  -->

   <AddLink InDashboard="True">
      <Title>Forums</Title>
      <Description>The support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.</Description>
      <Uri>
http://somewebsite.com/forums</Uri>     
      <ImageUri>
http://somewebsite.com/images/icon.png</ImageUri>
    </AddLink>

    <!--You can add many more GO TO links  here that are specific to your application for Web Matrix users  -->
</Links>
<!-- END LINKS SECTION -->


<!--RIBBON SECTION-->
<!--This section allows you to modify Web Matrix Ribbon section to include shortcuts to a link that could be specific to the website that was created (admin console link ) or external link -->
<Ribbon>
<!--This adds a ribbon button that will direct the user to the administrative console for the application site that was created on Web Matrix -->
    <AddRibbonButton>
      <Label>Site Admin</Label>
      <Uri>/admin</Uri>
    <ImageUri>
http://somewebsite.com/images/icon.png</ImageUri>
    </AddRibbonButton>
<!--This adds a ribbon button that references an external link as seen here -->
    <AddRibbonButton>
      <Label>Community</Label>
      <Uri>
http://somewebsite.com/</Uri>     
       <ImageUri>
http://somewebsite.com/images/icon.png</ImageUri>
    </AddRibbonButton>
  </Ribbon>
<!--END OF RIBBON SECTION -->
<!--PATH PROTECTION SECTION-->
<!--This Section allows you to protect some of the files by displaying a warning to the user that they should not be editing this file and if you do so you may break the application -->
  <PathProtection>
    <AllowPath>
     <!--Relative path for desired file or folder , say 'app' folder -->
      <RelativePath>app</RelativePath>
    </AllowPath>

<!--allows access to files within subfolders then set AllowNested to True. If this is specific for a file then set this to False. The default value for AllowNested is always false -->
    <AllowPath AllowNested="False">
      <RelativePath>config.php</RelativePath>
    </AllowPath>
    <ProtectPath>
<!--  A warning will be displayed when users edit the file or files mentioned in this Path -->
      <RelativePath>*</RelativePath>
    </ProtectPath>
  </PathProtection>
<!--CODE COMPLETION SECTION -->
<!-- This is an Optional Section and used if your application is PHP based application  -->
<CodeCompletion>
<!--Enter the PHP version  -->
<php version="5.3" schemaversion="1.0">
<!-- This section provides Intellisense in Web Matrix for your application APIs. -->
<!-- relformatstring points to a link to the API reference page for your application  -->
  <relformatstring>
http://somewebsite.com/api/reference</relformatstring>
  <globalfunctions>
<!-- This shows your  custom icon next to the API in the editor -->
    <iconurl>
http://somewebsite.com/images/icon.png</iconurl>
    <items>
    <!-- This is an example for an  API called get_post(id) which gets the post content referenced by the id passed as an argument -->
      <item name= "get_post">
        <description>Retrieve post with ID. </description>
        <signature>get_post( $id )</signature>
        <docrelurl>get_post</docrelurl>
      </item>  
     <!-- Add a new <item> element for every API -->   
    </items>    
  </globalfunctions>
  </php>
</CodeCompletion>
</WebPlatform>

You can discuss this article using the adjacent Facebook talkback.

For technical questions please visit our discussion forums, where we have a vibrant community of developers like you, as well as Microsoft engineers who are ready to answer your questions!