Monday, May 07, 2007

adding a new file type with a new image associated with it

Most people want to add new file types into the system. Say you want to add avi's or mp3's. You can just upload them, but you get that funky file icon . It would be much cooler if you can change it to something else. There is just a bit involved in doing it, but here are the steps.

First go to the Global Content type map and create a new one. Make sure your new mime type identifier is all the way at the top.

Second go to the file type page. Add a new identifier here for the *.wmv extension. Also move it to the top. Finish out of here.

Next go to the db. In the table ptdocumenttypes there is a field called imageuuid. Take a look at that field for the content type you created before. Make sure it is a different number than the one for the Non Indexed Files Content type (objectid 107). If the number is the same, then go ahead and pick a few numbers in your imageuuid and change them. Be sure to copy the new string, because you will need it later. Also note the objectid of your content type.

Next open the table ptdoctypeinfo. If there is not an entry for your content type enter it now. Otherwise update it. You only need the objectid and the imageuuid. They map to docuemnttypeid and cardimageuuid respectively.

Now upload a wmv file to the kd. This should come up with the missing image icon. That is a good sign. Go to ptimages/.../plumtree/portal/public/img/ and create your icon with the correct name. It is that string you copied before. There are pleanty examples in the location.
one thing to note is that you will have to reupload all the existing files or change them another way.