RESTFul save improvement
There is a lot of nice work in the RESTful save already and this might already be in there, but we should be able to specify the structure by velocity var name as well, instead of stInode. Maybe we should allow this even in the URL with just calling it "structure"
curl -v -u [email protected]:admin -XPUT http://localhost:8080/api/content/structure/News/publish/1
http://dotcms.com/docs/latest/RESTSaveContent
we already specify structure in the data as stInode. We can make the alternative of stName that we have use in other places :)
Right, that is what I was looking for - specifying the structure by velocityVar name. Extra cool points will be granted if you can specify it in the url.
having two places to give content data doesn't look that nice IMHO. until now the url only tells the action to do with the content. nothing about content data.
oh oh oh wait!!! we already have it
if(!UtilMethods.isSet(stInode)) {
String stName=(String)map.get("stName");
if(UtilMethods.isSet(stName)) {
stInode = StructureCache.getStructureByVelocityVarName(stName).getInode();
}
}
Just need documentation
Nice. good to see. To your other point - the structure of a contentlet is not really the same thing content data - it is more like (in an abstract sense) the table in which that content is stored - like the type in elasticsearch.
http://www.elasticsearch.org/guide/reference/api/index_/
Jorge, if you could, make sure the documentation reflects the stName
Will Ezell http://dotcms.com phone: (305) 900-2001 ext. 7010 direct: (978) 294-9429 https://www.google.com/voice/b/0?pli=1#phones skype: wezell1
On Wed, Jul 31, 2013 at 4:44 PM, Jorge Urdaneta [email protected]:
oh oh oh wait!!! we already have it
if(!UtilMethods.isSet(stInode)) { String stName=(String)map.get("stName"); if(UtilMethods.isSet(stName)) { stInode = StructureCache.getStructureByVelocityVarName(stName).getInode(); } }Just need documentation
—
Reply to this email directly or view it on GitHubhttps://github.com/dotCMS/dotCMS/issues/3537#issuecomment-21894142 .
ok updated documentation http://dotcms.com/docs/latest/RESTSaveContent
Verified documention, highlighted it a bit: http://dotcms.com/docs/latest/RESTSaveContent