Asset listings - sort order

Can you sort asset listing by metadata, if you've used metadata keywords?


For example, I have the following:



<TR>

<TD><A href="%asset_URL%">%asset_metadata_DC.Title%</A><BR>%asset_metadata_DC.Description%</TD>

<TD class="resourceDetails1">%asset_file_size_readable%|%asset_metadata_DC.Format%</TD>

<TD class="resourceDetails2">%asset_metadata_Branch%</TD>

</TR>



and would like to sort by DC.Title or by Branch.



Perhaps asset listing is not the best option for this situation?

The asset listing currently does not allow you to sort on a metadata field. Though, assuming your DC.Title closely matches your filename, you could just sort on the Name attribute, perhaps?

We aren't really interested in using Name, because we have very little control over the way files (e.g. PDFs, Word documents, etc) are displayed. DC.Title provides us with a workaround for this.


It would seem to me that you have no choice but to have the file extension… or perhaps I don't know what I'm doing (highly likely).

The name attribute for a file is always the filename, including extension. The DC.Title field can be anything you like, but we can't sort on it yet. But, you can sort on the name attribute and display the DC.Title field instead.


Edited to make it clearer that the usefulness of this scenario assumes some similarity between the filename of the PDF/Word document and the friendly DC.Title text.

We have a distributed publishing environment, and little control over what people call their files.


Can you override the name field for files, or are you stuck with the name of the file that is uploaded?

You're stuck with the name.

In trying to find a solution to this problem, I have renamed a couple of files on their details screens. When I do this, Matrix gives and error message saying that the file can't be renamed and it has to be uploaded. Now that I've tried that it's caused all kinds of other errors. For example, when I view the asset listing those files are supposed to appear in, I can see them in the listing, but Matrix can't seem to find them. I've tried putting the names back to what they were, but Matrix doesn't like it at all (I'm getting message like "can't parse file", "file could not be updated").


Why is the name field displayed as editable for files if it causes so many problems when it's changed?

Sorry, I was wrong before. You can change the name but not the extension. If the name change is not working then it might be a bug in the system, so it should be reported in the bug tracker.

Just to be sure, I've tried it again.


Some of the problems start when spaces are included in the edited name. As long as you keep underscores in the name, most things seem to work the way they should. If spaces are introduced, the following happens:


  • Matrix can't find it to preview it.
  • The file can't be moved to trash (the following error message occurs: WARNING: Directory "/data/public/assets/file/7166" doesn't exist or is not writable

    Reported 18th Nov 2004 10:54am).
  • Matrix will still recognise it as a file and display it in asset listings, but if a URL is set up to the file, Matrix doesn't know where it is.



    However… if you do change the name (even if you're using underscores), the file can't be updated with a newer/different version.



    In our distributed publishing environment, where files are not necessarily given logical names for use on our websites, it's going to be very important for us to be able the edit the names of files. It's going to be especially important to be able to rename files if we can't sort by metadata (such as DC.Title).



    A bug, or a trap for young players?

I've also just tried putting an editied file name back to exactly what it was when it was uploaded. Matrix didn't like that either… the following warning occurred:


MySource Warning

Current file not found. Upload a file before renaming.



It appears that the file is lost!