Re: writing entries in DB.

2012-07-13 Thread Prabhakar Pandey
Also it would be great if any1 could tell me how can i retrieve values from
database using Java services and events only.


On Fri, Jul 13, 2012 at 11:02 AM, Deepak Dixit deepak.di...@hotwaxmedia.com
 wrote:

 Hi Prabhakar,

 You should have service engine utility.
 In OFBiz for CRUD operation we use services. You can write service using
 entity-auto.
 Please refer example/services.xml for more reference.

 service name=createExample default-entity-name=Example
 engine=entity-auto invoke=create auth=true


 Thanks  Regards
 --
 Deepak Dixit
 HotWax Media Pvt. Ltd.
 www.hotwaxmedia.com
 Contact :- +91-98267-54548
 Skype  :- deepakdixit

 On Jul 13, 2012, at 10:47 AM, Prabhakar Pandey wrote:

  Hello,
 
  This is my entitymodel.xml file
 
  entity entity-name=Employee package-name=org.ofbiz.hello1
 title=Hello
  Person Entity
 
   field name=empId type=id-ne /field
   field name=firstName type=name/field
   field name=lastName type=name/field
   field name=email type=name/field
   prim-key field=empId/
 /entity
 
  This is part of EmployeeServices,java
 
  GenericValue employee = delegator.makeValue(Employee);
 employee.put(empId,12);
 employee.put(firstName,firstName);
 employee.put(lastName, lastName);
 employee.put(email, email);
 
 
  when i am giving hard coded value for empId then its getting stored in
 DB.
  i want to autoassign that field so that i don't have to hard-code the
 value
  again and again ... Any help on this?
  Thanks in advance!




Catalog/category privilegs per user

2012-07-13 Thread MMA
Hi Experts, 

I'm quite new to OFBiz and currently trying to get an overview over the
different features it offers. 
One goal i'd like to achieve is that i can grant or revoke different users
access to different catalogues/categories. 

Is this functionality offered ootb? i haven't found a possibility to do this
by now - maybe some of you could give me a hint where to look at/how this is
possible? 

Thanks and best regards, 
Markus

--
View this message in context: 
http://ofbiz.135035.n4.nabble.com/Catalog-category-privilegs-per-user-tp4634786.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: writing entries in DB.

2012-07-13 Thread Rishi Solanki
Prabhakar,

Use GenericDelegator class methods for doing so.
Not sure if you go thru the practice application tutorial -
https://cwiki.apache.org/OFBIZ/ofbiz-tutorial-a-beginners-development-guide.html

--
Rishi Solanki


On Fri, Jul 13, 2012 at 11:54 AM, Prabhakar Pandey nginx.p...@gmail.comwrote:

 Also it would be great if any1 could tell me how can i retrieve values from
 database using Java services and events only.


 On Fri, Jul 13, 2012 at 11:02 AM, Deepak Dixit 
 deepak.di...@hotwaxmedia.com
  wrote:

  Hi Prabhakar,
 
  You should have service engine utility.
  In OFBiz for CRUD operation we use services. You can write service using
  entity-auto.
  Please refer example/services.xml for more reference.
 
  service name=createExample default-entity-name=Example
  engine=entity-auto invoke=create auth=true
 
 
  Thanks  Regards
  --
  Deepak Dixit
  HotWax Media Pvt. Ltd.
  www.hotwaxmedia.com
  Contact :- +91-98267-54548
  Skype  :- deepakdixit
 
  On Jul 13, 2012, at 10:47 AM, Prabhakar Pandey wrote:
 
   Hello,
  
   This is my entitymodel.xml file
  
   entity entity-name=Employee package-name=org.ofbiz.hello1
  title=Hello
   Person Entity
  
field name=empId type=id-ne /field
field name=firstName type=name/field
field name=lastName type=name/field
field name=email type=name/field
prim-key field=empId/
  /entity
  
   This is part of EmployeeServices,java
  
   GenericValue employee = delegator.makeValue(Employee);
  employee.put(empId,12);
  employee.put(firstName,firstName);
  employee.put(lastName, lastName);
  employee.put(email, email);
  
  
   when i am giving hard coded value for empId then its getting stored in
  DB.
   i want to autoassign that field so that i don't have to hard-code the
  value
   again and again ... Any help on this?
   Thanks in advance!
 
 



Re: Catalog/category privilegs per user

2012-07-13 Thread Jacques Le Roux

You need to use the security options for that. You will find OOTB examples in 
code
https://cwiki.apache.org/confluence/display/OFBTECH/OFBiz+security

Jacques

From: MMA mailtoma...@gmail.com
Hi Experts, 


I'm quite new to OFBiz and currently trying to get an overview over the
different features it offers. 
One goal i'd like to achieve is that i can grant or revoke different users
access to different catalogues/categories. 


Is this functionality offered ootb? i haven't found a possibility to do this
by now - maybe some of you could give me a hint where to look at/how this is
possible? 

Thanks and best regards, 
Markus


--
View this message in context: 
http://ofbiz.135035.n4.nabble.com/Catalog-category-privilegs-per-user-tp4634786.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: Announcement: OFBiz Mini-language Overhaul

2012-07-13 Thread olivier Heintz

Thank you Adrian,

Improved grammar is really more clear and very useful to use.

Le 11/07/2012 08:08, Adrian Crum a écrit :
Ofbiz's home-grown scripting language - Mini-language - is designed to 
make application development fast and easy.


