Hi all, Im trying to get information about the user stored in Liferay (like
email, first name, group he/she is part of) into Orbeon. I can get the username
and roles by using the request-security processor but how can I get the extra information.
There isn’t much about it in both Orbeon and Liferay forums.
Although in Liferay forums it was mentioned that you can define settings in portlet.xml
and call functions in java (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/24798).
And there was also functions like: User user = User.LocalServiceUtil.getUserById(userId); …that you can use. But I am not sure how this can be used in my Xform
or XPL. Does anyone have any ideas? Cheers, NJ NOTICE This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank. -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Naman,
Not sure if I read that Liferay thread right, but it seems that if you configure your portlet.xml as specified, you should be able to use the Java processor to extract user information from the request object. (It would be nice if oxf:request-generator allowed you to serialize request attributes, but it doesn't at the moment.) -Erik Naman Joshi wrote: > Hi all, > > > > Im trying to get information about the user stored in Liferay (like > email, first name, group he/she is part of) into Orbeon. I can get the > username and roles by using the request-security processor but how can I > get the extra information. > > > > There isn’t much about it in both Orbeon and Liferay forums. Although in > Liferay forums it was mentioned that you can define settings in > portlet.xml and call functions in java > (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/24798). > And there was also functions like: > > > > User user = User.LocalServiceUtil.getUserById(userId); > String userFirstName = user.getFirstName(); > String userLastName = user.getLastName(); > > > > …that you can use. But I am not sure how this can be used in my Xform or > XPL. Does anyone have any ideas? > > > > Cheers, > > NJ > > > > NOTICE > > This e-mail and any attachments are confidential and may contain > copyright material of Macquarie Bank or third parties. If you are not > the intended recipient of this email you should not read, print, > re-transmit, store or act in reliance on this e-mail or any attachments, > and should destroy all copies of them. Macquarie Bank does not guarantee > the integrity of any emails or any attached files. The views or opinions > expressed are the author's own and may not reflect the views or opinions > of Macquarie Bank. > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Erik,
I am trying to get started on this but I am getting stuck at writing a custom processor. I followed the steps outlined here http://www.orbeon.com/ops/doc/processors-java but I get this error: Cannot load processor '{com.company.my}DeepThoughtProcessor' because it needs a class that cannot be loaded: 'com/company/my/DeepThoughtProcessor (wrong name: DeepThoughtProcessor)' This is the steps I followed in accordance with the website: 1. Compiled DeepThoughtProcessor.java and placed the class file in WEB-INF\classes\com\company\my. public class DeepThoughtProcessor extends SimpleProcessor { public DeepThoughtProcessor() { addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA)); } public void generateData(PipelineContext context, ContentHandler contentHandler) throws SAXException { String answer = "42"; contentHandler.startDocument(); contentHandler.startElement("", "answer", "answer", new AttributesImpl()); contentHandler.characters(answer.toCharArray(), 0, answer.length()); contentHandler.endElement("", "answer", "answer"); contentHandler.endDocument(); } } 2. custom-processors.xml: <processors xmlns:my="com.company.my"> <processor name="my:DeepThoughtProcessor"> <class name="com.company.my.DeepThoughtProcessor"/> </processor> </processors> 3. In my XPL file I have: <p:processor name="my:DeepThoughtProcessor"> <p:output name="data" id="data2" debug="true"/> </p:processor> I think I am doing something very stupid, or I am missing a step. Any ideas? Cheers, NJ -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez Sent: Tuesday, 3 April 2007 5:16 AM To: [hidden email] Subject: Re: [ops-users] Xforms-Liferay Security Settings Naman, Not sure if I read that Liferay thread right, but it seems that if you configure your portlet.xml as specified, you should be able to use the Java processor to extract user information from the request object. (It would be nice if oxf:request-generator allowed you to serialize request attributes, but it doesn't at the moment.) -Erik Naman Joshi wrote: > Hi all, > > > > Im trying to get information about the user stored in Liferay (like > email, first name, group he/she is part of) into Orbeon. I can get the > username and roles by using the request-security processor but how can I > get the extra information. > > > > There isn't much about it in both Orbeon and Liferay forums. Although in > Liferay forums it was mentioned that you can define settings in > portlet.xml and call functions in java > (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ 24798). > And there was also functions like: > > > > User user = User.LocalServiceUtil.getUserById(userId); > String userFirstName = user.getFirstName(); > String userLastName = user.getLastName(); > > > > ...that you can use. But I am not sure how this can be used in my > XPL. Does anyone have any ideas? > > > > Cheers, > > NJ > > > > NOTICE > > This e-mail and any attachments are confidential and may contain > copyright material of Macquarie Bank or third parties. If you are not > the intended recipient of this email you should not read, print, > re-transmit, store or act in reliance on this e-mail or any > and should destroy all copies of them. Macquarie Bank does not > the integrity of any emails or any attached files. The views or opinions > expressed are the author's own and may not reflect the views or opinions > of Macquarie Bank. > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In the java code you have posted you didn't include a package declaration - is it there in the source file?
Cheers,
Dave Mc.
>>> "Naman Joshi" <[hidden email]> 16/04/2007 1:29 p.m. >>> Hi Erik, I am trying to get started on this but I am getting stuck at writing a custom processor. I followed the steps outlined here http://www.orbeon.com/ops/doc/processors-java but I get this error: Cannot load processor '{com.company.my}DeepThoughtProcessor' because it needs a class that cannot be loaded: 'com/company/my/DeepThoughtProcessor (wrong name: DeepThoughtProcessor)' This is the steps I followed in accordance with the website: 1. Compiled DeepThoughtProcessor.java and placed the class file in WEB-INF\classes\com\company\my. public class DeepThoughtProcessor extends SimpleProcessor { public DeepThoughtProcessor() { addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA)); } public void generateData(PipelineContext context, ContentHandler contentHandler) throws SAXException { String answer = "42"; contentHandler.startDocument(); contentHandler.startElement("", "answer", "answer", new AttributesImpl()); contentHandler.characters(answer.toCharArray(), 0, answer.length()); contentHandler.endElement("", "answer", "answer"); contentHandler.endDocument(); } } 2. custom-processors.xml: <processors xmlns:my="com.company.my"> <processor name="my:DeepThoughtProcessor"> <class name="com.company.my.DeepThoughtProcessor"/> </processor> </processors> 3. In my XPL file I have: <p:processor name="my:DeepThoughtProcessor"> <p:output name="data" id="data2" debug="true"/> </p:processor> I think I am doing something very stupid, or I am missing a step. Any ideas? Cheers, NJ -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez Sent: Tuesday, 3 April 2007 5:16 AM To: [hidden email] Subject: Re: [ops-users] Xforms-Liferay Security Settings Naman, Not sure if I read that Liferay thread right, but it seems that if you configure your portlet.xml as specified, you should be able to use the Java processor to extract user information from the request object. (It would be nice if oxf:request-generator allowed you to serialize request attributes, but it doesn't at the moment.) -Erik Naman Joshi wrote: > Hi all, > > > > Im trying to get information about the user stored in Liferay (like > email, first name, group he/she is part of) into Orbeon. I can get the > username and roles by using the request-security processor but how can I > get the extra information. > > > > There isn't much about it in both Orbeon and Liferay forums. Although in > Liferay forums it was mentioned that you can define settings in > portlet.xml and call functions in java > (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ 24798). > And there was also functions like: > > > > User user = User.LocalServiceUtil.getUserById(userId); > String userFirstName = user.getFirstName(); > String userLastName = user.getLastName(); > > > > ...that you can use. But I am not sure how this can be used in my > XPL. Does anyone have any ideas? > > > > Cheers, > > NJ > > > > NOTICE > > This e-mail and any attachments are confidential and may contain > copyright material of Macquarie Bank or third parties. If you are not > the intended recipient of this email you should not read, print, > re-transmit, store or act in reliance on this e-mail or any > and should destroy all copies of them. Macquarie Bank does not guarantee > the integrity of any emails or any attached files. The views or opinions > expressed are the author's own and may not reflect the views or opinions > of Macquarie Bank. > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Guys,
Thanks a lot for that David, it was the stupidest mistake, I forgot to add the declaration. Now the example Java Processor works! :) The problem that I am facing now is how I get the "request" variable that Liferay needs (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ 24798). I had a look at the Orbeon Java API for SimpleProcessor but couldn't find anything about getting it from the HTTPServlet. And where is the API for ProcessorImpl?? Thanks NJ -----Original Message----- From: David McIntyre [mailto:[hidden email]] Sent: Monday, 16 April 2007 12:05 PM To: [hidden email] Subject: RE: [ops-users] Xforms-Liferay Security Settings In the java code you have posted you didn't include a package declaration - is it there in the source file? Cheers, Dave Mc. Dave McIntyre MA, DPhil Software Developer [hidden email] P: +64 9 638 0600 F: +64 9 638 0699 M: +64 21 212 8087 S: dave.mcintyre www.orionhealth.com >>> "Naman Joshi" <[hidden email]> 16/04/2007 1:29 p.m. >>> Hi Erik, I am trying to get started on this but I am getting stuck at writing a custom processor. I followed the steps outlined here http://www.orbeon.com/ops/doc/processors-java but I get this error: Cannot load processor '{com.company.my}DeepThoughtProcessor' because it needs a class that cannot be loaded: 'com/company/my/DeepThoughtProcessor (wrong name: DeepThoughtProcessor)' This is the steps I followed in accordance with the website: 1. Compiled DeepThoughtProcessor.java and placed the class file in WEB-INF\classes\com\company\my. public class DeepThoughtProcessor extends SimpleProcessor { public DeepThoughtProcessor() { addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA)); } public void generateData(PipelineContext context, ContentHandler contentHandler) throws SAXException { String answer = "42"; contentHandler.startDocument(); contentHandler.startElement("", "answer", "answer", new AttributesImpl()); contentHandler.characters(answer.toCharArray(), 0, answer.length()); contentHandler.endElement("", "answer", "answer"); contentHandler.endDocument(); } } 2. custom-processors.xml: <processors xmlns:my="com.company.my"> <processor name="my:DeepThoughtProcessor"> <class name="com.company.my.DeepThoughtProcessor"/> </processor> </processors> 3. In my XPL file I have: <p:processor name="my:DeepThoughtProcessor"> <p:output name="data" id="data2" debug="true"/> </p:processor> I think I am doing something very stupid, or I am missing a step. Any ideas? Cheers, NJ -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez Sent: Tuesday, 3 April 2007 5:16 AM To: [hidden email] Subject: Re: [ops-users] Xforms-Liferay Security Settings Naman, Not sure if I read that Liferay thread right, but it seems that if you configure your portlet.xml as specified, you should be able to use the Java processor to extract user information from the request object. (It would be nice if oxf:request-generator allowed you to serialize request attributes, but it doesn't at the moment.) -Erik Naman Joshi wrote: > Hi all, > > > > Im trying to get information about the user stored in Liferay (like > email, first name, group he/she is part of) into Orbeon. I can get the > username and roles by using the request-security processor but how can I > get the extra information. > > > > There isn't much about it in both Orbeon and Liferay forums. Although in > Liferay forums it was mentioned that you can define settings in > portlet.xml and call functions in java > (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ 24798). > And there was also functions like: > > > > User user = User.LocalServiceUtil.getUserById(userId); > String userFirstName = user.getFirstName(); > String userLastName = user.getLastName(); > > > > ...that you can use. But I am not sure how this can be used in my > XPL. Does anyone have any ideas? > > > > Cheers, > > NJ > > > > NOTICE > > This e-mail and any attachments are confidential and may contain > copyright material of Macquarie Bank or third parties. If you are not > the intended recipient of this email you should not read, print, > re-transmit, store or act in reliance on this e-mail or any > and should destroy all copies of them. Macquarie Bank does not > the integrity of any emails or any attached files. The views or opinions > expressed are the author's own and may not reflect the views or opinions > of Macquarie Bank. > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
This is an easy one, see for example this post:
http://www.nabble.com/Getting-server-info-in-custom-processor-tf2175569.html#a6015611 -Erik Naman Joshi wrote: > Hi Guys, > > Thanks a lot for that David, it was the stupidest mistake, I forgot to > add the declaration. Now the example Java Processor works! :) The > problem that I am facing now is how I get the "request" variable that > Liferay needs > (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ > 24798). I had a look at the Orbeon Java API for SimpleProcessor but > couldn't find anything about getting it from the HTTPServlet. And where > is the API for ProcessorImpl?? > > Thanks > NJ > > -----Original Message----- > From: David McIntyre [mailto:[hidden email]] > Sent: Monday, 16 April 2007 12:05 PM > To: [hidden email] > Subject: RE: [ops-users] Xforms-Liferay Security Settings > > In the java code you have posted you didn't include a package > declaration - is it there in the source file? > > Cheers, > > Dave Mc. > > > > > > Dave McIntyre MA, DPhil > Software Developer > [hidden email] > P: +64 9 638 0600 > F: +64 9 638 0699 > M: +64 21 212 8087 > S: dave.mcintyre > www.orionhealth.com > > >>>> "Naman Joshi" <[hidden email]> 16/04/2007 1:29 p.m. >>> > Hi Erik, > > I am trying to get started on this but I am getting stuck at writing a > custom processor. I followed the steps outlined here > http://www.orbeon.com/ops/doc/processors-java but I get this error: > > Cannot load processor '{com.company.my}DeepThoughtProcessor' because it > needs a class that cannot be loaded: > 'com/company/my/DeepThoughtProcessor (wrong name: DeepThoughtProcessor)' > > This is the steps I followed in accordance with the website: > > 1. Compiled DeepThoughtProcessor.java and placed the class file in > WEB-INF\classes\com\company\my. > > public class DeepThoughtProcessor extends SimpleProcessor { > > public DeepThoughtProcessor() { > addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA)); > } > > public void generateData(PipelineContext context, > ContentHandler contentHandler) > throws SAXException { > String answer = "42"; > contentHandler.startDocument(); > contentHandler.startElement("", "answer", "answer", new > AttributesImpl()); > contentHandler.characters(answer.toCharArray(), 0, > answer.length()); > contentHandler.endElement("", "answer", "answer"); > contentHandler.endDocument(); > } > } > > 2. custom-processors.xml: > > <processors xmlns:my="com.company.my"> > <processor name="my:DeepThoughtProcessor"> > <class > name="com.company.my.DeepThoughtProcessor"/> > </processor> > </processors> > > 3. In my XPL file I have: > > <p:processor name="my:DeepThoughtProcessor"> > <p:output name="data" id="data2" debug="true"/> > </p:processor> > > > I think I am doing something very stupid, or I am missing a step. Any > ideas? > > Cheers, > NJ > > -----Original Message----- > From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez > Sent: Tuesday, 3 April 2007 5:16 AM > To: [hidden email] > Subject: Re: [ops-users] Xforms-Liferay Security Settings > > Naman, > > Not sure if I read that Liferay thread right, but it seems that if you > configure your portlet.xml as specified, you should be able to use the > Java processor to extract user information from the request object. > > (It would be nice if oxf:request-generator allowed you to serialize > request attributes, but it doesn't at the moment.) > > -Erik > > Naman Joshi wrote: >> Hi all, >> >> >> >> Im trying to get information about the user stored in Liferay (like >> email, first name, group he/she is part of) into Orbeon. I can get the > >> username and roles by using the request-security processor but how can > I >> get the extra information. >> >> >> >> There isn't much about it in both Orbeon and Liferay forums. Although > in >> Liferay forums it was mentioned that you can define settings in >> portlet.xml and call functions in java >> > (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ > 24798). >> And there was also functions like: >> >> >> >> User user = User.LocalServiceUtil.getUserById(userId); >> String userFirstName = user.getFirstName(); >> String userLastName = user.getLastName(); >> >> >> >> ...that you can use. But I am not sure how this can be used in my > Xform or >> XPL. Does anyone have any ideas? >> >> >> >> Cheers, >> >> NJ >> >> >> >> NOTICE >> >> This e-mail and any attachments are confidential and may contain >> copyright material of Macquarie Bank or third parties. If you are not >> the intended recipient of this email you should not read, print, >> re-transmit, store or act in reliance on this e-mail or any > attachments, >> and should destroy all copies of them. Macquarie Bank does not > guarantee >> the integrity of any emails or any attached files. The views or > opinions >> expressed are the author's own and may not reflect the views or > opinions >> of Macquarie Bank. >> > > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Erik, I actually had to change it to this to make it work in Liferay: PortletExternalContext portletExternalContext =
(PortletExternalContext) context.getAttribute
(PipelineContext.EXTERNAL_CONTEXT); String serverName = portletExternalContext.getRequest().getServerName(); And I got it working. But what I really need to do is something like
this: Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO); Unfortunately looking through the Java API of ExternalContext.Request I
didn’t see anything about getAttribute() and I couldn’t find the
API for PortletExternalContext. What do you thnk NJ -----Original Message----- This is an easy one, see for example this post: http://www.nabble.com/Getting-server-info-in-custom-processor-tf2175569.html#a6015611 -Erik Naman Joshi wrote: > Hi Guys, > > Thanks a lot for that David, it was the stupidest mistake, I forgot
to > add the declaration. Now the example Java Processor works!
:) The > problem that I am facing now is how I get the "request"
variable that > Liferay needs >
(http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ > 24798). I had a look at the Orbeon Java API for SimpleProcessor
but > couldn't find anything about getting it from the HTTPServlet. And
where > is the API for ProcessorImpl?? > > Thanks > NJ > > -----Original Message----- > From: David McIntyre [mailto:[hidden email]] > Sent: Monday, 16 April 2007 12:05 PM > To: [hidden email] > Subject: RE: [ops-users] Xforms-Liferay Security Settings > > In the java code you have posted you didn't include a package > declaration - is it there in the source file? > > Cheers, > > Dave Mc. > > > > > > Dave McIntyre MA, DPhil > Software Developer > P: +64 9 638 0600 > F: +64 9 638 0699 > M: +64 21 212 8087 > S: dave.mcintyre > www.orionhealth.com > > >>>> "Naman Joshi"
<[hidden email]> 16/04/2007 1:29 p.m. >>> > Hi Erik, > > I am trying to get started on this but I am getting stuck at
writing a > custom processor. I followed the steps outlined here > http://www.orbeon.com/ops/doc/processors-java but I get this
error: > > Cannot load processor '{com.company.my}DeepThoughtProcessor'
because it > needs a class that cannot be loaded: > 'com/company/my/DeepThoughtProcessor (wrong name:
DeepThoughtProcessor)' > > This is the steps I followed in accordance with the website: > > 1. Compiled DeepThoughtProcessor.java and placed the class file in > WEB-INF\classes\com\company\my. > > public class DeepThoughtProcessor extends SimpleProcessor { > > public DeepThoughtProcessor() { > addOutputInfo(new
ProcessorInputOutputInfo(OUTPUT_DATA)); > } > > public void generateData(PipelineContext
context, >
ContentHandler contentHandler) >
throws SAXException { > String answer =
"42"; >
contentHandler.startDocument(); >
contentHandler.startElement("", "answer",
"answer", new > AttributesImpl()); >
contentHandler.characters(answer.toCharArray(), 0, > answer.length()); > contentHandler.endElement("",
"answer", "answer"); >
contentHandler.endDocument(); > } > } > > 2. custom-processors.xml: > > <processors xmlns:my="com.company.my"> > <processor name="my:DeepThoughtProcessor"> > <class > name="com.company.my.DeepThoughtProcessor"/> > </processor> > </processors> > > 3. In my XPL file I have: > > <p:processor name="my:DeepThoughtProcessor"> > <p:output name="data" id="data2"
debug="true"/> > </p:processor> > > > I think I am doing something very stupid, or I am missing a step.
Any > ideas? > > Cheers, > NJ > > -----Original Message----- > From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
Bruchez > Sent: Tuesday, 3 April 2007 5:16 AM > To: [hidden email] > Subject: Re: [ops-users] Xforms-Liferay Security Settings > > Naman, > > Not sure if I read that Liferay thread right, but it seems that if
you > configure your portlet.xml as specified, you should be able to use
the > Java processor to extract user information from the request
object. > > (It would be nice if oxf:request-generator allowed you to
serialize > request attributes, but it doesn't at the moment.) > > -Erik > > Naman Joshi wrote: >> Hi all, >> >> >> >> Im trying to get information about the user stored in Liferay
(like >> email, first name, group he/she is part of) into Orbeon. I can
get the > >> username and roles by using the request-security processor but
how can > I >> get the extra information. >> >> >> >> There isn't much about it in both Orbeon and Liferay forums.
Although > in >> Liferay forums it was mentioned that you can define settings
in >> portlet.xml and call functions in java >> > (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ > 24798). >> And there was also functions like: >> >> >> >> User user = User.LocalServiceUtil.getUserById(userId); >> String userFirstName = user.getFirstName(); >> String userLastName = user.getLastName(); >> >> >> >> ...that you can use. But I am not sure how this can be used in
my > Xform or >> XPL. Does anyone have any ideas? >> >> >> >> Cheers, >> >> NJ >> >> >> >> NOTICE >> >> This e-mail and any attachments are confidential and may
contain >> copyright material of Macquarie Bank or third parties. If you
are not >> the intended recipient of this email you should not read,
print, >> re-transmit, store or act in reliance on this e-mail or any > attachments, >> and should destroy all copies of them. Macquarie Bank does not > guarantee >> the integrity of any emails or any attached files. The views
or > opinions >> expressed are the author's own and may not reflect the views
or > opinions >> of Macquarie Bank. >> > > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Naman,
Use request.getAttributesMap().get(PipelineContext.EXTERNAL_CONTEXT) -Erik Naman Joshi wrote: > Hi Erik, > > > > I actually had to change it to this to make it work in Liferay: > > > > PortletExternalContext portletExternalContext = (PortletExternalContext) > context.getAttribute (PipelineContext.EXTERNAL_CONTEXT); > > String serverName = portletExternalContext.getRequest().getServerName(); > > > > And I got it working. But what I really need to do is something like this: > > > > Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO); > > > > Unfortunately looking through the Java API of ExternalContext.Request I > didn’t see anything about getAttribute() and I couldn’t find the API for > PortletExternalContext. What do you thnk > > > > NJ > > > > -----Original Message----- > From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez > Sent: Wednesday, 18 April 2007 3:29 PM > To: [hidden email] > Subject: Re: [ops-users] Xforms-Liferay Security Settings > > > > This is an easy one, see for example this post: > > > > http://www.nabble.com/Getting-server-info-in-custom-processor-tf2175569.html#a6015611 > > > > -Erik > > > > Naman Joshi wrote: > >> Hi Guys, > >> > >> Thanks a lot for that David, it was the stupidest mistake, I forgot to > >> add the declaration. Now the example Java Processor works! :) The > >> problem that I am facing now is how I get the "request" variable that > >> Liferay needs > >> (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ > >> 24798). I had a look at the Orbeon Java API for SimpleProcessor but > >> couldn't find anything about getting it from the HTTPServlet. And where > >> is the API for ProcessorImpl?? > >> > >> Thanks > >> NJ > >> > >> -----Original Message----- > >> From: David McIntyre [mailto:[hidden email]] > >> Sent: Monday, 16 April 2007 12:05 PM > >> To: [hidden email] > >> Subject: RE: [ops-users] Xforms-Liferay Security Settings > >> > >> In the java code you have posted you didn't include a package > >> declaration - is it there in the source file? > >> > >> Cheers, > >> > >> Dave Mc. > >> > >> > >> > >> > >> > >> Dave McIntyre MA, DPhil > >> Software Developer > >> [hidden email] > >> P: +64 9 638 0600 > >> F: +64 9 638 0699 > >> M: +64 21 212 8087 > >> S: dave.mcintyre > >> www.orionhealth.com > >> > >> > >> >>> "Naman Joshi" <[hidden email]> 16/04/2007 1:29 p.m. >>> > >> Hi Erik, > >> > >> I am trying to get started on this but I am getting stuck at writing a > >> custom processor. I followed the steps outlined here > >> http://www.orbeon.com/ops/doc/processors-java but I get this error: > >> > >> Cannot load processor '{com.company.my}DeepThoughtProcessor' because it > >> needs a class that cannot be loaded: > >> 'com/company/my/DeepThoughtProcessor (wrong name: DeepThoughtProcessor)' > >> > >> This is the steps I followed in accordance with the website: > >> > >> 1. Compiled DeepThoughtProcessor.java and placed the class file in > >> WEB-INF\classes\com\company\my. > >> > >> public class DeepThoughtProcessor extends SimpleProcessor { > >> > >> public DeepThoughtProcessor() { > >> addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA)); > >> } > >> > >> public void generateData(PipelineContext context, > >> ContentHandler contentHandler) > >> throws SAXException { > >> String answer = "42"; > >> contentHandler.startDocument(); > >> contentHandler.startElement("", "answer", "answer", new > >> AttributesImpl()); > >> contentHandler.characters(answer.toCharArray(), 0, > >> answer.length()); > >> contentHandler.endElement("", "answer", "answer"); > >> contentHandler.endDocument(); > >> } > >> } > >> > >> 2. custom-processors.xml: > >> > >> <processors xmlns:my="com.company.my"> > >> <processor name="my:DeepThoughtProcessor"> > >> <class > >> name="com.company.my.DeepThoughtProcessor"/> > >> </processor> > >> </processors> > >> > >> 3. In my XPL file I have: > >> > >> <p:processor name="my:DeepThoughtProcessor"> > >> <p:output name="data" id="data2" debug="true"/> > >> </p:processor> > >> > >> > >> I think I am doing something very stupid, or I am missing a step. Any > >> ideas? > >> > >> Cheers, > >> NJ > >> > >> -----Original Message----- > >> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez > >> Sent: Tuesday, 3 April 2007 5:16 AM > >> To: [hidden email] > >> Subject: Re: [ops-users] Xforms-Liferay Security Settings > >> > >> Naman, > >> > >> Not sure if I read that Liferay thread right, but it seems that if you > >> configure your portlet.xml as specified, you should be able to use the > >> Java processor to extract user information from the request object. > >> > >> (It would be nice if oxf:request-generator allowed you to serialize > >> request attributes, but it doesn't at the moment.) > >> > >> -Erik > >> > >> Naman Joshi wrote: > >> > Hi all, > >> > > >> > > >> > > >> > Im trying to get information about the user stored in Liferay (like > >> > email, first name, group he/she is part of) into Orbeon. I can get the > >> > >> > username and roles by using the request-security processor but how can > >> I > >> > get the extra information. > >> > > >> > > >> > > >> > There isn't much about it in both Orbeon and Liferay forums. Although > >> in > >> > Liferay forums it was mentioned that you can define settings in > >> > portlet.xml and call functions in java > >> > > >> (http://www.liferay.com/web/guest/devzone/forums/message_boards/message/ > >> 24798). > >> > And there was also functions like: > >> > > >> > > >> > > >> > User user = User.LocalServiceUtil.getUserById(userId); > >> > String userFirstName = user.getFirstName(); > >> > String userLastName = user.getLastName(); > >> > > >> > > >> > > >> > ...that you can use. But I am not sure how this can be used in my > >> Xform or > >> > XPL. Does anyone have any ideas? > >> > > >> > > >> > > >> > Cheers, > >> > > >> > NJ > >> > > >> > > >> > > >> > NOTICE > >> > > >> > This e-mail and any attachments are confidential and may contain > >> > copyright material of Macquarie Bank or third parties. If you are not > >> > the intended recipient of this email you should not read, print, > >> > re-transmit, store or act in reliance on this e-mail or any > >> attachments, > >> > and should destroy all copies of them. Macquarie Bank does not > >> guarantee > >> > the integrity of any emails or any attached files. The views or > >> opinions > >> > expressed are the author's own and may not reflect the views or > >> opinions > >> > of Macquarie Bank. > >> > > >> > >> > > > > > > -- > > Orbeon Forms - Web Forms for the Enterprise Done the Right Way > > http://www.orbeon.com/ > > > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |