Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • common practice of managing metadata with Slide

    5 answers - 3010 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I realized that proppatchmethod will create a new version for a versioned
    resource.
    if this is true, I am afraid that I cannot make use of this mechanism to
    support custome properties.
    Is it really true ?
    The specific custome property I would like to have is a list of users who
    are interested in the update of the resource (file or folder). I wanted to
    do something when the watched resource is changed (new version uploaded, or
    deleted for example).
    I notice that there is a subscribe method, but do not know how to program
    it; googled but did not find detailed enough examples.
    any idea ?
    3/7/06, Max Pfingsthorn <m.pfingsthorn (AT) hippo (DOT) nlwrote:
    Hi!
    Slide already takes care of almost all your meta data:
    - manage file version
    This is done by the deltav versioning extension to webdav, see
    - show submitter information, file type, file size info
    This information is contained in <DAV:owner/>, <DAV:getcontenttype/>,
    <DAV:getcontentlength/>
    - show locked by
    If a resource (document) is locked, it will have a <DAV:lockdiscovery/>
    property. In that property, there is some xml which also mentions the owner
    of the lock. Be aware that reading a locked resource is always possible,
    however writing to it (or affecting is state in any other way) is only
    possible when you specify the lock token, which is also mentioned in the
    lockdiscovery property. So someone can hijack your lock. It is really up to
    your application to get this right, but generally it is not a problem.
    See #METHD_LCK and
    #locking for more information.
    - support folder structure
    Webdav organizes documents into folders, called "collections" in webdav
    terms. So does slide, of course.
    As I mentioned before, the PRPPATCH method can be used to set arbitrary
    properties, custom ones as well. See
    #METHD_PRPPATCH for more
    information.
    Bye and good luck!
    max
    Message
    From: Lixin Chu [mailto:lixin.chu (AT) gmail (DOT) com]
    Sent: Tuesday, March 07, 2006 10:55
    To: Slide User
    Subject: common practice of managing metadata with Slide
    --
    Hello,
    would like to seek advice on the common practice of managing
    metadata with
    Slide.
    i am working on a typical (hopefully) doc management
    appliaction, which
    requires:
    - manage file version
    - show submitter information, file type, file size info
    - show locked by
    - support folder structure
    so what's the common way of managing these meta-data info ?
    should I leave
    them to Slide or should I create a database table to manager these
    information ?
    and which solution gives better performance ?
    thanks in advance!
    lixin
    --
    To unsubscribe, e-mail: slide-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: slide-user-help (AT) jakarta (DOT) apache.org
    --
  • No.1 | | 1909 bytes | |

    6/12/06, Lixin Chu <lixin.chu (AT) gmail (DOT) comwrote:
    I realized that proppatchmethod will create a new version for a versioned
    resource.

    if this is true, I am afraid that I cannot make use of this mechanism to
    support custome properties.

    Is it really true ?

    The specific custome property I would like to have is a list of users who
    are interested in the update of the resource (file or folder). I wanted to
    do something when the watched resource is changed (new version uploaded, or
    deleted for example).

    I notice that there is a subscribe method, but do not know how to program
    it; googled but did not find detailed enough examples.

    any idea ?

    As of the notification :

    2 make a long story short you have to implement your subscriber (
    implements ) in order to reply to the
    listener. The method that's being called is public void notify(String
    uri, Map information) ; This way you can implement your emailer .

    What I did was mantaining a list of users/resource/type of
    subscription in a private webdav folder so that I didn't have to
    bother with users deleting properties that mattered from the resources
    themselves .

    In my implementation of Subscriber I had something like

    public void notify(String uri, Map information) {
    printInfos(uri,information,logger);
    if ( users != null && !users.isEmpty() ){
    sendSmtpMail(message + "\n\n" +
    createMessageBody(uri,information));
    } else {
    logger.warning("users list is empty");
    }
    }

    Then you have to implement your own methods for sending email .

    I'll come back on this if you need more.

    Cheers

    Marco

    To unsubscribe, e-mail: slide-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: slide-user-help (AT) jakarta (DOT) apache.org
  • No.2 | | 2163 bytes | |

    Hi Marco,
    I am also interested in how you organize your private folder where you keep
    the resource/user/type information.

    thanks
    lixin

    6/12/06, Marco Ferretti <marco.ferretti (AT) gmail (DOT) comwrote:

    6/12/06, Lixin Chu <lixin.chu (AT) gmail (DOT) comwrote:
    I realized that proppatchmethod will create a new version for a
    versioned
    resource.

    if this is true, I am afraid that I cannot make use of this mechanism to
    support custome properties.

    Is it really true ?

    The specific custome property I would like to have is a list of users
    who
    are interested in the update of the resource (file or folder). I wanted
    to
    do something when the watched resource is changed (new version uploaded,
    or
    deleted for example).

    I notice that there is a subscribe method, but do not know how to
    program
    it; googled but did not find detailed enough examples.

    any idea ?
    --
    As of the notification :

    2 make a long story short you have to implement your subscriber (
    implements ) in order to reply to the
    listener. The method that's being called is public void notify(String
    uri, Map information) ; This way you can implement your emailer .

    What I did was mantaining a list of users/resource/type of
    subscription in a private webdav folder so that I didn't have to
    bother with users deleting properties that mattered from the resources
    themselves .

    In my implementation of Subscriber I had something like

    public void notify(String uri, Map information) {
    printInfos(uri,information,logger);
    if ( users != null && !users.isEmpty() ){
    sendSmtpMail(message + "\n\n" +
    createMessageBody(uri,information));
    } else {
    logger.warning("users list is empty");
    }
    }
    --
    Then you have to implement your own methods for sending email .

    I'll come back on this if you need more.
    --
    Cheers

    Marco

    To unsubscribe, e-mail: slide-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: slide-user-help (AT) jakarta (DOT) apache.org
    --
  • No.3 | | 3582 bytes | |

    Hi Marco,
    thanks for your info. some questions: the webdavResoruce has one method:

    public Subscription
    <>
    *subscribeMethod*(java.lang.String path,
    java.lang.String notificationType,
    java.lang.String callback,
    long notificationDelay,
    int depth,
    long lifetime)

    I suppose this is used to tell Slide that I am interested in the change made
    to the 'path'. But I do not know how to register the Subscriber. and also
    what do we have in the Map information ? the API doc does not tell us more
    abt this though.

    more question, does this subscribeMethod is valid for the current http
    session ? I am developing a Struts+Spring based web application. The feature
    is something like this:

    user can subscribe to the changes made to the resources (files/folders)
    when something happened, a notification msg is sent by Slide to my web
    application; the web application then log necessary information, like who
    and what action was done to the resource.

    Does your solution work in this way:
    - when we start the web application, we check a special folder in Slide to
    get any existing subscritions, then webdavResource.subscribeMethod() one by
    one with a long enough lifetime;
    - when user wants to monitor a resource, the web application add the
    request into the special folder, and also webdavResource.subscribeMethod()
    it.
    - when a notification arrives, the registered Subscriber class will get the
    user list and send msg to all subscribers

    thanks !

    6/12/06, Marco Ferretti <marco.ferretti (AT) gmail (DOT) comwrote:

    6/12/06, Lixin Chu <lixin.chu (AT) gmail (DOT) comwrote:
    I realized that proppatchmethod will create a new version for a
    versioned
    resource.

    if this is true, I am afraid that I cannot make use of this mechanism to
    support custome properties.

    Is it really true ?

    The specific custome property I would like to have is a list of users
    who
    are interested in the update of the resource (file or folder). I wanted
    to
    do something when the watched resource is changed (new version uploaded,
    or
    deleted for example).

    I notice that there is a subscribe method, but do not know how to
    program
    it; googled but did not find detailed enough examples.

    any idea ?
    --
    As of the notification :

    2 make a long story short you have to implement your subscriber (
    implements ) in order to reply to the
    listener. The method that's being called is public void notify(String
    uri, Map information) ; This way you can implement your emailer .

    What I did was mantaining a list of users/resource/type of
    subscription in a private webdav folder so that I didn't have to
    bother with users deleting properties that mattered from the resources
    themselves .

    In my implementation of Subscriber I had something like

    public void notify(String uri, Map information) {
    printInfos(uri,information,logger);
    if ( users != null && !users.isEmpty() ){
    sendSmtpMail(message + "\n\n" +
    createMessageBody(uri,information));
    } else {
    logger.warning("users list is empty");
    }
    }
    --
    Then you have to implement your own methods for sending email .

    I'll come back on this if you need more.
    --
    Cheers

    Marco

    To unsubscribe, e-mail: slide-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: slide-user-help (AT) jakarta (DOT) apache.org
    --
  • No.4 | | 2118 bytes | |

    6/13/06, Lixin Chu <lixin.chu (AT) gmail (DOT) comwrote:
    Hi Marco,
    thanks for your info. some questions: the webdavResoruce has one method:

    public Subscription
    <>
    *subscribeMethod*(java.lang.String path,
    java.lang.String notificationType,
    java.lang.String callback,
    long notificationDelay,
    int depth,
    long lifetime)
    --
    I suppose this is used to tell Slide that I am interested in the change made
    to the 'path'. But I do not know how to register the Subscriber. and also
    what do we have in the Map information ? the API doc does not tell us more
    abt this though.

    Actually, what I do is I create a listener and then add subscribers to
    it so that I can get the callbacks I don't create subscriptions
    but Subscriber(s)

    more question, does this subscribeMethod is valid for the current http
    session ? I am developing a Struts+Spring based web application. The feature
    is something like this:

    user can subscribe to the changes made to the resources (files/folders)
    when something happened, a notification msg is sent by Slide to my web
    application; the web application then log necessary information, like who
    and what action was done to the resource.
    I use it as a process instantiated by the server ; it is a servlet
    that runs in background, so I suppose yes

    Does your solution work in this way:
    - when we start the web application, we check a special folder in Slide to
    get any existing subscritions, then webdavResource.subscribeMethod() one by
    one with a long enough lifetime;
    - when user wants to monitor a resource, the web application add the
    request into the special folder, and also webdavResource.subscribeMethod()
    it.
    - when a notification arrives, the registered Subscriber class will get the
    user list and send msg to all subscribers

    Exactly .
    thanks !

    no probs .

    To unsubscribe, e-mail: slide-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: slide-user-help (AT) jakarta (DOT) apache.org
  • No.5 | | 1811 bytes | |

    6/13/06, Lixin Chu <lixin.chu (AT) gmail (DOT) comwrote:
    Hi Marco,
    I am also interested in how you organize your private folder where you keep
    the resource/user/type information.

    Well, my problem was that I had to enable users to watch files in a
    document management system,

    RT -
    |
    user ( as collection )
    |
    UrlEncoder.encode(path/to/resource)
    ( as collection )

    where RT is the root path of your private directory ( collection ) .
    The user collection has the same name as the username; I keep the
    e-mail address as a property of the collection .
    Each path has a property that says which type of subscriptions are
    submitted for the current user.

    Then, in my servlet, I create a listener on the RT directory, so
    that I am notified of every change in the tree and I can operate with
    subscribing & unsubscribing in the servlet itself. The system operates
    in the directory ( never directly on webdav subscriptions ) : there is
    only one class that minds about the callbacks.

    More, internally ( in memory ) data is organized a little differently
    than on disk : since you get the callback for the resource ( a path )
    you need to organize data in maps that have
    UrlEncoder.encode(path/to/resource) as key and the list of users
    subscribed as data.

    Another pit : I had ( on a tomcat based server ) to put the
    initialization of the servlet ( reading the dav tree and so on ) in a
    separate thread it was stopping the server for too long making
    impossible for the webdav server to start up properly.

    cheers

    Marco

    To unsubscribe, e-mail: slide-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: slide-user-help (AT) jakarta (DOT) apache.org

Re: common practice of managing metadata with Slide


max 4000 letters.
Your nickname that display:
In order to stop the spam: 9 + 8 =
QUESTION ON "Java"

EMSDN.COM