Recently, Mini-language was completely overhauled: the grammar was 
updated based on suggestions from the developer community, source code 
validation was added, and the scripting engine was optimized and made 
more robust. Those changes result in a scripting language that is 
easier to use and performs well.


New Mini-language features:

1. Improved grammar 
(https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference).

2. New looping elements break and continue.
3. New trace element - provides detailed logging of script engine 
behavior.
4. Script engine source code has been optimized to use less memory and 
run faster (40% faster on trunk version).


The overhaul has been back-ported to the Release 12 branch.

The Mini-language overhaul represents three man-months of work and it 
was sponsored by 1Tech Ltd (http://1tech.eu).


-Adrian






Re: Catalog/category privilegs per user

2012-07-13 Thread MMA
Hi Jacques,

thanks for your fast response.

Im not sure if this is exactly what i was searching for...

My intention is to restrict the access to certain catalogues on the front
end (in the ecommerce shop).
For instance, i want a un-registered user to see just our empty front page,
without any catalogues/products.
Signed-in users should see different catalogues based on new defined roles
e.g.
user 1
  role 1
 catalogue 1
 catalogue 3
user 2
  role 2
 catalogue 1
 catalogue 2

i hope that there is a possibility to do this in the backend, because i want
to generate rules as dynamic as 
possible, it would be much more effort to edit all template (or similar)
files.

Is there any hint you could give me, where to start to achieve this? i
already found the possibility to bind 
certain parties with a defined role to a catalogue, but i don't  see where
to define concrete rights for these
roles...

nevertheless, thank you and best regards,
Markus

--
View this message in context: 
http://ofbiz.135035.n4.nabble.com/Catalog-category-privilegs-per-user-tp4634786p4634815.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: Java Service Classes

2012-07-13 Thread Himanil Gupta

Hi Prabhakar,

The scenario you are given is not properly executed because, in this 
case the second event(viewEmployee) doesn't works for either success or 
failure of  event(createEmployee). Thus to successfully execute this you 
have to provide response 'type=request' for first event which on success 
invoke's another requests and executes second event, and on success of 
it the response goes to specified view.


e.g:
request-map uri=submit
security https=false auth=false /
event type=java path=org.mindtree.testapp.EmployeeEvents 
invoke=createEmployee/

response name=success type=request value=submitSecond /
/request-map

request-map uri=submitSecond
security https=false auth=false /
event type=java path=org.mindtree.testapp.EmployeeEvents 
invoke=viewEmployee/

response name=success type=view value=main /
/request-map

Thanks  regards
--
Himanil Gupta,
Enterprise Software Developer
HotWax Media Pvt. Ltd. Indore
http://www.hotwaxmedia.com/


On 07/13/2012 05:42 PM, Prabhakar Pandey wrote:

Here is a snippet of my controller.xml

*request-map uri=submit
 security https=false auth=false /
 event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=createEmployee/
 event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=viewEmployee/
 response name=success type=view value=main /
 /request-map
*
can i have two events in it? and through Employee Events i am calling
viewEmployeeService in a EmployeeServices.java where i am getting values
from database and storing them in map.
while i am calling from service name from *EmployeeEvents *can i directly
call runsync without sending any map.??

Thanks



Re: Java Service Classes

2012-07-13 Thread Mayank

hi Prabhakar,
 In this scenario , your second event will not get executed because 
after getting response success(or error) from first event it will not 
return back to call the second event.
For achieving required functionality you can use response 
type=request-redirect in your first response

e.g

request-map uri=submit
security https=false auth=false /
event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=createEmployee/
response name=success type=request-redirect value=submitAgain 
/
/request-map

request-map uri=submitAgain
security https=false auth=false /
event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=viewEmployee/
response name=success type=view value=main /
/request-map

Thank you  Regards
Mayank Sheth
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/

On 07/13/2012 05:42 PM, Prabhakar Pandey wrote:

Here is a snippet of my controller.xml

*request-map uri=submit
 security https=false auth=false /
 event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=createEmployee/
 event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=viewEmployee/
 response name=success type=view value=main /
 /request-map
*
can i have two events in it? and through Employee Events i am calling
viewEmployeeService in a EmployeeServices.java where i am getting values
from database and storing them in map.
while i am calling from service name from *EmployeeEvents *can i directly
call runsync without sending any map.??

Thanks





Re: Java Service Classes

2012-07-13 Thread Mayank

Prabhakar,

 You can't call runSync in this way because it is wrong 
syntactically, you have to pass map as parameter while calling runSync. 
Also you can pass empty map as parameter but in this case service will 
return error : IN parameter is missing.


Regards
Mayank Sheth
On 07/13/2012 05:42 PM, Prabhakar Pandey wrote:

Here is a snippet of my controller.xml

*request-map uri=submit
 security https=false auth=false /
 event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=createEmployee/
 event type=java path=org.mindtree.testapp.EmployeeEvents
invoke=viewEmployee/
 response name=success type=view value=main /
 /request-map
*
can i have two events in it? and through Employee Events i am calling
viewEmployeeService in a EmployeeServices.java where i am getting values
from database and storing them in map.
while i am calling from service name from *EmployeeEvents *can i directly
call runsync without sending any map.??

Thanks





Re: Java Service Classes

2012-07-13 Thread Robert G.
Why dont you use service-groups

with that you can call a bundle of services, which run all together with
just one call..



--
View this message in context: 
http://ofbiz.135035.n4.nabble.com/Java-Service-Classes-tp4634814p4634819.html
Sent from the OFBiz - User mailing list archive at Nabble.com.