cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify the content type in uploading via JCR?

lnoto
Champ in-the-making
Champ in-the-making
Hi all

Resuming a previous the discussion (see http://forums.alfresco.com/viewtopic.php?t=1381)
about specifying the content type in uploading to get Lucene to index the content.

I've got the same problem of nrk but my code can't use the Foundation API.
I can only take advantage of the JCR level's operations.
How could I specify the content type via JCR?

If not via code, I was trying to build up a rule to specify the type of a content using the javascript API,
but I can only access the mimetype. Ok, I've changed the mimetype with a rule on the inbound content.

Again, a strange thing happened when I changed the mimetype:
in the content's details the Content Type also changed (good!), then I was expecting that the Lucene had processed the content,
just in the same way as when we edit the content type by hand (it works). But nothing happened, and if we try to edit the props
of the content … the Content Type turns back to Octet Stream again (not so good)!
Do I miss something about how the props are committed? Maybe a problem to keep in synch the content type?

Could someone suggest me a way to change the content type via JCR primitives?
Also good if someone could know how to change the content type via jscript, rules, …

For now I'm waiting to have the web script for the content upload available in the community edition
(see http://forums.alfresco.com/viewtopic.php?t=7329), so I could use that one instead of writing code!

Thanks in advance,
Luigi
1 REPLY 1

davidc
Star Contributor
Star Contributor
For now I'm waiting to have the web script for the content upload available in the community edition
(see http://forums.alfresco.com/viewtopic.php?t=7329), so I could use that one instead of writing code!

It's in SVN HEAD now - and latest nightly builds.