04-14-2008 06:08 PM
var peeps = people.getMembers(people.getGroup("GROUP_EVERYONE"));
04-16-2008 09:46 AM
getUsers.get.js
var query = "TYPE:\"{http://www.alfresco.org/model/content/1.0}person\"";
if ((args.s) && (args.s != ""))
{
query += " AND (";
var terms = args.s.split(" ");
for (i = 0; i < terms.length; i++)
{
term = terms[i];
query += "((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:*" + term;
query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:*" + term;
query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + term;
query += "*)) "; // final space here is important as default OR separator
}
query += ")";
}
model.searchResults = search.luceneSearch(query);
var query = "TYPE:\"{http://www.alfresco.org/model/content/1.0}person\"";
model.searchResults = search.luceneSearch(query);
04-21-2008 08:28 PM
Hi,
GROUP_EVERYONE is special type of Authority. You won't find this in the web client group management when you try to list all available groups . There is a sample webscript called getUsers to search for users.
getUsers.get.js
var query = "TYPE:\"{http://www.alfresco.org/model/content/1.0}person\"";
if ((args.s) && (args.s != ""))
{
query += " AND (";
var terms = args.s.split(" ");
for (i = 0; i < terms.length; i++)
{
term = terms[i];
query += "((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:*" + term;
query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:*" + term;
query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + term;
query += "*)) "; // final space here is important as default OR separator
}
query += ")";
}
model.searchResults = search.luceneSearch(query);
For your purpose to get all users you could just do a lucene search for all nodes of type Person and manipulate the result as you like.
var query = "TYPE:\"{http://www.alfresco.org/model/content/1.0}person\"";
model.searchResults = search.luceneSearch(query);
Regards,
Shagul
var h = peeps[i].properties["cm:homeFolder"];
returned a noderef fo type cm:folder which had no cm:name property. The following, var h = search.findNode(peeps[i].properties["cm:homeFolder"]);
returned a ScriptNode which had a cm:name property but for every user the cm:name of the home folder thus returned was "Projects Search" which is not the home folder of any of the users and as far as I can tell does not exist on my system.04-22-2008 05:38 PM
var h = search.findNode(peeps[i].properties["cm:homeFolder"]);
is identical in all cases.11-19-2008 05:27 AM
var query = "TYPE:\"{http://www.alfresco.org/model/content/1.0}person\"";
model.searchResults = search.luceneSearch(query);
if (model.searchResults== undefined)
{
status.code = 404;
status.message = "No persons.";
status.redirect = true;
}
FreeMarker:
…
<#list model.searchResults as result>
${result}<br>
</#list>
…
I also tried ${result.properties.username}<br>.org.alfresco.service.cmr.repository.TemplateException - Error during processing of the template 'Expression model is undefined on line 28, column 8 in org/alfresco/my/folders.get.html.ftl.'. Please contact your system administrator.
So what's wrong with my loop? 11-19-2008 10:55 AM
<#list searchResults as result>
${result.name}<br>
</#list>
11-20-2008 10:03 AM
500 Description: An error inside the HTTP server which prevented it from fulfilling the request.
Message: Error during processing of the template 'Expression model is undefined on line 7, column 10 in org/alfresco/sample/listing.get.html.ftl.'. Please contact your system administrator.
Exception: freemarker.core.InvalidReferenceException - Expression model is undefined on line 7, column 10 in org/alfresco/sample/listing.get.html.ftl.
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.Environment.process(Environment.java:188)
freemarker.template.Template.process(Template.java:237)
org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201)
org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:377)
org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:280)
org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:173)
org.alfresco.repo.web.scripts.RepositoryContainer$1.execute(RepositoryContainer.java:309)
org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:294)
org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:209)
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:320)
org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:264)
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:240)
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
org.alfresco.web.app.servlet.MTWebScriptAuthenticationFilter.doFilter(MTWebScriptAuthenticationFilter.java:102)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
org.alfresco.module.vti.VtiContextFilter.doFilter(VtiContextFilter.java:94)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
java.lang.Thread.run(Thread.java:595)
Exception: org.alfresco.service.cmr.repository.TemplateException - Error during processing of the template 'Expression model is undefined on line 7, column 10 in org/alfresco/sample/listing.get.html.ftl.'. Please contact your system administrator.
org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:205)
Thanks very much.
11-20-2008 10:52 AM
11-20-2008 11:32 AM
Message: Error during processing of the template 'Expression model is undefined on line 7, column 10 in org/alfresco/sample/listing.get.html.ftl.'. Please contact your system administrator.
11-21-2008 03:40 AM
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.