07-28-2009 09:02 AM
07-28-2009 09:13 AM
07-28-2009 09:50 AM
Array getMembers(ScriptNode group, boolean recurse)
Returns an Array of people nodes belonging to the specified group. People of sub-groups are only returned if recurse is specified as true.
authorityService.getContainedAuthorities(AuthorityType authType, String authName, Boolean recursive);
07-30-2009 09:08 AM
{
"status" :
{
"code" : 500,
"name" : "Internal Error",
"description" : "An error inside the HTTP server which prevented it from fulfilling the request.
"
},
"message" : "06300044 Wrapped Exception (with status template): 06300043 Failed to execute script '
\/org\/alfresco\/repository\/person\/customGroupMembers.get.js (in classpath store file:C:\/Alfresco
\/tomcat\/webapps\/alfresco\/WEB-INF\/classes\/alfresco\/templates\/webscripts)': 06300042 Can't find
method org.alfresco.repo.jscript.People.getMembers(org.alfresco.repo.security.authority.script.ScriptGroup
,boolean). (file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF\/classes\/alfresco\/templates\/webscripts
\/org\/alfresco\/repository\/person\/customGroupMembers.get.js#10)",
"exception" : "org.alfresco.web.scripts.WebScriptException - 06300044 Wrapped Exception (with status
template): 06300043 Failed to execute script '\/org\/alfresco\/repository\/person\/customGroupMembers
.get.js (in classpath store file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF\/classes\/alfresco
\/templates\/webscripts)': 06300042 Can't find method org.alfresco.repo.jscript.People.getMembers(org
.alfresco.repo.security.authority.script.ScriptGroup,boolean). (file:C:\/Alfresco\/tomcat\/webapps\/alfresco
\/WEB-INF\/classes\/alfresco\/templates\/webscripts\/org\/alfresco\/repository\/person\/customGroupMembers
.get.js#10)",
"callstack" :
[
"" ,"org.mozilla.javascript.EvaluatorException: Can't find method org.alfresco.repo.jscript
.People.getMembers(org.alfresco.repo.security.authority.script.ScriptGroup,boolean). (file:C:\/Alfresco
\/tomcat\/webapps\/alfresco\/WEB-INF\/classes\/alfresco\/templates\/webscripts\/org\/alfresco\/repository
\/person\/customGroupMembers.get.js#10)"
,"org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)"
,"org.mozilla.javascript.Context.reportRuntimeError(Context.java:1030)"
,"org.mozilla.javascript.Context.reportRuntimeError(Context.java:1086)"
,"org.mozilla.javascript.Context.reportRuntimeError1(Context.java:1049)"
,"org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:162)"
,"org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)"
,"org.mozilla.javascript.gen.c13._c0(file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF\/classes
\/alfresco\/templates\/webscripts\/org\/alfresco\/repository\/person\/customGroupMembers.get.js:10)"
,"org.mozilla.javascript.gen.c13.call(file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF\/classes
\/alfresco\/templates\/webscripts\/org\/alfresco\/repository\/person\/customGroupMembers.get.js)"
,"org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)"
,"org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)"
,"org.mozilla.javascript.gen.c13.call(file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF\/classes
\/alfresco\/templates\/webscripts\/org\/alfresco\/repository\/person\/customGroupMembers.get.js)"
,"org.mozilla.javascript.gen.c13.exec(file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF\/classes
\/alfresco\/templates\/webscripts\/org\/alfresco\/repository\/person\/customGroupMembers.get.js)"
,"org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:449
)"
,"org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:174)"
,"org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:274)"
,"org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor
.java:108)"
,"org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:819)"
,"org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:90)"
,"org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:357)"
,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper
.java:326)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java
:407)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer
.java:424)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:288
)"
,"org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:262)"
,"org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)"
,"org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)"
,"javax.servlet.http.HttpServlet.service(HttpServlet.java:717)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java
:290)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)"
,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)"
,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)"
,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)"
,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)"
,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)"
,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)"
,"org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)"
,"org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583
)"
,"org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)"
,"java.lang.Thread.run(Thread.java:619)"
,"org.alfresco.error.AlfrescoRuntimeException: 06300042 Can't find method org.alfresco.repo.jscript
.People.getMembers(org.alfresco.repo.security.authority.script.ScriptGroup,boolean). (file:C:\/Alfresco
\/tomcat\/webapps\/alfresco\/WEB-INF\/classes\/alfresco\/templates\/webscripts\/org\/alfresco\/repository
\/person\/customGroupMembers.get.js#10)"
,"org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:465
)"
,"org.alfresco.scripts.ScriptException: 06300043 Failed to execute script '\/org\/alfresco\/repository
\/person\/customGroupMembers.get.js (in classpath store file:C:\/Alfresco\/tomcat\/webapps\/alfresco
\/WEB-INF\/classes\/alfresco\/templates\/webscripts)': 06300042 Can't find method org.alfresco.repo.jscript
.People.getMembers(org.alfresco.repo.security.authority.script.ScriptGroup,boolean). (file:C:\/Alfresco
\/tomcat\/webapps\/alfresco\/WEB-INF\/classes\/alfresco\/templates\/webscripts\/org\/alfresco\/repository
\/person\/customGroupMembers.get.js#10)"
,"org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:178)"
,"org.alfresco.web.scripts.WebScriptException: 06300044 Wrapped Exception (with status template
😞 06300043 Failed to execute script '\/org\/alfresco\/repository\/person\/customGroupMembers.get.js
(in classpath store file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF\/classes\/alfresco\/templates
\/webscripts)': 06300042 Can't find method org.alfresco.repo.jscript.People.getMembers(org.alfresco.repo
.security.authority.script.ScriptGroup,boolean). (file:C:\/Alfresco\/tomcat\/webapps\/alfresco\/WEB-INF
\/classes\/alfresco\/templates\/webscripts\/org\/alfresco\/repository\/person\/customGroupMembers.get
.js#10)"
,"org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
"
],
"server" : "Alfresco Community v3.2.0 (2039) schema 2,019",
"time" : "Jul 30, 2009 4:06:00 PM"
}
var urlElements = url.extension.split("/");
var shortName = urlElements[0];
var theGroup = groups.getGroup(shortName);
if (theGroup == null)
{
// Group cannot be found
status.setCode(status.STATUS_NOT_FOUND, "The group :" + shortName + ", does not exist.");
} else {
var peopleCollection = people.getMembers(theGroup, true);
model.peoplelist = peopleCollection;
}
<webscript>
<shortname>Get the list of all the people of a group.</shortname>
<description><![CDATA[
Get the list of all the people of a group.
<BR />
]]>
</description>
<url>/api/person/{shortName}/customGroupMembers</url>
<format default="json">argument</format>
<authentication>user</authentication>
<transaction allow="readonly">required</transaction>
<lifecycle>draft_public_api</lifecycle>
</webscript>
The shortName parameter is supposed to be the name of the group.<#import "person.lib.ftl" as personLib/>
{
"people" : [
<#list peoplelist as person>
<@personLib.personJSON person=person/>
<#if person_has_next>,</#if>
</#list>
]
}
08-21-2009 07:47 AM
function main()
{
var groupName = url.extension;
var theGroup = groups.getGroup(groupName);
var theUsers = theGroup.getAllUsers();
var personsArray = [];
for (var j = 0; j < theUsers.length; j++) {
var userName = theUsers[j].shortName;
var person = people.getPerson(userName);
personsArray.push(person);
}
model.peoplelist = personsArray;
}
main();
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.