Can the REST API be used to read / write CSS in the /Design tree?

We’re on CM1 Version 4.5.4 Build 201412R11 on-premises in case it matters.  Why we’re not on a more recent version is a long story…

In [https://help.percussion.com/percussion-cm1/developers/index ] I don’t see a REST API mentioned for items in the /Design tree. I tried modifying the Assets example to retrieve an item in the /Design path but it’s raising an exception:

com.percussion.share.service.IPSDataService$DataServiceLoadException: java.lang.IllegalArgumentException: id must be an instance of com.percussion.services.guidmgr.data.PSLegacyGuid

https://our-host:9991/Rhythmyx/rest/assets/by-path/Design/web\_resources/themes/ACSF-New/import/host-name/iws2015/style/main.css

(“our-host” and “host-name” are our hostnames, which I changed to protect the innocent).

My goal is to create ‘gulp’ tasks to upload CSS as part of a SCSS build process, without having to visit the GUI every time.

So, should we be able to download/upload CSS from the /Design/… path through the REST API?  Is there another programmatic option I’m missing?  Should I resort to screen scraping / phantomjs-automating download/upload through the GUI?  Move our CSS to “assets” instead of “Design”?   Something else I’m missing?

Hi Jason,

The CM1 REST API doesn’t currently have a mapping for the Design section.   Since that directory is stored on the File System of the Percussion server, it may be better to take that route.  

Everything under Design maps to the /web_resources folder. So if you map that via SFTP / SCP / FTP / or a network share, your gulp task could push the files there directly.

Hope this helps.

-n

Helps a ton!  Like I said, I’m new.  The folks I work with here aren’t/weren’t even aware that filesystem access was an option.  I’ll follow up with the sysadmin folks who support our on-premises installation.

Followup question:  once uploaded to the filesystem of the Percussion server, is there a step I need to take to get these “published”, for lack of a more precise term, to the production server?  I’m pretty sure, but don’t know for sure, that the Percussion server runs on a different host from the production server (again, I’m probably getting the terminology wrong here). 

Thanks so much!

Jason

No problem! The web_resources folder is published to the web server when an Incremental or Full Publish of the website is run.    

There is an example of kicking off a publishing job with a script here: https://help.percussion.com/percussion-cm1/site-administration/configuring-scheduled-publishing/inde…

But keep in mind that this will publish content from the CMS (e.g. Pages & Assets) to the web server as well as the web_resources directory.  If you just want to publish the web_resources, you could copy that folder directly to the web server under the website’s document root. 

-n