SLING / CRX
Export node:
curl -o mynode.xml -u admin:admin "http://127.0.0.1:8080/content/mynode.sysview.xml"
Import node:
curl -u admin:admin -F:operation=import -F:contentType=jcr.xml -F:name=mynode -F:contentFile=@mynode.xml http://127.0.0.1:8080/content
Create new user:
curl -u admin:admin -F:name=nimda -Fpwd=Password123 -FpwdConfirm=Password123 http://127.0.0.1:8080/system/userManager/user.create.html
Create new group:
curl -u admin:admin -F:name=UserAdmin http://localhost:8080/system/userManager/group.create.html
Add user to group:
curl -u admin:admin -F ":member=nimda" http://localhost:8080/system/userManager/group/UserAdmin.update.html
List of users in group:
curl -u admin:admin http://localhost:8080/system/userManager/group.tidy.1.json
How to create user in sling with administrator rights: add user into UserAdmin group does not work. Instead of it, put username into
System Console / OSGi / Configuration / "Apache Jackrabbit Oak Authorization Configuration" / Administrative Principals
http://127.0.0.1:8080/system/console/configMgr
Whitelist
Are you using loginAdministrative and getting "Bundle org.apache.sling.scripting.core is NOT whitelisted"?
Sling whitelist problem like:
02.03.2017 19:11:13.842 *ERROR* [xx.xx.xx.xx [xxx] GET /xxx.jsp
HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
javax.jcr.LoginException: Bundle org.apache.sling.scripting.core is NOT whitelisted
at org.apache.sling.jcr.base.AbstractSlingRepository2.loginAdministrative(AbstractSlingRepository2.java:378)
at org.apache.jsp.apps.xxx.components.xxx.xxx_jsp._jspService(xxx_jsp.java:130)
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
Open http://127.0.0.1:8080/system/console/configMgr
Find Apache Sling Login Admin Whitelist and click "Bypass the whitelist" like this:
__ sling
| |__ config
| |__ felix
| |__ logs
| |__ org.apache.sling.launchpad.base.jar (to je base, nic s nim nedělám)
| |__ atd…
|
|__ org.apache.sling.launchpad-9-SNAPSHOT.jar (přes něj spouštím server)
muj-pc$ java -jar org.apache.sling.launchpad-9-SNAPSHOT.jar nebo s nastavením: muj-pc$ java -Dfile.encoding=UTF-8 -Xmx1524M -XX:MaxPermSize=256m -jar org.apache.sling.launchpad-9-SNAPSHOT.jar -p 61480