1
0
-1

Hi! I have two different types of services and I want to access a property from the Form Space. I tried to do it like this :

String value = new PropertyQuery()
.setName("Service property")
.setSpaceName(txn.spaceName)
.getValue()

The problem is that what happen in the groovy services that I don't have a transaction?, and what happen when I call a service that I don't send any transaction?

Is there a way to access the property "Service property" for all kind of services in the same way?


  1. Bill Frost

    Hi Fabiola,

    What types of service are you implementing?

CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1
    Hi Fabiola, 
    An alternative approach whereby you access the space then pull the resources for instance:

    def space = DaoFactory.portalDao.getPortalByName(portalNameHere)

    Then you can access say resources of this space thus:

    def resource = DaoFactory.portalResourceDao.getPortalResourceByPath(space.getId(), pathAsString)

    Hope this helps you move forward or generate some ideas for you.

    Thanks

    Petros

    1. Fabiola Ansara

      Hi Petros! Thanks for your answer.

      Is there a way that I don't have to hard code the portal name? Because I need this property in different environments and they have different form spaces name, so It make it more difficult. 

      I was thinking something like get current form space but I couldn't find how.


    2. Petros Christou

      Hi, there should be a way to return these as a list and iterate through.

    CommentAdd your comment...