[Midas] duplicate filename items?
Michael Grauer
michael.grauer at kitware.com
Wed Oct 24 12:14:51 EDT 2012
Hi Mona,
I worked through these API calls of yours, they seem reasonable and that
they wouldn't change the item name.
One thing to consider, midas.item.create can be used to create an item, or
modify an existing item. "name" is a required param whether you are
creating or editing, but if you are editing, and you pass a different name
than the original name, the name of the item will be changed. Is it
possible that sometimes you are not passing up the (20) extension with the
name and hence changing the name of the item when adding the metadata?
We've added the API calls for item.setmetadata and
item.setmetadatamultiple, you could use those instead of item.create to set
your metadata, assuming your server version has these API calls. This
would at least eliminate the chance of accidentally renaming.
Thanks,
Mike
On Mon, Oct 22, 2012 at 5:44 PM, Mona Wong <mona at sdsc.edu> wrote:
>
> Hi Patrick & Michael:
>
> Ok, I have a bit more information about the duplicate filenames issue:
>
> 1. For the same code, it is inconsistent...sometimes it duplicate
> filenames and sometimes it appends the (#)...hard to debug, I know, sorry.
> Attached is an image that shows both duplicate filename and files with (#)
> appended:
>
>
> 2. Here is the sequence of code steps:
>
> a.
> https://ourserver.edu/api/json?method=midas.item.create&useSession&parentid=679&name=rkd2_merged_phase001.nii.axml&privacy=Private
>
> b.
> https://ourserver.edu/api/json?method=midas.upload.generatetoken&useSession&itemid=62933&filename=rkd2_merged_phase001.nii.axml(20)
>
> c.
> https://ourserver.edu/api/json?method=midas.upload.perform&uploadtoken=13/62933/rkd2_merged_phase001.nii.axml(20)f4QDTF&filename=rkd2_merged_phase001.nii.axml
> (20)&length=838&folderid=null&itemid=62933
>
> d.
> https://ourserver.edu/api/json?method=midas.item.create&useSession&name=rkd2_merged_phase001.nii.axml(20)&uuid=5085ba73ceaab2c352eb7122e0979f664998e7e152e1d&privacy=Private&_user
> name=Mona Wong&_timestamp=10/22/2012 14:28&_ontology term 1=mid myocardium
>
> Of course, the above steps created the corrected filename (with (20)
> appended). Though it is the same steps that sometimes create files with
> duplicate name. If I can find a pattern that can reliably reproduce the
> duplicate filenames, I'll let you know.
>
> cheers,
> Mona
>
>
>
>
> On Oct 22, 2012, at 7:24 AM, Michael Grauer wrote:
>
> Hi Mona,
>
> Can you describe how you are getting to this and what the exact problem
> would be with how your users would interact with Midas when they encounter
> this situation?
>
> I just tested with a Midas 3.2.8 instance. I could upload a file into a
> folder where an item "item1.txt" already existed with that name, using the
> Midas web UI uploader, and the new item was created as "item1.txt (1)". I
> also tried this with the latest version of Pydas (0.2.24), and again the
> item name had a numeric suffix, "item1.txt (2)". Once I had these items in
> the folder, I was able to change their names using the edit action on the
> Item so that all of the item names were the same.
>
> Thanks,
> Mike
>
>
> *********************************************
> Mona Wong
> Web & iPad Application Developer
> San Diego Supercomputer Center
>
> "Forgive everyone everything."
> -- Regina Brett
> *********************************************
>
>
>
>
>
--
Thanks,
Michael Grauer
R & D Engineer
Kitware, Inc.
919 969 6990 x322
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20121024/eb18f55f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2012-10-22 at 2.44.02 PM.png
Type: image/png
Size: 152446 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/midas/attachments/20121024/eb18f55f/attachment-0002.png>
More information about the Midas
mailing list