Return-Path: Delivered-To: apmail-roller-user-archive@www.apache.org Received: (qmail 59725 invoked from network); 19 Oct 2007 01:04:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Oct 2007 01:04:43 -0000 Received: (qmail 48461 invoked by uid 500); 19 Oct 2007 01:04:30 -0000 Delivered-To: apmail-roller-user-archive@roller.apache.org Received: (qmail 48434 invoked by uid 500); 19 Oct 2007 01:04:30 -0000 Mailing-List: contact user-help@roller.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@roller.apache.org Delivered-To: mailing list user@roller.apache.org Received: (qmail 48424 invoked by uid 99); 19 Oct 2007 01:04:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 18:04:30 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of snoopdave@gmail.com designates 64.233.184.225 as permitted sender) Received: from [64.233.184.225] (HELO wr-out-0506.google.com) (64.233.184.225) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2007 01:04:34 +0000 Received: by wr-out-0506.google.com with SMTP id l58so303059wrl for ; Thu, 18 Oct 2007 18:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Gnw+X6nyzLuHWjvSyGB0Bj6U9nlWXmDJamc5ClAGt+8=; b=TnNcX4vzk9CKf4Cj7uVtpuA5WEQ2K24e8xg65HszznPhzrFC824rB0agJvAJ7W9k39XzsGmq8ZLuSbnajJETU30pvBuloNc1/VuF0R3VP/dz0UiCDsh+K2HbePOSBmQ80gnyuO3YH9skWKoQKulncvb6KA4tMygwtBEcL5BWfVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Yx07rYfHDjEBK/kngEd/TFq2uKRVbNt0YeJ2hQgXCn4l5NJ3PXd1diixUjMMo/DbJV+P3+bmKR66Lm/3bSMeD/H3RCkjpiZf9814ed9xo48EFJJSAqXQN9acYKlxR1ASjlamj9Z17BkuC4GX480PCseaBrIale/YbDYV31BVQEc= Received: by 10.90.49.1 with SMTP id w1mr1926451agw.1192755853252; Thu, 18 Oct 2007 18:04:13 -0700 (PDT) Received: by 10.90.53.9 with HTTP; Thu, 18 Oct 2007 18:04:13 -0700 (PDT) Message-ID: <8fb9ac720710181804r1db707c4ieacfcebaabb9ea3c@mail.gmail.com> Date: Thu, 18 Oct 2007 21:04:13 -0400 From: Dave To: user@roller.apache.org Subject: Re: Is it possible to post to resources/subdir directory? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org On 10/17/07, Tatsuya Noyori wrote: > I am using roller4.0RC8 and rome propono0.6. > I can post GIF files to resouces directory with below code, but I > can't post to resources/subdir directory. > The subdir on Roller can be made by anyone using web browser and the > subdir is very useful to preserve categorized files. So I would like > to ask the following question. > > Q1. Is it possible to post to resources/subdir directory? > I would be grateful if someone answer me. Yes. But 1) the sub-directory must exist and 2) you must post to the collection that represents the sub-directory. > ClientCollection collection = (ClientCollection) > workspace.findCollection(null, "entry"); OK, now you have found a collection that can accept an entry. > if (collection != null) { > ClientMediaEntry entry = collection.createMediaEntry( > title, slug, "image/gif", new FileInputStream(filepath)); Wrong. You should not post an "image/gif" to a collection that accepts only entries. You should call workspace.findCollection(null, "image/gif") to find a collection that will accept GIF images. The resource directory and each of it's sub-directories is represented as a collection, so you'll have to iterate through the collections to find the one you want. - Dave