[opencms-dev] Adding New Resource Type - Doesn't Appear!!!

Millo Magnocavallo millo_magno at yahoo.com
Wed Sep 8 22:54:05 CEST 2004


Hi,

I have a problem adding a new resource type, htmlRedirect. I follow the
procedure outlined in the book by Matt as follows:

- Add the new java file CmsResourceTypeHtmlRedirect.java file into
src/com/opencms/file/

- edit the file
/opencms/src/com/opencms/workplace/workplace_en.properties prior to
compiling and add the following properties:
	fileicon.htmlRedirect=HTML Redirect

- recompile source with ant using 'ant war' and replace old war in
tomcat.

- I needed to re-setup opencms as i found that if i didn't the
interface lost it's reference to img and js files (don't know why) and
went all askew.

- went into /system/workplace/restypes/ and copied the plain file.
edited the source code by amending the first line to the following:

vi.resource[resource_id]=new
res("htmlRedirect","language_key(fileicon.htmlRedirect)",
vi.iconPath+"ic_file_plain.gif",
"explorer_files_new_othertype.html?initial=true&type=htmlRedirect",true);

(line breaks added above for readability).

- published the new file (to be on the safe side)


** The problem occurs at the next step where I am required to go into
the Properties Management in administration and add properties to this
new file type. It doesn't appear in the pop up window along with the
other file types.

Can anyone help me out as to why this could be happening? I've
restarted tomcat also thinking it might have had something to do with
this but no luck.

I've also attached a copy of the new CmsResourceTypeHtmlRedirect.java
in case anyone wants to take a look.

Any help appreciated.

Thanks,
Millo 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CmsResourceTypeHtmlRedirect.java
Type: application/octet-stream
Size: 1349 bytes
Desc: CmsResourceTypeHtmlRedirect.java
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040908/283d7293/attachment.obj>


More information about the opencms-dev mailing list