core icon indicating copy to clipboard operation
core copied to clipboard

RESTFul save improvement

Open wezell opened this issue 13 years ago • 7 comments

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

wezell avatar Jul 31 '13 13:07 wezell

we already specify structure in the data as stInode. We can make the alternative of stName that we have use in other places :)

dotjorgeu avatar Jul 31 '13 20:07 dotjorgeu

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.

wezell avatar Jul 31 '13 20:07 wezell

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.

dotjorgeu avatar Jul 31 '13 20:07 dotjorgeu

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

dotjorgeu avatar Jul 31 '13 20:07 dotjorgeu

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 .

dotcmsCodeReview avatar Jul 31 '13 20:07 dotcmsCodeReview

ok updated documentation http://dotcms.com/docs/latest/RESTSaveContent

dotjorgeu avatar Jul 31 '13 20:07 dotjorgeu

Verified documention, highlighted it a bit: http://dotcms.com/docs/latest/RESTSaveContent

DeanGonzalez avatar Feb 05 '15 22:02 DeanGonzalez