> Kiyoko Takanabe wrote:
>
> > Hi, Remy.
> >
> > Thank you for your answer.
> > May I ask about. further details?
> >
> > I want to execute File quota per user.
> > Now, we extend the slide, Contentstore and DiscripterStore.
> >
> > In Slide, userid is not put into Contentstore and DiscripterStore.
> > I want to execute at there.
> > Can I get user's informations individually?
> >
> > Do you have any idea of how to do.
>
> You could extend the server PutMethod to store the "Owner" of the content
in a
> protected property.
> If the content and structure is in the same database you can then write a
> database trigger (or change the content store) to check for the total
size.
> select sum(revisioncontent.xnumber) from revisioncontent, property
> where revisioncontent.uri = property.uri and property.name="owner" and
> property.value="Kiyoko"
>
> A more generic way is to use that ContentInterceptor.preStoreContent but
then
> you have to walk the whole structure and that is slow. In this case you
have to
> keep the total number of bytes used as a property on the user. (You have
the
> SlideToken for the user info). In the preStoreContent you check if there
is
> enough room and put a lock on the user, in the postStoreContent you update
the
> bytes used and unlock user.
> We also have to change the ContentInterceptor and add a preRemoveContent
and
> postRemoveContent to allow you to decrease the used bytes after a remove.
> There is also a small issue, if the client doesn't send a content-length
header
> then you cannot know the content length until after the bytes are written
to the
> store and then you have to revert is the user is over his limit.
> The ContentInterceptor should also be changed to allow it to throw some
> exceptions (or return a status) to indicate the action must stop and to
indicate
> the put operation failed (send an error response to client).
Yes. I was starting to get frustrated by the lack of that possibility. The
problem is: what exception should we allow to throw (ServiceAccessException
? a runtime exception ?). As you mention, a status code could be enough too.
I didn't want to add a new checked exception (there are already enough).
> The second solution has the advantage that you can give each user a
different
> quota size (also a property on user).
> With the first solution this is not that easy because the store doesn't
know the
> identity of the user.
I think there's something missing in the PROPPATCH implementation, since I
don't think it currently prevents modifying the protected properties (bad).
Remy