<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:plone="http://namespaces.plone.org/plone"
    >

  <include
      package="plone.tiles"
      file="meta.zcml"
      />

  <plone:tile
      name="newpostbox.tile"
      title="A tile to add a new post"
      description="A tile to add a new post"
      for="*"
      class=".newpostbox_tile.NewPostBoxTile"
      permission="ploneintranet.microblog.AddStatusUpdate"
      add_permission="cmf.ManagePortal"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="update-social.html"
      for="*"
      class=".update_social.UpdateSocialView"
      template="templates/update-social.html"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="update-social.html"
      for="ploneintranet.microblog.interfaces.IStatusUpdate"
      class=".update_social.StatusUpdatePostBoxView"
      template="templates/update-social.html"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="add-reply-to-reply"
      for="*"
      class=".update_social.AddReplyToReplyView"
      template="templates/update-social.html"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="first-comment.html"
      for="*"
      class=".update_social.FirstCommentView"
      template="templates/update-social.html"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="post-well-done.html"
      for="*"
      class=".post_well_done.PostWellDoneView"
      template="templates/post-well-done.html"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="comment-well-said.html"
      for="*"
      class=".comment_well_said.CommentWellSaidView"
      template="templates/comment-well-said.html"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="post"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".post.StandalonePost"
      template="templates/post.pt"
      permission="ploneintranet.microblog.ViewStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="post"
      for="ploneintranet.microblog.interfaces.IMicroblogContext"
      class=".post.StandalonePost"
      template="templates/post.pt"
      permission="ploneintranet.microblog.ViewStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="post-comments"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".post.PostComments"
      permission="ploneintranet.microblog.ViewStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="post-comments"
      for="ploneintranet.microblog.interfaces.IMicroblogContext"
      class=".post.PostComments"
      permission="ploneintranet.microblog.ViewStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="panel-tags"
      for="*"
      class=".panel_tags.Tags"
      template="templates/panel_tags.pt"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:page
      name="panel-users"
      for="*"
      class=".panel_users.Users"
      template="templates/panel_users.pt"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />


  <!-- This is a very special admin view.

It converts statusupdate attachments to content objects if:
- the statusupdate has a microblog_context i.e. is in a workspace,
  i.e. is not in the global stream
- the statusupdate has no content context i.e. is not in the stream
  of another content object

You can either run this view against the portal root, and then it will
run a global dump-and-extract. Or you can run it against a workspace,
in which case it will limit itself to converting only attachments for
statusupdates posted in that workspace.

It requires 'manage portal' for obvious reasons.

This view is idempotent, it can be ran repeatedly without problems.
-->

  <browser:view
      name="extract-attachments"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".extract.StreamExtractAttachments"
      permission="cmf.ManagePortal"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <browser:view
      name="extract-attachments"
      for="ploneintranet.microblog.interfaces.IMicroblogContext"
      class=".extract.StreamExtractAttachments"
      permission="cmf.ManagePortal"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />

  <!-- a helper view that is not traversed,
     but used by other views -->

  <browser:view
      name="extract-attachments"
      for="ploneintranet.microblog.interfaces.IStatusUpdate"
      class=".extract.StatusupdateExtractAttachments"
      permission="ploneintranet.microblog.AddStatusUpdate"
      layer=".interfaces.IPloneIntranetMicroblogLayer"
      />


</configure>
