Re: Getting isis working with Intellij

2019-11-03 Thread Vladimir Nišević
Hi, in company I am working in, we have many developers using Apache Isis
with their favorite IDE, either Eclipse or IntelliJ. Both ways pretty
straight forward.

Your screenshots are removed, probably by mailing list server, so it is
hard to support with no information.

Regs, Vladimir

James Smyth  schrieb am So., 3. Nov. 2019, 18:37:

> Good morning. The company I work for is trying to get apache isis
> installed so that we can evaluate it for a couple of our projects.
>
> We have tried installing on a Windows 10 PC and a Mac. We can clone
> projects or even create them using the SimpleApp Maven archetype. We can
> compile and run the samples from a terminal window on both system, however
> we cannot run from Intellij. When we create a configuration we cannot
> select the WebServer because it is not there. We have tried multiple times
> on multiple machines with no lock. Here is a screen shot of trying to add a
> configuration.
>
>
>
> And here is a look at the maven tab.
>
>
>
> As I said multiple devs have tried to get any project working from inside
> Intellij. We have tried different versions, cloning other peoples projects
> from GitHub etc. Having used other Naked Objects type systems, I feel this
> would be quite helpful if we can understand how to get it going.
>
>
>
> I noticed that between 1.14 and 1.15 something changed with the WebServer.
> Have other people run into these issues? Is there something we are doing
> wrong or need to check?
>
>
>
> Thanks for any help you can give us.
>
>
>
> Jim Smyth
>
>
>


Re: Major changes with Isis v2

2019-03-28 Thread Vladimir Nišević
Hi Andi, I am really looking forward to this feature! In the past I had lot
of discussions regarding using Isis framework instead of Spring
Boot/JPA/Hibernate. Having this possibility I guess I will get best of both
worlds.

What I currently really like about Isis is the possibility of using domain
services in entities by injection, and not to trap into "anemic domain
model anit-pattern" [1]. Would be interesting to understand how you plan to
support this feature in the future?

In my current projects, some developer argue that one of the weaknesses in
Isis is missing support of nested transaction. Any plans to address this
capability?

Thanks
Vladimir

[1] https://www.martinfowler.com/bliki/AnemicDomainModel.html



Am Do., 28. März 2019 um 11:04 Uhr schrieb Andi Huber :

> Hi folks,
>
> to keep you in the loop, we are currently re-platforming Isis on top of
> the latest Spring release. First thought was to make Spring integration a
> plug-able feature, but by having a closer look at how Spring handles
> persistence and especially transactions, it has now become clear, that we
> want to go all-in with Spring, and fully utilize Spring Data. This will not
> be optional but mandatory.
>
> This move has some profound consequences. Isis was initially built around
> JDO, which we will no longer support. We instead delegate any JDO concerns
> to the Spring community. Sadly there is no 'spring-data-jdo' module [1]
> yet, and it appears that there wont be one in the near future [2].
>
> Also at the moment it is not clear, whether Isis' builtin domain-event
> will be still supported with a v2 release. Spring's event API is much more
> powerful, why not just use that instead. However, we will have a look at
> whether its doable to provide some kind of backward compatibility.
>
> Also persistence and transactions [3] do work differently in Spring Data,
> than what you might be used to when using JDO. Its very likely that we'll
> drop eg. the 'RepositoryService'.
>
> All these changes for Isis appear necessary to stay relevant as a
> platform. We hope to have a 2.0.0-M3 milestone-release ready around Q3 to
> showcase Isis powered by Spring.
>
> In case you really need Jdo support, the way to go is to help the Spring
> community and implement the missing 'spring-data-jdo' module. This should
> not be to hard in terms of lines of code required.
>
> Cheers, Andi!
>
> [1] https://github.com/spring-projects/spring-framework/issues/18702
> [2] https://jira.spring.io/browse/DATACMNS-96
> [3]
> https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#spring-data-tier
>
>
>
>
>
>
>
>
>


Re: Warning a user based on input on action invocation

2018-11-23 Thread Vladimir Nišević
Yes, this feature would be great one!

In one application (non Isis but Eclipse RCP) we developed times ago, we
had UI style guide where each input field can have
warning/information/error depending on current user input (ideally giving
feedback on each keystroke or when list selection happened).
Additionaly,  whole dialog (if modal) can provide same feedback to user,
when e.g. multiple input values in their combination lead to invalid
state...

Would be interesting if this feedback/validation could be (partially?)
delegated to browser JS engine and so reduce network overhead but at the
same time keeping the beauty of Isis programming model?

Regs,Vladimir

Am Fr., 23. Nov. 2018, 17:06 hat Dan Haywood 
geschrieben:

> Yeah, I think this is a great idea.
>
> How about "advise" as a prefix to me; as in we are providing advice.  Also
> sounds "softer" in tone than "warn".
>
> I guess it'll introduce a new phase ... hide, disable, validate, advise,
> executing, executed.  So might be quite a bit of work to implement, but I
> can see the value.
>
> What do others think?
>
> Thx
> Dan
>
> On Fri, 23 Nov 2018 at 15:56, Sander Ginn  wrote:
>
> > Hi,
> >
> > We’ve had a number of support requests relating to new users of our
> > application that are not yet fully familiar with their business process.
> > We do not wish to invalidate input as many business rules are not clearly
> > defined in a ‘correct/incorrect’ fashion, with many exceptions and
> special
> > cases.
> >
> > As a middle ground, I would like to propose an extension of the metamodel
> > with a support method similar to validateXxx(), which renders the
> familiar
> > dialog and warning message underneath the input field with another colour
> > (yellow, probably) but does not block the user from completing the
> action.
> >
> > Does anyone else consider this to be a useful addition, and if so, what
> > would be a good method prefix? My first thought was warnXxx(), but that
> > does not make a lot of sense syntactically; after all, we aren’t warning
> > the action in question (as opposed to validate/hide/disableXxx()) but the
> > user instead.
> >
> > Best
> > Sander Ginn
>


Re: New Isis 2 Demo available

2018-09-21 Thread Vladimir Nišević
Hi Andi, just tried out your docker image. Looks great! Looking forward to
Isis 2.

Thanks
Vladimir

Am Mi., 19. Sep. 2018 um 09:28 Uhr schrieb Andi Huber :

> I'm happy to announce a new docker image build for the isis-2-demo app
> [1]. It's built against the latest Apache Isis 2.0.0-M2 snapshot version.
> We've added 2 new features:
>
> 1) Showing the ErrorReportingService and how to customize with nice
> 'kitties'.
> 2) Showing the rather new 'Multi-Select' feature aka 'Associated Actions',
> which is also available in Isis 1.16.x
>
> Enjoy!
>
> [1] https://github.com/andi-huber/isis-2-demo
>


Re: Support for nested transactions

2018-08-10 Thread Vladimir Nišević
Hi Dan, we found that simply starting new Thread and using IsisContext
works as well. Would be that also feasible approach?

Regs
Vladimir

new Thread(() -> {
IsisContext.getSessionFactory().doInSession(() ->
doSomeStuffWithNewDatabaseTransactionHere);
}).start();


Am Fr., 10. Aug. 2018 um 11:11 Uhr schrieb Vladimir Nišević <
vnise...@gmail.com>:

> Hi Dan, thanks for the fast reply!
>
> Yes, we tried already with TransactionsService but this is not enough
> since this supports only one at the time.
>
> We will go for the solution using AbstractIsisSessionTemplate!
>
> Thanks
> Vladimir
>
>
> Am Fr., 10. Aug. 2018 um 10:06 Uhr schrieb Dan Haywood <
> d...@haywood-associates.co.uk>:
>
>> Hi Vladimir,
>> A couple of ideas which might help.
>>
>> First, there's the Transactions device that allows you to commit the
>> automatically created transaction and then start a new one. This lets you
>> have multiple transactions within a given request/session. However,
>> there's
>> no support for catching errors/rollbacks.
>>
>> Alternatively, you could use a regular java Executor/thread pool and then
>> have the threads create their own session using
>> AbstratIsisSessionTemplate.
>>
>> Or, you create background commands and have them invoked via a background
>> scheduler. In 1.x you will need to being in quartz, but 2.0.0-M1 has
>> built-in support.
>>
>> HTH,
>> Dan.
>>
>> On Fri, 10 Aug 2018, 08:58 Vladimir Nišević,  wrote:
>>
>> > Hi folks, as I understand, Isis supports by default one JDBC
>> transaction at
>> > time as part of single IsisTransaction and single IsisSession.
>> >
>> > We have a case where we would need nested JDBC transactions or multiple
>> > parallel transactions where some of the transactions we would need to
>> > rollback and some of them commit.
>> >
>> > Any ideas how to achieve this
>> >
>> >
>> > Kind regards
>> > Vladimir
>> >
>> --
>> DISCLAIMER: This e-mail is from Haywood Associates Ltd (Registered Number
>> 3525455) and it and its attachments may be confidential and are intended
>> solely for the use of the individual to whom it is addressed.  Any
>> unauthorised use or dissemination of this communication is strictly
>> prohibited. Any information provided to Haywood Associates Ltd shall be
>> retained and used in accordance with our Privacy Statement at
>> http://www.haywood-associates.co.uk/privacy.  If you have received this
>> communication in error, please immediately notify the sender by return
>> e-mail message and delete all copies of the original communication.
>>
>


Re: Support for nested transactions

2018-08-10 Thread Vladimir Nišević
Hi Dan, thanks for the fast reply!

Yes, we tried already with TransactionsService but this is not enough since
this supports only one at the time.

We will go for the solution using AbstractIsisSessionTemplate!

Thanks
Vladimir


Am Fr., 10. Aug. 2018 um 10:06 Uhr schrieb Dan Haywood <
d...@haywood-associates.co.uk>:

> Hi Vladimir,
> A couple of ideas which might help.
>
> First, there's the Transactions device that allows you to commit the
> automatically created transaction and then start a new one. This lets you
> have multiple transactions within a given request/session. However, there's
> no support for catching errors/rollbacks.
>
> Alternatively, you could use a regular java Executor/thread pool and then
> have the threads create their own session using AbstratIsisSessionTemplate.
>
> Or, you create background commands and have them invoked via a background
> scheduler. In 1.x you will need to being in quartz, but 2.0.0-M1 has
> built-in support.
>
> HTH,
> Dan.
>
> On Fri, 10 Aug 2018, 08:58 Vladimir Nišević,  wrote:
>
> > Hi folks, as I understand, Isis supports by default one JDBC transaction
> at
> > time as part of single IsisTransaction and single IsisSession.
> >
> > We have a case where we would need nested JDBC transactions or multiple
> > parallel transactions where some of the transactions we would need to
> > rollback and some of them commit.
> >
> > Any ideas how to achieve this
> >
> >
> > Kind regards
> > Vladimir
> >
> --
> DISCLAIMER: This e-mail is from Haywood Associates Ltd (Registered Number
> 3525455) and it and its attachments may be confidential and are intended
> solely for the use of the individual to whom it is addressed.  Any
> unauthorised use or dissemination of this communication is strictly
> prohibited. Any information provided to Haywood Associates Ltd shall be
> retained and used in accordance with our Privacy Statement at
> http://www.haywood-associates.co.uk/privacy.  If you have received this
> communication in error, please immediately notify the sender by return
> e-mail message and delete all copies of the original communication.
>


Support for nested transactions

2018-08-10 Thread Vladimir Nišević
Hi folks, as I understand, Isis supports by default one JDBC transaction at
time as part of single IsisTransaction and single IsisSession.

We have a case where we would need nested JDBC transactions or multiple
parallel transactions where some of the transactions we would need to
rollback and some of them commit.

Any ideas how to achieve this


Kind regards
Vladimir


How to use alternative in memory database for Integration/Cucumber tests

2018-05-14 Thread Vladimir Nišević
Dear Isis community, we have upgraded to Isis 1.16.2 and now we are forced
to use HSQL-DB as in-memory database.

Here the code from isis-core-runtime-1.16.2.jar which is responsible for
that


package org.apache.isis.core.runtime.headless;
...
public class IsisSystemBootstrapper {


private static IsisSystem setupSystem(final AppManifest2 appManifest2) {

final IsisConfigurationForJdoIntegTests configuration = new
IsisConfigurationForJdoIntegTests();

configuration.putDataNucleusProperty("javax.jdo.option.ConnectionURL","jdbc:hsqldb:mem:test-"
+ UUID.randomUUID().toString());
final IsisSystem.Builder isftBuilder =
new IsisSystem.Builder()
.withLoggingAt(org.apache.log4j.Level.INFO)
.with(appManifest2)
.with(configuration);

IsisSystem isft = isftBuilder.build();
isft.setUpSystem();

// save both the system and the manifest
// used to bootstrap the system onto thread-loca
IsisSystem.set(isft);
isftAppManifest.set(appManifest2);

return isft;
}

Since we had in the past issues with HSQL-DB (sequences are sometimes
generated in PUBLIC scheme and not accessible from datanucleus persistence)
we have moved to H2 database, it seems to be more robust,

But since upgrade to 1.16.2 we are forced to use HSQLB in
Integration/Cucumber tests.

Any hints how to change this?

Regards,Vladimir


Re: Chat

2017-12-05 Thread Vladimir Nišević
Hi, for this purpose we usually introduce for a separate domain service,
use it's lifecycle ( described here
https://isis.apache.org/guides/ugfun/ugfun.html#_ugfun_programming-model_domain-services_initialization
) to initialize/shutdown connectivity the service and implement actions to
be used by rest of domain model.

I this way we did connectivity to Elastic, JMS, additional Databases etc.

Regs,Vladimir



2017-12-05 0:33 GMT+01:00 Aída Betzabeth Dávila Sotelo <
aida.dav...@vortech-it.com>:

> Hi,
> We want to know if it is possible to configure our server to establish a
> connection to a socket App, this is to give the instant messaging service.
> We are currently developing the chat function using socket IO.
>
> Thanks in advance.
> Aida
>


SimpleApp has isis.properites at two places

2017-12-01 Thread Vladimir Nišević
Hi, I've just noticed, that in the latest simpleapp (1.15.1) created from
archetype there is a file "isis.properties" at two places and it seems that
we need them at both:

   1.
   
simpleapp\application\src\main\resources\domainapp\application\manifest\isis.properties
   2. simpleapp\webapp\src\main\webapp\WEB-INF\isis.properties


Additionaly, the second file contains now the database configuration but
there is also a file
'simpleapp\application\src\main\resources\domainapp\application\manifest\persistor_datanucleus.properties'
where datanucleus configuration is also defined.

For me this is confusing and hard to manage because we have now generally
speaking three times isis.properties:

* two times packaged in the war as desribed and
* third time when we use externalized configuration, because ususally we
exchange war file but environment-specific configuration is stores
separately.

What if a single configuration is stored in all three files, which takes
precedence?

Regs,Vladimir


Re: Using view model as parameter in restful inteface

2017-10-31 Thread Vladimir Nišević
Hi Dan, thanks for your hints!
We have solved it so that we pass single string parameter containing
multiple strings concatanated by a special character. So we have built an
custom marshaller/unmarshaller, guess similar to your second proposal.

Vladimir

Am 31.10.2017 07:52 schrieb "Dan Haywood" <d...@haywood-associates.co.uk>:

> Hi Vladimir,
>
> Sorry no-one came back to you on this... did you find a solution?
>
> I have two ideas.
>
> First, since in this case the view model is basically just two lsts of
> strings, probably the REST API ought to be able to support actions with
> collections as parameters.  I know that the Wicket viewer supports
> parameter collections, but I'm pretty sure that the RO viewer doesn't,
> unfortunately.  Maybe that's a ticket that ought to be raised and
> implemented.
>
> Second idea... rather than try to "upload" the OffterTemplateFilter view
> model as a parameter, instead treat it as a resource.  That is, have a new
> service to create an instance of the filter, and then update this filter
> (adding/removing from its two collections).  When done, pass a reference to
> the filter to the original REST service, as a regular reference.
> (Obviously the URL will be rather long and messy, but that's not a problem
> per-se).
>
> HTH
> Dan
>
>
>
>
> On Thu, 5 Oct 2017 at 13:58 Vladimir Nišević <vnise...@gmail.com> wrote:
>
> > I must provide a REST service accepting more complex view model as input
> > parameter.
> >
> > My view model parameter would look like
> >
> > @DomainObject(nature = Nature.VIEW_MODEL, objectType =
> > "OfferTemplateFilter")
> > @XmlRootElement(name = "OfferTemplateFilter")
> > @XmlAccessorType(XmlAccessType.FIELD)
> > @Getter @Setter
> > public class OfferTemplateFilter {
> >
> > public OfferTemplateFilter() {
> > }
> >
> > public List selectedDeviceManufacturer = new ArrayList<>();
> >
> > public List selectedDeviceSizes = new ArrayList<>();
> >
> > }
> >
> > My REST domain service would be someting like
> >
> > @DomainService(nature = NatureOfService.VIEW_REST_ONLY, objectType =
> > "OfferRestService")
> > public class OfferRestService {
> >
> >  @Action(semantics = SemanticsOf.IDEMPOTENT)
> > public OfferTemplateSelectorForCustomer
> > offerSelectorForCustomer(final String subscriberNumber, final
> > OfferTemplateFilter filter) {
> > return offerSelectorRepository.create(subscriberNumber, filter);
> > }
> >
> >  
> > }
> >
> >
> > I'm wondering how this could be achieved without custom rest service.
> > Ideally the service consumer would post a kind of JSON structure where my
> > view model OfferTemplateFilter would be created?
> >
> > Any hint on this?
> >
> > Thanks
> > Vladimir
> >
>


Re: AW: Quartz | ISIS Metamodel Validation errors

2017-10-09 Thread Vladimir Nišević
+1

Vladimir

Am 09.10.2017 12:56 schrieb "Rade, Joerg / Kuehne + Nagel / Ham GI-DP" <
joerg.r...@kuehne-nagel.com>:

> +1
>
> -Ursprüngliche Nachricht-
> Von: Stephen Cameron [mailto:steve.cameron...@gmail.com]
> Gesendet: Montag, 9. Oktober 2017 12:49
> An: users@isis.apache.org
> Betreff: Re: Quartz | ISIS Metamodel Validation errors
>
> It seems a small detail, but having the explicit use of @Action probably
> would be better. I often have to add @Programmatic to make unexpected
> things go from the UI, its not the focus and so you forget it.
>
> On Mon, Oct 9, 2017 at 9:26 PM, Dan Haywood 
> wrote:
>
> > Do we think that Isis should require that public methods be annotated
> > as @Action in order to be picked up?  Put another way, that
> > @Programmatic is assumed unless @Action is specified?
> >
> > Maybe we could introduce a configuration property to make this
> > configurable, with the default currently as is?
> >
> > Thoughts?
> > Dan
> >
> >
> > On Mon, 9 Oct 2017 at 07:08 Jayesh Prajapati 
> wrote:
> >
> > > Thank you Oscar.
> > >
> > > Cheers,
> > > Jayesh
> > >
> > > On 08-Oct-2017 8:28 PM, "Óscar Bou"  wrote:
> > >
> > >
> > > Dear Jayesh,
> > >
> > > As you’ve discovered, Isis will automatically add to the metamodel
> > > as actions all public methods on Domain Entities and Services.
> > >
> > > When those public methods are intended as internal methods, but you
> > > need them to be public (due to package scope, etc.) you can annotate
> > > them with @Programmatic, telling Apache Isis that they’re not part
> > > of your app’s Domain metamodel.
> > >
> > > HTH,
> > >
> > > Oscar
> > >
> > >
> > > > El 8 oct 2017, a las 12:15, Jayesh Prajapati 
> > > escribió:
> > > >
> > > > Hi,
> > > >
> > > > I figured that above validation were applied on quartz objects
> > > > because
> > > they
> > > > were used as argument in one of the public method of a domain
> service.
> > > >
> > > > public JobDetail createJobDetail(String name, String group,
> > > > JobDataMap
> > > > jobDataMap) {
> > > >
> > > > After making this method private it started working fine. Any more
> > > > clarification/detail on above behavior is much appreciated.
> > > >
> > > > Cheers,
> > > > Jayesh
> > > >
> > > > On Sun, Oct 8, 2017 at 2:21 PM, Jayesh Prajapati
> > > > 
> > > > wrote:
> > > >
> > > >> Hi,
> > > >>
> > > >> I am using v1.15.0 along with quartz addon. While starting below
> > errors
> > > >> are reported.
> > > >>
> > > >>  ISIS METAMODEL
> > > >> VALIDATION ERRORS ##
> > > >> ##
> > > >>
> > > >> org.quartz.JobDataMap#clearDirtyFlag: has prefix clear, is
> > > >> probably intended as a supporting method for a property, collection
> or action.
> > > If
> > > >> the method is intended to be an action, then rename and use
> > > >> @ActionLayout(named="...") or ignore completely using
> > > >> @Programmatic
> > > >> org.quartz.utils.DirtyFlagMap#clearDirtyFlag: has prefix clear,
> > > >> is probably intended as a supporting method for a property,
> > > >> collection or action.  If the method is intended to be an action,
> > > >> then rename and
> > use
> > > >> @ActionLayout(named="...") or ignore completely using
> > > >> @Programmatic
> > > >> org.quartz.utils.StringKeyDirtyFlagMap#clearDirtyFlag: has prefix
> > clear,
> > > >> is probably intended as a supporting method for a property,
> > > >> collection
> > > or
> > > >> action.  If the method is intended to be an action, then rename
> > > >> and
> > use
> > > >> @ActionLayout(named="...") or ignore completely using
> > > >> @Programmatic
> > > >>
> > > >> Please inspect the above messages and correct your domain model.
> > > >>
> > > >>  ISIS METAMODEL
> > > >> VALIDATION ERRORS ##
> > > >> ##
> > > >>
> > > >>
> > > >> These classes are part of Quartz library and hence I cannot
> > > >> attach Programmatic annotation.
> > > >>
> > > >> Question is why metamodel validations are applied on classes
> > > >> under org.quartz package?
> > > >>
> > > >> Any way to skip this validation will help greatly. As of now this
> > > >> is blocking access to Wicket UI. As a workaround I am
> > > >> initializing quartz
> > > on
> > > >> click of an action/button.
> > > >>
> > > >> Thanks,
> > > >> Jayesh
> > > >>
> > >
> >
>
> Kühne + Nagel (AG & Co.) KG
> Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE
> 812773878.
> Geschäftsleitung Kühne + Nagel (AG & Co.) KG: Dr. Hansjörg Rodi (Vors. ),
> Martin Brinkmann, Holger Ketz, Jan-Hendrik Köstergarten, Nicholas Minde,
> Michael Nebel, Lars Wedel, Matthias Weiner.
> Persönlich haftende Gesellschafterin: Kühne & Nagel A.G., Rechtsform:
> Aktiengesellschaft nach luxemburgischem 

Re: Getting "Header is too large 8193>8192" exception when using larger view models

2017-10-06 Thread Vladimir Nišević
Hi Dan, thanks for your input, will try this out, although I didn't
understand yet how it helps.
I don't generally understand how is the lifecycle of view model, do you
hold them in server session, Or forward them marshalled to browser and then
back to server, or even both?

Alternatively I found that different servers (Tomcat,  Jetty) have
different default maximum request size.  Jetty has default 8192 bytes, but
there is a possibility to adapt it.

So alternative would be to pass higher value to org.apache.isis.WebServer
so it can launch embedded Jetty with higher value?
Would also try in this direction and if successful would propose a PR.

Thanks,Vladimir

Am 06.10.2017 16:10 schrieb "Dan Haywood" <d...@haywood-associates.co.uk>:

> Hi Vladimir,
>
> We hit this issue in Estatio too a while back.  I have a solution which,
> for some reason, is in the non open source bit of Estatio we have; not sure
> why I put it there, will have to move it to the github side.
>
> Anyway, try adding this:
>
>
> @DomainService(nature = NatureOfService.DOMAIN)
> public class UrlEncodingUsingBaseEncodingSupportLargeUrls extends
> UrlEncodingServiceUsingBaseEncoding {
>
> /**
>  * Strings under this length are not cached, just returned as is.
>  */
> private static final int MIN_LENGTH_TO_CACHE = 500;
> /**
>  * Used to distinguish which strings represent keys in the cache,
> versus those not cached.
>  */
> private static final String KEY_PREFIX = "__";
>
> private static final int EXPECTED_SIZE = 1000;
>
> // this is a naive implementation that will leak memory
> private final BiMap<String, String> cachedValueByKey =
> Maps.synchronizedBiMap(HashBiMap.<String,
> String>create(EXPECTED_SIZE));
>
> @Override
> public String encode(final String value) {
> if(!canCache(value)) {
> return super.encode(value);
> }
>
> synchronized (cachedValueByKey) {
> String key = cachedValueByKey.inverse().get(value);
> if (key == null) {
> key = newKey();
> cachedValueByKey.put(key, value);
> }
> return KEY_PREFIX + key;
> }
> }
>
> @Override
> public String decode(final String key) {
> if(key == null || !key.startsWith(KEY_PREFIX)) {
> return super.decode(key);
> }
> String keySuffix = key.substring(KEY_PREFIX.length());
> return cachedValueByKey.get(keySuffix);
> }
>
> /**
>  * Factored out to allow easy subclassing.
>  */
> protected String newKey() {
> return UUID.randomUUID().toString();
> }
>
> private boolean canCache(final String key) {
> return key != null && key.length() > MIN_LENGTH_TO_CACHE;
> }
>
>
> }
>
>
>
> This is a bit hacky, and will leak memory, so is not suitable for a high
> volume environment.  You might therefore  want to refactor it to use an
> external cache such as Redis, or alternativelye to somehow invalidate
> sessions, eg by also storing a handle to the session that creates the key.
>
> If you come up with anything better, please do contribute it back.
>
> HTH
> Dan
>
>
>
>
>
> On Fri, 6 Oct 2017 at 14:34 Vladimir Nišević <vnise...@gmail.com> wrote:
>
> > Hi, my view models seems to be such large that I get now the exception
> > "Header is too large 8193>8192" when browser submits e.g. an action from
> > rendered view model to server running on jetty.
> >
> > Is this a jetty-specific issue is has generally related with the fact
> that
> > view model is marshalled into GET parameter.
> >
> > Any idea how to solve this?
> >
> >
> > Thanks
> > Vladimir
> >
>


Getting "Header is too large 8193>8192" exception when using larger view models

2017-10-06 Thread Vladimir Nišević
Hi, my view models seems to be such large that I get now the exception
"Header is too large 8193>8192" when browser submits e.g. an action from
rendered view model to server running on jetty.

Is this a jetty-specific issue is has generally related with the fact that
view model is marshalled into GET parameter.

Any idea how to solve this?


Thanks
Vladimir


Using view model as parameter in restful inteface

2017-10-05 Thread Vladimir Nišević
I must provide a REST service accepting more complex view model as input
parameter.

My view model parameter would look like

@DomainObject(nature = Nature.VIEW_MODEL, objectType = "OfferTemplateFilter")
@XmlRootElement(name = "OfferTemplateFilter")
@XmlAccessorType(XmlAccessType.FIELD)
@Getter @Setter
public class OfferTemplateFilter {

public OfferTemplateFilter() {
}

public List selectedDeviceManufacturer = new ArrayList<>();

public List selectedDeviceSizes = new ArrayList<>();

}

My REST domain service would be someting like

@DomainService(nature = NatureOfService.VIEW_REST_ONLY, objectType =
"OfferRestService")
public class OfferRestService {

 @Action(semantics = SemanticsOf.IDEMPOTENT)
public OfferTemplateSelectorForCustomer
offerSelectorForCustomer(final String subscriberNumber, final
OfferTemplateFilter filter) {
return offerSelectorRepository.create(subscriberNumber, filter);
}

 
}


I'm wondering how this could be achieved without custom rest service.
Ideally the service consumer would post a kind of JSON structure where my
view model OfferTemplateFilter would be created?

Any hint on this?

Thanks
Vladimir


Re: Addon module isis-module-settings is not working after upgrade to Isis 1.15.0

2017-08-24 Thread Vladimir Nišević
Hi Dan, sorry, you are right, I missed to push the changes. Meanwhile they
should be there.

Reproduce the bug:

-  Create new "Application Setting" or "User Setting" of type e.g. String.


Thanks
Vladimir

2017-08-24 8:40 GMT+02:00 Dan Haywood <d...@haywood-associates.co.uk>:

> Hi Vladimir,
> that example branch doesn't seem to be anything other than the current
> master branch of the main github/isis.
>
> could you configure the add-on and add an action to demonstrate the issue?
>  (ie commit the code you must've been running to generate the above stack
> trace)
>
> thx
> Dan
>
> On Thu, 24 Aug 2017 at 06:50 Vladimir Nišević <vnise...@gmail.com> wrote:
>
> > Hi, I have an issue with latest Isis version 1.15.0 and module
> > isis-module-settings (in both addon versions, 1.15-SNAPSHOT and  1.14.0)
> >
> > How to reproduce:
> >
> > * Integrate addon with simpleapp
> > * Try to create an Application Settings "New String"
> >
> > Here my fork with simpleapp and addon:
> > https://github.com/niv0/isis/tree/simpleapp-with-settings-addon
> >
> >
> > Regards,Vladimir
> >
> >
> > And here the stack trace:
> >
> > 07:45:49,678  [RequestCycleExtraqtp942986815-17 WARN ]  Handling the
> > following exception
> > org.apache.wicket.WicketRuntimeException: Method onRequest of interface
> > org.apache.wicket.behavior.IBehaviorListener targeted at
> > org.apache.wicket.ajax.markup.html.form.AjaxButton$1@302b1c47 on
> component
> > [IndicatingAjaxButton [Component id = okButton]] threw an exception
> > at
> >
> > org.apache.wicket.RequestListenerInterface.internalInvoke(
> RequestListenerInterface.java:268)
> > at
> >
> > org.apache.wicket.RequestListenerInterface.invoke(
> RequestListenerInterface.java:241)
> > at
> >
> > org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandle
> r.invokeListener(ListenerInterfaceRequestHandler.java:248)
> > at
> >
> > org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandle
> r.respond(ListenerInterfaceRequestHandler.java:234)
> > at
> >
> > org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(
> RequestCycle.java:895)
> > at
> >
> > org.apache.wicket.request.RequestHandlerStack.execute(
> RequestHandlerStack.java:64)
> > at
> > org.apache.wicket.request.cycle.RequestCycle.execute(
> RequestCycle.java:265)
> > at
> >
> > org.apache.wicket.request.cycle.RequestCycle.
> processRequest(RequestCycle.java:222)
> > at
> >
> > org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(
> RequestCycle.java:293)
> > at
> >
> > org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(
> WicketFilter.java:261)
> > at
> >
> > org.apache.wicket.protocol.http.WicketFilter.
> processRequest(WicketFilter.java:203)
> > at
> >
> > org.apache.wicket.protocol.http.WicketFilter.doFilter(
> WicketFilter.java:284)
> > at
> >
> > org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> doFilter(ServletHandler.java:1676)
> > at
> >
> > org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter.
> doFilter(IsisLogOnExceptionFilter.java:52)
> > at
> >
> > org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> doFilter(ServletHandler.java:1676)
> > at
> >
> > org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(
> AbstractShiroFilter.java:449)
> > at
> >
> > org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(
> AbstractShiroFilter.java:365)
> > at
> >
> > org.apache.shiro.subject.support.SubjectCallable.
> doCall(SubjectCallable.java:90)
> > at
> >
> > org.apache.shiro.subject.support.SubjectCallable.call(
> SubjectCallable.java:83)
> > at
> >
> > org.apache.shiro.subject.support.DelegatingSubject.
> execute(DelegatingSubject.java:383)
> > at
> >
> > org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(
> AbstractShiroFilter.java:362)
> > at
> >
> > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(
> OncePerRequestFilter.java:125)
> > at
> >
> > org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> doFilter(ServletHandler.java:1668)
> > at
> > org.eclipse.jetty.servlet.ServletHandler.doHandle(
> ServletHandler.java:581)
> > at
> >
> > org.eclipse.jetty.server.handler.ScopedHandler.handle(
> ScopedHandler.java:143)
> > at
> > org.eclipse.

Addon module isis-module-settings is not working after upgrade to Isis 1.15.0

2017-08-23 Thread Vladimir Nišević
Hi, I have an issue with latest Isis version 1.15.0 and module
isis-module-settings (in both addon versions, 1.15-SNAPSHOT and  1.14.0)

How to reproduce:

* Integrate addon with simpleapp
* Try to create an Application Settings "New String"

Here my fork with simpleapp and addon:
https://github.com/niv0/isis/tree/simpleapp-with-settings-addon


Regards,Vladimir


And here the stack trace:

07:45:49,678  [RequestCycleExtraqtp942986815-17 WARN ]  Handling the
following exception
org.apache.wicket.WicketRuntimeException: Method onRequest of interface
org.apache.wicket.behavior.IBehaviorListener targeted at
org.apache.wicket.ajax.markup.html.form.AjaxButton$1@302b1c47 on component
[IndicatingAjaxButton [Component id = okButton]] threw an exception
at
org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at
org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter.doFilter(IsisLogOnExceptionFilter.java:52)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at

Specifying cssClass in runfime?

2017-08-19 Thread Vladimir Nišević
Hi, I have a requirement to present the background of specific property
based on its value or depending on other object properties. Currently I can
define cssClass as described
https://isis.apache.org/guides/ugfun/ugfun.html#_ugfun_ui-hints_action-icons-and-css
at development time.

It would be great if I could define a kind of specification class similar
to
https://isis.apache.org/guides/rgant/rgant.html#_rgant-Property_mustSatisfy
which returns cssClass in runtime.

It could look like this

public class Customer {
@Property(cssSpecification=MyCssClass.class)
public String getFirstName() { ... }
...
}



public class MyCssClass implements CssSpecification {
public String cssClass(Object obj) {
if (((Customer) getFirstName())==null)
  return "x-test";
return "x-firstName-not-empty";
}
}


Make this requirement sense, and if so, any hints how I could implement
this?

Regards,Vladimir


Issue with auto-reload - getXxx properties not updated

2017-08-18 Thread Vladimir Nišević
Hi, I am trying to implement auto-refresh feature following the guide (
https://isis.apache.org/guides/ugvw/ugvw.html#_ugvw_customisation_auto-refresh
) and have an issue there.

I have implemented my own HomePage view model, this has an getXxx method
representing an field showing in the home page.

@DomainObject(nature = Nature.VIEW_MODEL, editing = Editing.DISABLED,
objectType = "StandardHomePage")
public class StandardHomePage  {

public StandardHomePage() {
}

public String cssClass() {
return "my-special-auto-updating-entity";
}

...

@PropertyLayout(named = "Hupe Status")
@MemberOrder(name = Layout.LAYOUT_HORN, sequence = "4.1")
public String getCurrentHornState() {
TitleBuffer titleBuffer = new TitleBuffer();
final SignalHorn horn = deviceRepository.getSignalHorn();
if (horn == null)
return "Hupe nicht vorhanden";
return horn.title();
}

...

}

I create home page thru domain service


@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
public class HomePageService {

//region > homePage (action)
@Action(semantics = SemanticsOf.SAFE)
@HomePage
public BgwHomePage homePage() {
   return new StandardHomePage();
}

And my application.js looks

$(function() {
if ($(".my-special-auto-updating-entity").length) {
setTimeout(function() {document.location.reload(true);},
15000); // 1000 is 1 sec, 30 sec
}
});


In debugger I observe that StandardHomePage constructor and getXxx
method is called differently:

1. after login browser goes to e.g.
http://localhost:9090/wicket/entity?2  and auto-reload after e.g. 15
seconds calls only constructor but not the getXxx method
3. after clicking on upper-left hand side icon representing the home
page I get the again the url e.g..
(http://localhost:9090/wicket/entity?32) and the auto refresh calls
only the constructor
4. after clicking on home page title - browser URL shows reference to
that view model  (something like
http://localhost:9090/wicket/entity/*StandardHomePage:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPG1lbWVudG8vPg==)
and constructor and getXxx method are called, and after that the auto
refresh behaviour is fine.

My problem are case #1 and #2  where method getXxx is not called - I
guess the view model is being deserialized for memento.

How can I fix this and prevent usage of serialized view model
representing the home page?

I am working with Isis version 1.14.x

Thanks,Vladimir


Re: [ANN] Apache Isis version 1.15.0 Released

2017-08-17 Thread Vladimir Nišević
Thanks Dan, great work!



2017-08-17 3:39 GMT+02:00 Stephen Cameron :

> It's excellent, my thanks to all those involved.
>
> On Tue, Aug 15, 2017 at 5:50 PM, Johan Doornenbal 
> wrote:
>
> > Congrats Dan. Thank you for all your work!!
> >
> >
> >
> >
> > On Mon, Aug 14, 2017 11:48 PM, Dan Haywood d...@haywood-associates.co.uk
> > wrote:
> > Thanks for the heads-up.
> >
> >
> >
> >
> > The correct links are:
> >
> > -
> >
> > http://isis.apache.org/release-notes/release-notes.html#_
> > release-notes_1.15.0
> >
> > -
> >
> > http://isis.apache.org/migration-notes/migration-notes.html#
> > _migration-notes_1.14.0-to-1.15.0
> >
> >
> >
> >
> >
> >
> >
> > I'll update our release procedures so this doesn't happen next time.
> >
> >
> >
> >
> > Thx
> >
> > DAn
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Mon, 14 Aug 2017 at 22:46 Mariano Lahoz 
> > wrote:
> >
> >
> >
> >
> > Hello Dan, releases notes are not found when opening link.
> >>
> >
> >
> >>
> >
> >>
> > On Mon, 14 Aug 2017 at 17:08 Dan Haywood 
> >>
> >
> > wrote:
> >>
> >
> >
> >>
> > > The Apache Isis team is pleased to announce the release of Apache Isis
> >>
> >
> > > v1.15.0.
> >>
> >
> > >
> >>
> >
> > > New features in this release include:
> >>
> >
> > > * inline prompts: the ability to edit a property or invoke an action
> >>
> >
> > > (associated with a property)
> >>
> >
> > > without requiring a modal dialog box.
> >>
> >
> > > * a "hello world" archetype
> >>
> >
> > > * upgrade of Apache Wicket from 6.x to 7.x.
> >>
> >
> > > * allow applications and integration tests to be bootstrapped with less
> >>
> >
> > > boilerplate
> >>
> >
> > > * new metamodel validations for JAXB view models
> >>
> >
> > > * rename isis-viewer-wicket artifacts to isis-core-viewer-wicket
> >>
> >
> > > (for consistency with other core modules)
> >>
> >
> > >
> >>
> >
> > > Full release notes are available on the Apache Isis website at [1].
> >>
> >
> > > Please also read the migration notes [2].
> >>
> >
> > >
> >>
> >
> > > You can access this release directly from the Maven central repo [3].
> >>
> >
> > > Alternatively, or download the release and build it from source [4].
> >>
> >
> > >
> >>
> >
> > > Enjoy!
> >>
> >
> > >
> >>
> >
> > > --The Apache Isis team
> >>
> >
> > >
> >>
> >
> > > [1] http://isis.apache.org/release-notes.html#r1.15.0
> >>
> >
> > > [2]
> >>
> >
> > >
> >>
> >
> > >
> >>
> >
> > http://isis.apache.org/migration-notes.html#_migration-
> >> notes_1.14.0-to-1.15.0
> >>
> >
> > > [3] http://search.maven.org
> >>
> >
> > > [4] http://isis.apache.org/downloads.html
> >>
> >
> > >
> >>
> >
> > --
> >>
> >
> >
> >>
> > *Mariano Lahoz Administrador de sistemas*
> >>
> >
> >
>


Re: simpleapp archetype doesn't build

2016-12-23 Thread Vladimir Nišević
Yes, I observe same issue, tried with artifact version 1.13.2

BR,Vladimir

2016-12-23 5:51 GMT+01:00 Stephen Cameron :

> Hi,
>
> I am try to a maven clean build on the SimpleApp archetype and get the
> following error message.
>
> Maybe something in the pom.xml files?
>
> [INFO]
> [INFO] SimpleApp Parent ... SUCCESS [
> 2.553 s]
> [INFO] SimpleApp Simple Module  FAILURE [
> 10.456 s]
> [INFO] SimpleApp Application .. SKIPPED
> [INFO] SimpleApp Webapp ... SKIPPED
> [INFO]
> 
> [INFO] BUILD FAILURE
> [INFO]
> 
> [INFO] Total time: 14.053 s
> [INFO] Finished at: 2016-12-23T15:45:15+11:00
> [INFO] Final Memory: 30M/981M
> [INFO]
> 
> [ERROR] Failed to execute goal
> org.datanucleus:datanucleus-maven-plugin:4.0.5:enhance (process-classes)
> on
> project myapp-module-simple: Error executing DataNucleus tool
> org.datanucleus.enhancer.DataNucleusEnhancer: InvocationTargetException:
> Plugin (Bundle) "org.datanucleus.api.jdo" is already registered. Ensure you
> dont have multiple JAR versions of the same plugin in the classpath. The
> URL
> "file:/d:/maven/repository/org/datanucleus/datanucleus-
> api-jdo/4.1.1/datanucleus-api-jdo-4.1.1.jar"
> is already registered, and you are trying to register an identical plugin
> located at URL
> "file:/D:/maven/repository/org/datanucleus/datanucleus-
> api-jdo/4.1.1/datanucleus-api-jdo-4.1.1.jar."
> -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> [ERROR]
> [ERROR] After correcting the problems, you can resume the build with the
> command
> [ERROR]   mvn  -rf :myapp-module-simple
>


Re: Issue in isis-module-security - in combination with delegateAuthenticationRealm

2016-12-02 Thread Vladimir Nišević
Hi Dan, here the adapted file
https://github.com/niv0/isis-module-security/blob/5cd324a655347ff7a148326d46a5ec612bd0f22c/dom/src/main/java/org/isisaddons/module/security/shiro/IsisModuleSecurityRealm.java

I've made also an PR, but somehow it was mixed up with some previous PR
which is still pending on github.


The behavior is configurable thru next property in shiro.ini

isisModuleSecurityRealm.autoCreateUser=true


BR,Vladimir



2016-12-01 16:43 GMT+01:00 Vladimir Nišević <vnise...@gmail.com>:

> Hi, understand, ok, will give a try!
>
> Regs,Vladimir
>
>
> 2016-12-01 16:37 GMT+01:00 Dan Haywood <d...@haywood-associates.co.uk>:
>
>> Yes, not a bug but a feature :-)  However, if you want to create a PR to
>> make the behaviour configurable, will be very happy to review.
>>
>> Cheers
>> Dan
>>
>> On Thu, 1 Dec 2016 at 15:32 Vladimir Nišević <vnise...@gmail.com> wrote:
>>
>> > Hi, I am using security module in combination with our Active Directory:
>> >
>> >1. Roles and delegate users (without passwords) are created in Isis
>> >security module
>> >2. Authentication is done thru company Active Directory
>> >
>> >
>> > I think, I've found an issue in this setup: As part of login procedure,
>> if
>> > the user doesn't exist in Isis security, it will be automatically
>> created
>> > as new delegate user (with Status=Disabled). This leads to potentially
>> many
>> > users in security module, every time when somebody e.g. mistypes the
>> > username.
>> >
>> >
>> > Here my shiro.ini
>> >
>> > *[main]*
>> > *isisModuleSecurityRealm =
>> > org.isisaddons.module.security.shiro.IsisModuleSecurityRealm*
>> > *authenticationStrategy =
>> >
>> > org.isisaddons.module.security.shiro.AuthenticationStrategyF
>> orIsisModuleSecurityRealm*
>> > *securityManager.authenticator.authenticationStrategy =
>> > $authenticationStrategy*
>> > *securityManager.realms = $isisModuleSecurityRealm*
>> > *isisModuleSecurityRealm.delegateAuthenticationRealm=$active
>> DirectoryRealm*
>> > *activeDirectoryRealm =
>> > org.apache.shiro.realm.activedirectory.ActiveDirectoryRealm*
>> > *activeDirectoryRealm.searchBase =*
>> > *activeDirectoryRealm.url = **
>> >
>> > I think the bug is in the class
>> >
>> > org.isisaddons.module.security.shiro.IsisModuleSecurityRealm
>> >
>> > line 48:
>> > *  PrincipalForApplicationUser principal =
>> this.lookupPrincipal(username,
>> > this.hasDelegateAuthenticationRealm());*
>> >
>> > it should be:
>> > * PrincipalForApplicationUser principal = this.lookupPrincipal(username,
>> > false);*
>> >
>> > Or was it on purpose to auto create new delegate user on every login
>> > attempt?
>> >
>> >
>> > Regards
>> > Vladimir
>> >
>>
>
>


Re: Issue in isis-module-security - in combination with delegateAuthenticationRealm

2016-12-01 Thread Vladimir Nišević
Hi, understand, ok, will give a try!

Regs,Vladimir


2016-12-01 16:37 GMT+01:00 Dan Haywood <d...@haywood-associates.co.uk>:

> Yes, not a bug but a feature :-)  However, if you want to create a PR to
> make the behaviour configurable, will be very happy to review.
>
> Cheers
> Dan
>
> On Thu, 1 Dec 2016 at 15:32 Vladimir Nišević <vnise...@gmail.com> wrote:
>
> > Hi, I am using security module in combination with our Active Directory:
> >
> >1. Roles and delegate users (without passwords) are created in Isis
> >security module
> >2. Authentication is done thru company Active Directory
> >
> >
> > I think, I've found an issue in this setup: As part of login procedure,
> if
> > the user doesn't exist in Isis security, it will be automatically created
> > as new delegate user (with Status=Disabled). This leads to potentially
> many
> > users in security module, every time when somebody e.g. mistypes the
> > username.
> >
> >
> > Here my shiro.ini
> >
> > *[main]*
> > *isisModuleSecurityRealm =
> > org.isisaddons.module.security.shiro.IsisModuleSecurityRealm*
> > *authenticationStrategy =
> >
> > org.isisaddons.module.security.shiro.AuthenticationStrategyForIsisM
> oduleSecurityRealm*
> > *securityManager.authenticator.authenticationStrategy =
> > $authenticationStrategy*
> > *securityManager.realms = $isisModuleSecurityRealm*
> > *isisModuleSecurityRealm.delegateAuthenticationRealm=$
> activeDirectoryRealm*
> > *activeDirectoryRealm =
> > org.apache.shiro.realm.activedirectory.ActiveDirectoryRealm*
> > *activeDirectoryRealm.searchBase =*
> > *activeDirectoryRealm.url = **
> >
> > I think the bug is in the class
> >
> > org.isisaddons.module.security.shiro.IsisModuleSecurityRealm
> >
> > line 48:
> > *  PrincipalForApplicationUser principal = this.lookupPrincipal(username,
> > this.hasDelegateAuthenticationRealm());*
> >
> > it should be:
> > * PrincipalForApplicationUser principal = this.lookupPrincipal(username,
> > false);*
> >
> > Or was it on purpose to auto create new delegate user on every login
> > attempt?
> >
> >
> > Regards
> > Vladimir
> >
>


Issue in isis-module-security - in combination with delegateAuthenticationRealm

2016-12-01 Thread Vladimir Nišević
Hi, I am using security module in combination with our Active Directory:

   1. Roles and delegate users (without passwords) are created in Isis
   security module
   2. Authentication is done thru company Active Directory


I think, I've found an issue in this setup: As part of login procedure, if
the user doesn't exist in Isis security, it will be automatically created
as new delegate user (with Status=Disabled). This leads to potentially many
users in security module, every time when somebody e.g. mistypes the
username.


Here my shiro.ini

*[main]*
*isisModuleSecurityRealm =
org.isisaddons.module.security.shiro.IsisModuleSecurityRealm*
*authenticationStrategy =
org.isisaddons.module.security.shiro.AuthenticationStrategyForIsisModuleSecurityRealm*
*securityManager.authenticator.authenticationStrategy =
$authenticationStrategy*
*securityManager.realms = $isisModuleSecurityRealm*
*isisModuleSecurityRealm.delegateAuthenticationRealm=$activeDirectoryRealm*
*activeDirectoryRealm =
org.apache.shiro.realm.activedirectory.ActiveDirectoryRealm*
*activeDirectoryRealm.searchBase =*
*activeDirectoryRealm.url = **

I think the bug is in the class

org.isisaddons.module.security.shiro.IsisModuleSecurityRealm

line 48:
*  PrincipalForApplicationUser principal = this.lookupPrincipal(username,
this.hasDelegateAuthenticationRealm());*

it should be:
* PrincipalForApplicationUser principal = this.lookupPrincipal(username,
false);*

Or was it on purpose to auto create new delegate user on every login
attempt?


Regards
Vladimir


Re: Simpleapp 12.0.1. - Swagger not working when packaging war and deploying to Tomcat

2016-05-19 Thread Vladimir Nišević
Hi Dan, thanks for the advice!

We have a multiple stages for our system (Dev PC, DEV, INT, PROT),  the
context root value changes - at least between developer pc and deployment
on Tomcat.

Developer PC:
No context root since running with embedded jetty - no adaptations needed
for swagger-ui/index.html and web.xml

DEV, INT:
There is a context root e.g. "simpleapp" - adaptations needed in
swagger-ui/index.html
and web.xml


Any idea how to make that configurable so that swagger works in both cases?

Thanks,Vladimir



2016-05-17 1:10 GMT+02:00 Dan Haywood <d...@haywood-associates.co.uk>:

> Ah, I remember this issue.
>
> It turns out that it does work, so long as you deploy the webapp as
> ROOT.war.
>
> The issue is the path to the swaggerService does not resolve correctly when
> running as anything other than the root app.
>
> I did manage to figure out the hacks though if you really do want to deploy
> under "simpleapp":
>
> 1. in swagger-ui/index.html, add in "/simpleapp" to the paths for the
> input_baseUrl selector:
>
> 
>  value="/simpleapp/restful/swagger/private"/>
>  value="/simpleapp/restful/swagger/public"/>
>  value="/simpleapp/restful/swagger/prototyping"/>
> 
>
> 2. in web.xml, allow access through to that path:
>
>
> IsisSessionFilterForRestfulObjects
> ...
> 
> passThru
> /simpleapp/restful/swagger
> 
>
>
> Less than ideal, but it is *only* a developer tool, so perhaps sufficient?
> Maybe just an update to the docs will suffice?
>
>
> Cheers
> Dan
>
>
>
>
>
>
>
>
>
> On 16 May 2016 at 10:17, Dan Haywood <d...@haywood-associates.co.uk> wrote:
>
> > Ok, thanks for reporting, I'll take a look hopefully this evening.
> >
> > Dan.
> > On 16 May 2016 10:02 am, "Vladimir Nišević" <vnise...@gmail.com> wrote:
> >
> > Based on discussion in https://issues.apache.org/jira/browse/ISIS-1358 I
> > think I've found an issue, but I cannot create new JIRA issue any more -
> > seems the issue creation policy has been changed, so I am sending the
> issue
> > on this way.
> >
> > *Steps to reproduce:*
> >
> > 1. Create archetype as described in guide
> > *mvn archetype:generate \*
> > *-D archetypeGroupId=org.apache.isis.archetype \*
> > *-D archetypeArtifactId=simpleapp-archetype \*
> > *-D archetypeVersion=1.12.1 \*
> > *-D groupId=com.mycompany \*
> > *-D artifactId=myapp \*
> > *-D version=1.0-SNAPSHOT \*
> > *-B*
> >
> > 2. execute "*mvn clean package"*
> >
> > 3. deploy simpleapp.war to external tomcat, eg. thru tomcat manager
> webapp
> > and call swagger WebUI*
> > http://localhost:8080/simpleapp/swagger-ui/index.html
> > <http://localhost:8080/simpleapp/swagger-ui/index.html> *
> >
> > *Error*: Can't read swagger JSON from
> > http://localhost:8080/restful/swagger/public
> >
> > It seems that the service
> > org.apache.isis.core.metamodel.services.swagger.SwaggerServiceDefault is
> > not recognized.
> >
> > [image: Inline-Bild 2]
> >
> >
>


Simpleapp 12.0.1. - Swagger not working when packaging war and deploying to Tomcat

2016-05-16 Thread Vladimir Nišević
Based on discussion in https://issues.apache.org/jira/browse/ISIS-1358 I
think I've found an issue, but I cannot create new JIRA issue any more -
seems the issue creation policy has been changed, so I am sending the issue
on this way.

*Steps to reproduce:*

1. Create archetype as described in guide
*mvn archetype:generate \*
*-D archetypeGroupId=org.apache.isis.archetype \*
*-D archetypeArtifactId=simpleapp-archetype \*
*-D archetypeVersion=1.12.1 \*
*-D groupId=com.mycompany \*
*-D artifactId=myapp \*
*-D version=1.0-SNAPSHOT \*
*-B*

2. execute "*mvn clean package"*

3. deploy simpleapp.war to external tomcat, eg. thru tomcat manager webapp
and call swagger WebUI*
http://localhost:8080/simpleapp/swagger-ui/index.html
 *

*Error*: Can't read swagger JSON from
http://localhost:8080/restful/swagger/public

It seems that the service
org.apache.isis.core.metamodel.services.swagger.SwaggerServiceDefault is
not recognized.

[image: Inline-Bild 2]


Re: Upgrade to 12.0.1 - Apache Isis Maven plugin "validate goal" needs dom or app module? Validation when Isis Addon is used?

2016-04-27 Thread Vladimir Nišević
Yes, that helped! Thanks Dan!

Vladimir

2016-04-26 21:19 GMT+02:00 Dan Haywood <d...@haywood-associates.co.uk>:

> Hi Vladimir,
>
> There was a change for the swagger goal, it now needs to run the integtests
> module, but the validate goal should still run ok in the dom module.
>
> If you look at the simpleapp you'll see that it uses
> 'domainapp.dom.DomainAppDomManifest' as its manifest, and is in the dom
> module, not the app module.  This is DIFFERENT from the regular
> 'domainapp.app.DomainAppAppManifest' (in the app module) normally used for
> bootstrapping.
>
> Basically all we are doing is specifying how much of the metamodel should
> be loaded up for validation.  Since there's no point validating 3rd party
> modules, it should only specify your domain classes in the 'dom' module.
>
> Hope that helps.
>
> Dan
>
>
>
> On 26 April 2016 at 12:44, Vladimir Nišević <vnise...@gmail.com> wrote:
>
> > Hi, after upgrading to 12.0.1 and  when "mvn clean install"  i get
> > exception
> >
> > *[ERROR] Failed to execute goal
> > org.apache.isis.tool:isis-maven-plugin:1.12.1:validate (default) on
> project
> > my-dom: Execution default of goal
> > org.apache.isis.tool:isis-maven-plugin:1.12.1:validate failed: The class
> > 'my.app.MyAppManifest' cannot be found -> [Help 1]*
> >
> >
> > I use same skeleton as simpleapp:
> >
> > * my.app.MyAppManifest is part of app module "my-app"
> > * validate profile is defined in pom.xml of dom module "my-dom"
> >
> >
> > Looking the documentation  "validate goal"
> > https://isis.apache.org/guides/rgmvn.html#3.-validate-goal and comparing
> > it
> > with the generated simpleapp 12.0.1 it's not clear where the validate
> > profile should be? In the dom or in the app module?
> >
> >
> > When I move the validate profile to pom.xml of app module and restart
> "mvn
> > clean install" on parent, validation seems to run but I get another
> error.
> >
> >
> > *[ERROR] Failed to execute goal
> > org.apache.isis.tool:isis-maven-plugin:1.12.1:validate (default) on
> project
> > my-app: Execution default of goal
> > org.apache.isis.tool:isis-maven-plugin:1.12.1:validate failed:
> > org.apache.isis.core.metamodel.exceptions.MetaModelException:
> > java.lang.reflect.InvocationTargetException:
> > org.datanucleus.store.rdbms.exceptions.MissingTableException: Required
> > table missing : "ISISSETTINGS.APPLICATIONSETTING" in Catalog "" Schema
> > "ISISSETTINGS". DataNucleus requires this table to perform its
> persistence
> > operations. Either your MetaData is incorrect, or you need to enable
> > "datanucleus.schema.autoCreateTables" -> [Help 1]*
> >
> > I do use Isis Adon Setting and configure it in AppManifest in
> > getModules()-method.
> >
>


Upgrade to 12.0.1 - Apache Isis Maven plugin "validate goal" needs dom or app module? Validation when Isis Addon is used?

2016-04-26 Thread Vladimir Nišević
Hi, after upgrading to 12.0.1 and  when "mvn clean install"  i get exception

*[ERROR] Failed to execute goal
org.apache.isis.tool:isis-maven-plugin:1.12.1:validate (default) on project
my-dom: Execution default of goal
org.apache.isis.tool:isis-maven-plugin:1.12.1:validate failed: The class
'my.app.MyAppManifest' cannot be found -> [Help 1]*


I use same skeleton as simpleapp:

* my.app.MyAppManifest is part of app module "my-app"
* validate profile is defined in pom.xml of dom module "my-dom"


Looking the documentation  "validate goal"
https://isis.apache.org/guides/rgmvn.html#3.-validate-goal and comparing it
with the generated simpleapp 12.0.1 it's not clear where the validate
profile should be? In the dom or in the app module?


When I move the validate profile to pom.xml of app module and restart  "mvn
clean install" on parent, validation seems to run but I get another error.


*[ERROR] Failed to execute goal
org.apache.isis.tool:isis-maven-plugin:1.12.1:validate (default) on project
my-app: Execution default of goal
org.apache.isis.tool:isis-maven-plugin:1.12.1:validate failed:
org.apache.isis.core.metamodel.exceptions.MetaModelException:
java.lang.reflect.InvocationTargetException:
org.datanucleus.store.rdbms.exceptions.MissingTableException: Required
table missing : "ISISSETTINGS.APPLICATIONSETTING" in Catalog "" Schema
"ISISSETTINGS". DataNucleus requires this table to perform its persistence
operations. Either your MetaData is incorrect, or you need to enable
"datanucleus.schema.autoCreateTables" -> [Help 1]*

I do use Isis Adon Setting and configure it in AppManifest in
getModules()-method.


Re: collection of similar types

2015-11-26 Thread Vladimir Nišević
Hi Dan, thank you for your support!

Comments inline. 

Vladimir


> Am 26.11.2015 um 16:11 schrieb Dan Haywood <d...@haywood-associates.co.uk>:
> 
> Hi Vladimir,
> 
> thanks for pulling together that test case (though perhaps next time, just
> create a repo with just the simpleapp, rather than all of Isis?!?)
> 
Ok, will do so in the future!


> Anyway... the issue is a programming error, but easily made.
> 
> In some of your actions you are accessing fields directly, instead you
> should ALWAYS use the getters.  This allows DataNucleus to perform its lazy
> loading of state.
> 
Oh yes, I understand now! Isis solves so many things by magic, I wasn't aware 
any more of that fact.

> For example, in Step.java:
> 
>@Programmatic
>public boolean isFinishedOrInError() {
> //return status.isFinished() || status.isInError();
>return getStatus().isFinished() || getStatus().isInError();
>}
> 
>@Programmatic
>public boolean isProcessing() {
> //return this.status.isProcessing();
>return this.getStatus().isProcessing();
>}
> 
>@Programmatic
>public boolean isPlanned() {
> //return this.status.isPlanned();
>return this.getStatus().isPlanned();
>}
> 
> in StepSubtype1.java:
> 
>@Override protected List checkForErrorsBeforeExecute() {
>List errors = new ArrayList<>();
> //if (this.technology == null)
>if (getTechnology() == null)
>errors.add("No technology defined");
> //if (this.dslamLocation == null)
>if (getDslamLocation() == null)
>errors.add("No DSLAM location defined");
>return errors;
>}
> 
> in StepSubtype2.java:
> 
>@Override
>protected List checkForErrorsBeforeExecute() {
>List errors = new ArrayList<>();
> //if (this.dslam == null)
>if (getDslam() == null)
>errors.add("No dslam defined");
> //if (this.port == null)
>if (getPort() == null)
>errors.add("No port defined");
>return errors;
>}
> 
> 
> 
> I suspect you've "got away with this" previously if you weren't using
> inheritance with each subtype in its own table.  But for this example, they
> do, eg:
> 
> @javax.jdo.annotations.Inheritance(strategy =
> InheritanceStrategy.NEW_TABLE)    /// this...
> public class StepSubtype1 extends Step {
> 
> 
> Either way, always use getters.  Moving actions into mixins (my new
> favorite feature of Isis) might be a way to help enforce this.
> 
> Cheers
> Dan
> 
> 
> 
>> On 24 November 2015 at 15:11, Vladimir Nišević <vnise...@gmail.com> wrote:
>> 
>> Hi Dan, yes, that's exactly the problem.
>> 
>> I have adapted the simple-app trying to show my problem:
>> https://github.com/niv0/isis
>> 
>> Meanwhile I understood that my integration test was wrong - I haven't used
>> the wrapper. Now is my problem at least consistent through WebUI and
>> Integration test, but I still have it.
>> 
>> To reproduce:
>> 
>>   1. Start SampleAPP Webapp
>>   2. Create new simple object
>>   3. Execute action "Plan" on simple object (will add three steps of
>>   specific subtype). Two steps will have a specifc properties.
>>   4. Exectute action "Execute" on simple object - status of first step
>>   change to processing, but since properties are not loaded, business
>> logic
>>   prevent it from doing (my problem)
>> 
>> 
>> 
>> 
>> Regs,Vladimir
>> 
>> 
>> 2015-11-23 16:30 GMT+01:00 Dan Haywood <d...@haywood-associates.co.uk>:
>> 
>>> If I understand you correctly, sounds as if the query that you are using
>> is
>>> only querying the supertype table, rather than doing left outer jobs for
>>> all subtypes.
>>> 
>>> But in guessing here... perhaps you could share some code that
>> demonstrates
>>> the issue?
>>>> On 23 Nov 2015 3:20 pm, "Vladimir Nišević" <vnise...@gmail.com> wrote:
>>>> 
>>>> Hi Dan, when I execute the action on order the steps instances are
>> there,
>>>> but the values of its properites are definitely empty - I've checked it
>>>> thru debugging of webapp. When I open a view of single step, the values
>>> of
>>>> that step are there.
>>>> 
>>>> I do not need to show additional values in a table, but have a problem
>>> with
>>>> business logic when executin

Re: collection of similar types

2015-11-23 Thread Vladimir Nišević
Hi, I have perhaps similar issue.

I have an object (Order) which contains a list of objects can be different
type but all extend from the same superclass (Step). When I execute the
action on order thru wicket UI, the properties of concrete classes
StepType1 and StepType2 are not loaded. When I do the same thru
Intergration Test, the values are there?


*class Order{*
*.*
*//region > steps (collection)*
*@Column(allowsNull = "true")*
*@Persistent(mappedBy = "order", defaultFetchGroup = "true")*
*private List steps = new ArrayList<>();*

*@Collection(editing = Editing.DISABLED)*
*@CollectionLayout(render = RenderType.EAGERLY)*
*public List getSteps() {*
*return steps;*
*}*

*public void setSteps(final List steps) {*
*this.steps = steps;*
*}*
**
*}*


*abstract class Step{*
**
*//region > order (property)*
*@Persistent(defaultFetchGroup = "true")*
*@Column(allowsNull = "false")*
*private Order order;*

*@MemberOrder(name = "General", sequence = "1.1")*
*@PropertyLayout(named = "Order", hidden = Where.PARENTED_TABLES)*
*public Order getOrder() {*
*return order;*
*}*

*public void setOrder(final Order order) {*
*this.order = order;*
*}*
*.*
*}*


*class StepType1 extends Step{*
*//region > ipAdresse (property)*
*private String ipAdresse;*

*@MemberOrder(sequence = "1")*
*@javax.jdo.annotations.Column(allowsNull = "true")*
*public String getIpAdresse() {*
*return ipAdresse;*
*}*

*public void setIpAdresse(final String ipAdresse) {*
*this.ipAdresse = ipAdresse;*
*}*
**
*} *

*class StepType2 extends Step{*
**
*private String dslam;*

*@MemberOrder(name = "Output", sequence = "1.0")*
*@PropertyLayout(named = "DSLAM")*
*@javax.jdo.annotations.Column(allowsNull = "true")*
*public String getDslam() {*
*return dslam;*
*}*

*public void setDslam(final String dslamId) {*
*this.dslam = dslamId;*
*}*
*.*
*} *




2015-11-22 15:23 GMT+01:00 Dan Haywood :

> On 21 November 2015 at 22:01, Stephen Cameron 
> wrote:
>
> > Actually, it already does have the behaviour that I wanted.
> >
> >
> OK, that's good to hear.
>
>
> >
> > I'll try individual icons for the subtypes and see if it uses them
> instead
> > of the one for the base-type.
> >
> > It should do.  In the todoapp we use the similar cssClass() to return a
> CSS class name per instance, and then use application.css to style the
> different values.  This is how individual rows within a table show some
> todo items "crossed-off", ie with a line through the centre.   The icons
> also vary on a case by case basis.
>
> Cheers
> Dan
>


Re: collection of similar types

2015-11-23 Thread Vladimir Nišević
Hi Dan, when I execute the action on order the steps instances are there,
but the values of its properites are definitely empty - I've checked it
thru debugging of webapp. When I open a view of single step, the values of
that step are there.

I do not need to show additional values in a table, but have a problem with
business logic when executing an action which uses a data on single step.

Any idea?
Thanks, Vladimir


2015-11-23 14:25 GMT+01:00 Dan Haywood <d...@haywood-associates.co.uk>:

> The objects are loaded, however the Wicket UI uses the compile time type of
> the list to determine what columns to render.
>
> I could imagine us allowing some sort of hint for the framework to be told
> to render the objects as per some other type (eg some "union interface"
> that combines all desired properties). But that would be a new feature, I
> think.
>
> Dan.
> On 23 Nov 2015 1:16 pm, "Vladimir Nišević" <vnise...@gmail.com> wrote:
>
> > Hi, I have perhaps similar issue.
> >
> > I have an object (Order) which contains a list of objects can be
> different
> > type but all extend from the same superclass (Step). When I execute the
> > action on order thru wicket UI, the properties of concrete classes
> > StepType1 and StepType2 are not loaded. When I do the same thru
> > Intergration Test, the values are there?
> >
> >
> > *class Order{*
> > *.*
> > *//region > steps (collection)*
> > *@Column(allowsNull = "true")*
> > *@Persistent(mappedBy = "order", defaultFetchGroup = "true")*
> > *private List steps = new ArrayList<>();*
> >
> > *@Collection(editing = Editing.DISABLED)*
> > *@CollectionLayout(render = RenderType.EAGERLY)*
> > *public List getSteps() {*
> > *return steps;*
> > *}*
> >
> > *public void setSteps(final List steps) {*
> > *this.steps = steps;*
> > *}*
> > **
> > *}*
> >
> >
> > *abstract class Step{*
> > **
> > *//region > order (property)*
> > *@Persistent(defaultFetchGroup = "true")*
> > *@Column(allowsNull = "false")*
> > *private Order order;*
> >
> > *@MemberOrder(name = "General", sequence = "1.1")*
> > *@PropertyLayout(named = "Order", hidden = Where.PARENTED_TABLES)*
> > *public Order getOrder() {*
> > *return order;*
> > *}*
> >
> > *public void setOrder(final Order order) {*
> > *this.order = order;*
> > *}*
> > *.*
> > *}*
> >
> >
> > *class StepType1 extends Step{*
> > *//region > ipAdresse (property)*
> > *private String ipAdresse;*
> >
> > *@MemberOrder(sequence = "1")*
> > *@javax.jdo.annotations.Column(allowsNull = "true")*
> > *public String getIpAdresse() {*
> > *return ipAdresse;*
> > *}*
> >
> > *public void setIpAdresse(final String ipAdresse) {*
> > *this.ipAdresse = ipAdresse;*
> > *}*
> > **
> > *} *
> >
> > *class StepType2 extends Step{*
> > **
> > *private String dslam;*
> >
> > *@MemberOrder(name = "Output", sequence = "1.0")*
> > *@PropertyLayout(named = "DSLAM")*
> > *@javax.jdo.annotations.Column(allowsNull = "true")*
> > *public String getDslam() {*
> > *return dslam;*
> > *}*
> >
> > *public void setDslam(final String dslamId) {*
> > *this.dslam = dslamId;*
> > *}*
> > *.*
> > *} *
> >
> >
> >
> >
> > 2015-11-22 15:23 GMT+01:00 Dan Haywood <d...@haywood-associates.co.uk>:
> >
> > > On 21 November 2015 at 22:01, Stephen Cameron <
> > steve.cameron...@gmail.com>
> > > wrote:
> > >
> > > > Actually, it already does have the behaviour that I wanted.
> > > >
> > > >
> > > OK, that's good to hear.
> > >
> > >
> > > >
> > > > I'll try individual icons for the subtypes and see if it uses them
> > > instead
> > > > of the one for the base-type.
> > > >
> > > > It should do.  In the todoapp we use the similar cssClass() to
> return a
> > > CSS class name per instance, and then use application.css to style the
> > > different values.  This is how individual rows within a table show some
> > > todo items "crossed-off", ie with a line through the centre.   The
> icons
> > > also vary on a case by case basis.
> > >
> > > Cheers
> > > Dan
> > >
> >
>


Re: New and better view models coming in 1.11.0-SNAPSHOT

2015-11-21 Thread Vladimir Nišević
Hi Dan, thank you, this is a really cool feature! The applications I'm
building, have often legacy systems and some parts of my domain models are
built on service calls to that legacy systems - in that case we build
domain models with view models to hold the data from multiple backends and
implement the core domain logic in them. Until now we have primarily used
this domain models to expose REST services to other systems, but I believe
this could be the way to implement some wicket based UI's.

Additionaly, here some ideas I'd like to share, maybe to see some of them
in the future in the Apache Isis framework:

1. Search capability based on e.g. Elasticsearch [1], where the
Elasticsearch could act as a kind of "external index" for the parts of
domain model. Developer could mark which fields should be searchable, this
fields would be updated in elasticsearch instance after database
insert/update/delete. User can search thru Elasticsearch and retreive the
entity OID's as results and in the second step use them to retreive the
entities from main repository (thru datanucleus container). I could
contribute to this feature since we have integrated Elasticsearch with
Apache Isis.

2. An add-on to support system-wide and/or user-specific notifications
(similar to Atlassian Confluence [2}). An Isis user could receive such
"notifications" - they would appear on his desktop, he could mark them
 "readed". Some notifications could be system-wide and controlled by e.g.
system without a possibility to remove them until e.g. administrator
decides that. We use such features  to e.g. notify application users there
is a newer version of the application and they should finish their work and
log off /logon in order to switch to that new version.

3. In a world of collaboration systems there could be an interest extension
to your incode-module-note feature, the capability not only to add the
notes to an entity, but also to add infinite comments to that note (in
other words to add the comment threads to the entity). In combination with
text search capability (idea #1) I thinks we could build really great
features.


Vladimir


[1] https://www.elastic.co
[2]
https://confluence.atlassian.com/display/CONF43/Managing+Notifications+in+Confluence

[3] https://github.com/incodehq

2015-11-20 11:30 GMT+01:00 Dan Haywood :

> Hi folks,
>
> just a heads-up that in the next version we have support for JAXB-annotated
> view models, meaning that a view model's memento is basically derived from
> the XML serialization of its state.  We also have (bar one tiny JAXB
> annotation) more or less transparent references to underlying domain
> objects, and we also can support collections of objects in the graph.
>
> Other new stuff: there's a JaxbService, and a UrlEncodingService.  There's
> also a Dto role interface so that XML and XSDs can be downloaded from view
> models using some new mixins.  There's also - in the user guide - a new
> section describing all the different types of view models.
>
> Also in 1.11.0 we will also have three new "UI" events; rather than write
> title() or iconName() in your domain object, you can instead provide this
> metadata via a subscriber.  And I added some "postForDefault" config
> properties so that UI or domain events can be suppressed rather than always
> posted as is currently.
>
> Finally, I also got around to documenting the common and aim schemas.
> These were introduced in 1.9.0, but never had any formal documentation
> before now.
>
> Useful links below
>
> Cheers
> Dan
>
>
> http://isis.apache.org/guides/ug.html#_ug_more-advanced_view-models
>
> http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-XmlRootElement
> http://isis.apache.org/guides/rg.html#_rg_services-api_manpage-JaxbService
>
> http://isis.apache.org/guides/rg.html#_rg_services-spi_manpage-UrlEncodingService
> http://isis.apache.org/guides/rg.html#_rg_classes_mixins_Dto
> http://isis.apache.org/guides/rg.html#_rg_classes_uievent
> http://isis.apache.org/guides/rg.html#_rg_runtime_configuring-core
>
> http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-Action_domainEvent
> http://isis.apache.org/guides/rg.html#_rg_schema
>


Re: [ANN] Apache Isis version 1.10.0 Released

2015-11-10 Thread Vladimir Nišević
Hi Dan and Isis team, great work, thank you!

Vladimir


> Am 10.11.2015 um 09:22 schrieb Dan Haywood :
> 
> The Apache Isis team is pleased to announce the release of Apache Isis
> v1.10.0.
> 
> New features in this release include:
> * ISIS-1213 - Support for @Mixin domain objects, as a specialized type of
> contributor
> * ISIS-1210 - SPI service for handling exception stack traces
> * ISIS-1205 - Support @Inject on List or Collection
> * ISIS-1007 - Provide support for "are you sure" idiom using extended
> actionsemantics
> * ISIS-1005 - Lifecycle events emitted, enabling eg services to pre-commit
> processing
> * ISIS-867 - Domain service to automatically maintain lastUpdatedAt and
> lastUpdatedBy
> 
> Full release notes are available on the Apache Isis website at [1].  Please
> also read the migration notes [2]
> 
> You can access this release directly from the Maven central repo [3],
> or download the release and build it from source [4].
> 
> Enjoy!
> 
> --The Apache Isis team
> 
> [1] http://isis.apache.org/release-notes.html#r1.10.0
> [2]
> http://isis.apache.org/migration-notes.html#_migration-notes_1.9.0-to-1.10.0
> [3] http://search.maven.org
> [4] http://isis.apache.org/downloads.html


Re: CLOB property, editing the value thru wicket viewer text field instead of download/upload file

2015-10-07 Thread Vladimir Nišević
Hi Jeroen, I've used that already, but I have failed thru 2000 chars
restriction.

Regs,Vladimir

2015-10-07 9:46 GMT+02:00 Jeroen van der Wal <jer...@stromboli.it>:

> For long text fields I use this pattern:
>
> private String myLongTextField;
>
> @javax.jdo.annotations.Column(allowsNull="true", jdbcType="CLOB",
> sqlType="LONGVARCHAR")
> public String getMyLongTextField() {
> return myLongTextField;
> }
>
> public void setMyLongTextField(final String myLongTextField) {
> this.myLongTextField = myLongTextField;
> }
>
> HTH
>
> Jeroen
>
> On 6 October 2015 at 16:49, Vladimir Nišević <vnise...@gmail.com> wrote:
>
> > Hi Dan, that is also absolutely fine for me!
> >
> > Many thanks!
> > Vladimir
> >
> >
> > > Am 06.10.2015 um 16:39 schrieb Dan Haywood <
> d...@haywood-associates.co.uk
> > >:
> > >
> > > Hmm, sounds like a new requirement.  The idea of CLOB really is to
> > > represent documents, not for direct editing.
> > >
> > > As a workaround, could you define a derived non-persisted property and
> > have
> > > it update the clob, eg:
> > >
> > > @PropertyLayout(multiLine=20)
> > > @javax.jdo.annotations.NotPersistent
> > > public String getText() {
> > >return getClob().getChars().toString();
> > > }
> > > public void setText(String text) {
> > >setClob(new Clob(..., ..., text);  // whatever
> > > }
> > >
> > > private Clob clob;
> > > @javax.jdo.annotations.Persistent
> > > public Clob getClob() { ... }
> > > public void setClob(Clob clob) { ... }
> > >
> > >
> > > if using actions, then similarly:
> > >
> > > public void updateText(@ParameterLayout(multiLine=20) String text) {
> > >setClob(...);
> > > }
> > > public String default0UpdateText() { return
> > > getClob().getChars().toString(); }
> > >
> > >
> > > HTH
> > > Dan
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >> On 6 October 2015 at 15:32, Vladimir Nišević <vnise...@gmail.com>
> > wrote:
> > >>
> > >> Hi, would it be possible to edit a property defined as CLOB in
> database
> > and
> > >> as Clob custom value type direclty in a wicket multiline text field?
> > >>
> > >> I have sometimes strings longer than 2000 chars and must store them as
> > >> CLOB, on the other side I loose the feature to edit them in Wicket
> > viewer.
> > >>
> > >> Regards
> > >> Vladimir
> > >>
> >
>


Re: CLOB property, editing the value thru wicket viewer text field instead of download/upload file

2015-10-07 Thread Vladimir Nišević
Hi Jeroen, sorry, I was to fast with my comment, your proposal works also!

Many thanks!

Regs,Vladimir


2015-10-07 12:52 GMT+02:00 Vladimir Nišević <vnise...@gmail.com>:

> Hi Jeroen, I've used that already, but I have failed thru 2000 chars
> restriction.
>
> Regs,Vladimir
>
>
> 2015-10-07 9:46 GMT+02:00 Jeroen van der Wal <jer...@stromboli.it>:
>
>> For long text fields I use this pattern:
>>
>> private String myLongTextField;
>>
>> @javax.jdo.annotations.Column(allowsNull="true", jdbcType="CLOB",
>> sqlType="LONGVARCHAR")
>> public String getMyLongTextField() {
>> return myLongTextField;
>> }
>>
>> public void setMyLongTextField(final String myLongTextField) {
>> this.myLongTextField = myLongTextField;
>> }
>>
>> HTH
>>
>> Jeroen
>>
>> On 6 October 2015 at 16:49, Vladimir Nišević <vnise...@gmail.com> wrote:
>>
>> > Hi Dan, that is also absolutely fine for me!
>> >
>> > Many thanks!
>> > Vladimir
>> >
>> >
>> > > Am 06.10.2015 um 16:39 schrieb Dan Haywood <
>> d...@haywood-associates.co.uk
>> > >:
>> > >
>> > > Hmm, sounds like a new requirement.  The idea of CLOB really is to
>> > > represent documents, not for direct editing.
>> > >
>> > > As a workaround, could you define a derived non-persisted property and
>> > have
>> > > it update the clob, eg:
>> > >
>> > > @PropertyLayout(multiLine=20)
>> > > @javax.jdo.annotations.NotPersistent
>> > > public String getText() {
>> > >return getClob().getChars().toString();
>> > > }
>> > > public void setText(String text) {
>> > >setClob(new Clob(..., ..., text);  // whatever
>> > > }
>> > >
>> > > private Clob clob;
>> > > @javax.jdo.annotations.Persistent
>> > > public Clob getClob() { ... }
>> > > public void setClob(Clob clob) { ... }
>> > >
>> > >
>> > > if using actions, then similarly:
>> > >
>> > > public void updateText(@ParameterLayout(multiLine=20) String text) {
>> > >setClob(...);
>> > > }
>> > > public String default0UpdateText() { return
>> > > getClob().getChars().toString(); }
>> > >
>> > >
>> > > HTH
>> > > Dan
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >> On 6 October 2015 at 15:32, Vladimir Nišević <vnise...@gmail.com>
>> > wrote:
>> > >>
>> > >> Hi, would it be possible to edit a property defined as CLOB in
>> database
>> > and
>> > >> as Clob custom value type direclty in a wicket multiline text field?
>> > >>
>> > >> I have sometimes strings longer than 2000 chars and must store them
>> as
>> > >> CLOB, on the other side I loose the feature to edit them in Wicket
>> > viewer.
>> > >>
>> > >> Regards
>> > >> Vladimir
>> > >>
>> >
>>
>
>


Re: CLOB property, editing the value thru wicket viewer text field instead of download/upload file

2015-10-06 Thread Vladimir Nišević
Hi Dan, that is also absolutely fine for me!

Many thanks!
Vladimir


> Am 06.10.2015 um 16:39 schrieb Dan Haywood <d...@haywood-associates.co.uk>:
> 
> Hmm, sounds like a new requirement.  The idea of CLOB really is to
> represent documents, not for direct editing.
> 
> As a workaround, could you define a derived non-persisted property and have
> it update the clob, eg:
> 
> @PropertyLayout(multiLine=20)
> @javax.jdo.annotations.NotPersistent
> public String getText() {
>return getClob().getChars().toString();
> }
> public void setText(String text) {
>setClob(new Clob(..., ..., text);  // whatever
> }
> 
> private Clob clob;
> @javax.jdo.annotations.Persistent
> public Clob getClob() { ... }
> public void setClob(Clob clob) { ... }
> 
> 
> if using actions, then similarly:
> 
> public void updateText(@ParameterLayout(multiLine=20) String text) {
>setClob(...);
> }
> public String default0UpdateText() { return
> getClob().getChars().toString(); }
> 
> 
> HTH
> Dan
> 
> 
> 
> 
> 
> 
> 
>> On 6 October 2015 at 15:32, Vladimir Nišević <vnise...@gmail.com> wrote:
>> 
>> Hi, would it be possible to edit a property defined as CLOB in database and
>> as Clob custom value type direclty in a wicket multiline text field?
>> 
>> I have sometimes strings longer than 2000 chars and must store them as
>> CLOB, on the other side I loose the feature to edit them in Wicket viewer.
>> 
>> Regards
>> Vladimir
>> 


Re: RAD RACE 2015

2015-10-05 Thread Vladimir Nišević
So much truth in your words David!

Would really appreciate if someone can find Richards blog.


@Dan: many thanks for sharing your RAD Race experience.

Vladimir


> Am 06.10.2015 um 05:26 schrieb David Tildesley :
> 
> Hi Stephen,
>> On Tuesday, 6 October 2015 12:20 AM, Stephen Cameron 
>>  wrote:
>> In fact as configurable systems get more and more complex, the need 
>> for>programming disappears, to be replaced by 'configurators' (business
>> analysts?) tweeking workflow and rules engines.
> I have seen such an approach almost ruin a business and I have yet to witness 
> a successful example. It's akin to the early SOA hype concepts (you know, the 
> forms based "UI" calling enterprise services that invoke workflow in workflow 
> engines that invoke rules in rules engines and the so called "composite 
> application"). Some very expensive lessons indeed. SOA has found it's 
> rightful place in the enterprise albeit vastly scaled back in ambition. 
> Richard Pawson wrote a blog on "workflow-a-triumph-of-hope-over-experience" 
> but unfortunately the web has lost it like it loses so many gems. Maybe 
> Richard will re-post it somewhere if he is reading this.
> Long live DDD :)
> Cheers,David.
> 


Re: [ANN] Apache Isis version 1.9.0 Released

2015-09-04 Thread Vladimir Nišević
Thanks guys, we will also merge our coming project with 1.9.0

Regs,Vladimir

2015-09-01 23:45 GMT+02:00 Dan Haywood :

> The Apache Isis team is pleased to announce the release of Apache Isis
> v1.9.0.
>
> New release includes 18 new features, 50 improvements and 25 bug fixes.
> The new features include:
> - upgrading dependency on DataNucleus to 4.1.x
> - a new mechanism ("AppManifest") for bootstrapping Isis
> - a bunch of useful new domain services, including support for content
> negotiation service within the Restful Objects viewer
>
> Full release notes are available on the Apache Isis website at [1].
>
> This release cycle has also included the reworkings of the Apache Isis
> website, now built using Asciidoctor and hosted as a git repository.  There
> are also several new modules at the (non-ASF) Isis addons site [2], to
> support polymorphic relationships, publishing via ActiveMQ, feature
> toggles, and fakedata for testing.
>
> You can access this release directly from the Maven central repo [3],
> or download the release and build it from source [4].
>
> Enjoy!
>
> --The Apache Isis team
>
> [1] http://isis.apache.org/release-notes.html#r1.9.0
> [2] http://isisaddons.org
> [3] http://search.maven.org
> [4] http://isis.apache.org/downloads.html
>


Re: Neo4j and Apache Isis

2015-07-14 Thread Vladimir Nišević
Hi Dan, I've just tried out this example but have problems when opening the
neo4j server http://localhost:7474/

I've started the app thru webapp  - Run maven - jetty:run and Isis starts
fine.

Run Fixture scripts works as well, I see sample Hosts entites created..

Do I have to start the neo4j server separately?

Regs,Vladimir

2015-07-07 10:09 GMT+02:00 Dan Haywood d...@haywood-associates.co.uk:

 Hi folks,

 in case you're interested in such things, we now have a functioning example
 of Apache Isis running against neo4j (using 1.9.0-SNAPSHOT).

 Take a look at the screenshots, if nothing else [1]

 Cheers
 Dan


 [1] https://github.com/isisaddons/isis-app-neoapp/



Re: Calling any IntelliJ users

2015-07-13 Thread Vladimir Nišević
Hi Martin, haven't seen your hint before sending the mail, Thanks anyway.

Regs,Vladimir

2015-07-13 14:15 GMT+02:00 Vladimir Nišević vnise...@gmail.com:

 Ok, I think you've ment this one:
 https://isis.apache.org/guides/cg.html#_maven_helper_plugin

 Regs,Vladimir


 2015-07-13 14:02 GMT+02:00 Vladimir Nišević vnise...@gmail.com:

 Hi Dan, clickling the link [1] brings up a 404 Not Found

 Regs,Vladimir

 2015-07-08 9:56 GMT+02:00 Dan Haywood d...@haywood-associates.co.uk:

 Hi folks,

 for those of you using IntelliJ, I just updated our website to reference
 the new and improved maven helper plugin that you can install [1].
 This
 now has a nice dependency tree view, as well as some other useful
 features.

 The dependency tree view was the one feature that I missed from Eclipse,
 so
 it's nice to finally have something comparable.

 Cheers
 Dan

 [1] http://isis.apache.org/guides/dg.html#_maven_helper_plugin






Re: Calling any IntelliJ users

2015-07-13 Thread Vladimir Nišević
Hi Dan, clickling the link [1] brings up a 404 Not Found

Regs,Vladimir

2015-07-08 9:56 GMT+02:00 Dan Haywood d...@haywood-associates.co.uk:

 Hi folks,

 for those of you using IntelliJ, I just updated our website to reference
 the new and improved maven helper plugin that you can install [1].This
 now has a nice dependency tree view, as well as some other useful features.

 The dependency tree view was the one feature that I missed from Eclipse, so
 it's nice to finally have something comparable.

 Cheers
 Dan

 [1] http://isis.apache.org/guides/dg.html#_maven_helper_plugin



Re: Calling any IntelliJ users

2015-07-13 Thread Vladimir Nišević
Hi Dan, I've just went thru your guide and want to give you my feedback.

After the described steps how to setup the idea in the step maven helper
plugin https://isis.apache.org/guides/cg.html#_maven_helper_plugin you
assume from chapter 2.1.2 that the Isis source code is already checked out
locally.

Maybe you should spend some words here about how to get the current Isis
source code:

- install a git client (sourcetree
https://www.atlassian.com/software/sourcetree/overview ) or howto configure
a git in Idea
- checkout the Isis source code (refer to your documentation later
https://isis.apache.org/guides/cg.html#7.1.-recommended-workflow-(github)



Regs,Vladimir

2015-07-08 9:56 GMT+02:00 Dan Haywood d...@haywood-associates.co.uk:

 Hi folks,

 for those of you using IntelliJ, I just updated our website to reference
 the new and improved maven helper plugin that you can install [1].This
 now has a nice dependency tree view, as well as some other useful features.

 The dependency tree view was the one feature that I missed from Eclipse, so
 it's nice to finally have something comparable.

 Cheers
 Dan

 [1] http://isis.apache.org/guides/dg.html#_maven_helper_plugin



Re: Accessing to two (or more) relational databases at the same time

2015-06-08 Thread Vladimir Nišević
Hi, comments are inlined

br,Vladimir


 Am 08.06.2015 um 08:22 schrieb Dan Haywood d...@haywood-associates.co.uk:
 
 Sounds ok... though what approach are you taking for transaction management?
 
I manage transactions to other databases manually, in case of any exception, I 
use process entity stored in Isis RDB to report exceptions

 Normally Isis does the xactn mgmt for free.  I guess you are doing that
 stuff yourself?  And (since we don't provide any hooks) presumably there is
 no 2PC/XA stuff, so there are possibilities of data being committed to one
 database but not the other?

Exactely! I can live with that, although it would be good to have automatic 
transaction begin/commit for other DB's like Isis does it.
 Dan
 
 On 5 June 2015 at 20:36, Vladimir Nišević vnise...@gmail.com wrote:
 
 Hi Dan, yes, I have created two domain services representing/managing
 connections to those two databases. On PostConstrunct of each of them I
 create two Datanucleus PersistenceManagerFactories and the domain service
 methods use appropriate Dao's creating the PersistenceManager and managing
 the transactions manually as needed.
 I can gladly share my code if you wish to review it or give me some
 feedback.
 
 BR,Vladimir
 
 
 Am 05.06.2015 um 18:24 schrieb Dan Haywood d...@haywood-associates.co.uk
 :
 
 Hi Vladimir,
 
 sorry no-one ever got back to you on this... did you come up with a
 solution?
 
 otherwise, I have some thoughts...
 
 Cheers
 Dan
 
 
 On 21 May 2015 at 05:51, Vladimir Nišević vnise...@gmail.com wrote:
 
 Hi guys, we have a situation where we need to access to two(or more)
 oracle
 and one ms-sql database and read/write data from/to this databases at
 the
 same time.
 
 I see that datanucleus supports (to some degree) JDO data federation
 http://www.datanucleus.org/products/datanucleus/jdo/data_federation.html
 so
 this could be the way.
 
 My question is, how to integrate this feature into Isis config files and
 how to use it. It would be enough if  I still use container
 (DomainObjectContainer) for single database, but I need to read/write
 data
 somehow to another databases as well - so this another DB's are kind of
 backend systems...
 
 Thanks
 Vladimir Nisevic
 


Re: Accessing to two (or more) relational databases at the same time

2015-06-05 Thread Vladimir Nišević
Hi Dan, yes, I have created two domain services representing/managing 
connections to those two databases. On PostConstrunct of each of them I create 
two Datanucleus PersistenceManagerFactories and the domain service methods use 
appropriate Dao's creating the PersistenceManager and managing the transactions 
manually as needed.
I can gladly share my code if you wish to review it or give me some feedback.

BR,Vladimir


 Am 05.06.2015 um 18:24 schrieb Dan Haywood d...@haywood-associates.co.uk:
 
 Hi Vladimir,
 
 sorry no-one ever got back to you on this... did you come up with a
 solution?
 
 otherwise, I have some thoughts...
 
 Cheers
 Dan
 
 
 On 21 May 2015 at 05:51, Vladimir Nišević vnise...@gmail.com wrote:
 
 Hi guys, we have a situation where we need to access to two(or more) oracle
 and one ms-sql database and read/write data from/to this databases at the
 same time.
 
 I see that datanucleus supports (to some degree) JDO data federation
 http://www.datanucleus.org/products/datanucleus/jdo/data_federation.html
 so
 this could be the way.
 
 My question is, how to integrate this feature into Isis config files and
 how to use it. It would be enough if  I still use container
 (DomainObjectContainer) for single database, but I need to read/write data
 somehow to another databases as well - so this another DB's are kind of
 backend systems...
 
 Thanks
 Vladimir Nisevic
 


Re: Validate method not working

2015-05-30 Thread Vladimir Nišević
Hi Gabriel, just tried your code with DomainService Categories

package dom.simple;

import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.annotation.DomainService;

@DomainService
public class Categories {

public Category newCategory(
String name,
Double price) {
Category aCategory = container.newTransientInstance(Category.class);
aCategory.setName(name);
aCategory.setPrice(price);
container.persist(aCategory);
container.flush();
return aCategory;
}

@javax.inject.Inject
private DomainObjectContainer container;

}


You can create negative price, since there is no validation in newCategory,
but when you open the object view, edit object and try to type negative
value, validation will work.

BR,Vladimir


2015-05-30 18:36 GMT+02:00 Gabriel Malimpensa ggmalimpe...@gmail.com:

 Vladimir,

 Price is a property of a domain object.
 The whole code:

 package dom.simple;

 import javax.jdo.annotations.Column;
 import javax.jdo.annotations.IdGeneratorStrategy;
 import javax.jdo.annotations.IdentityType;
 import javax.jdo.annotations.PersistenceCapable;
 import javax.jdo.annotations.Persistent;
 import javax.jdo.annotations.PrimaryKey;
 import javax.jdo.identity.LongIdentity;

 import org.apache.isis.applib.annotation.Bounded;
 import org.apache.isis.applib.annotation.MemberOrder;
 import org.apache.isis.applib.annotation.Title;
 import org.apache.isis.applib.util.ObjectContracts;

 @PersistenceCapable(identityType=IdentityType.APPLICATION,
 objectIdClass=LongIdentity.class)
 @Bounded
 public class Category implements ComparableCategory {

 private Long id;
 private String name;
 private Double price;

 @PrimaryKey
 @Persistent(valueStrategy=IdGeneratorStrategy.NATIVE)
 @Column(allowsNull=false)
 @MemberOrder(sequence=1)
 public Long getId() {
 return this.id;
 }

 public void setId(Long id) {
 this.id = id;
 }

 @Column(allowsNull=false)
 @MemberOrder(sequence=2)
 @Title(sequence=1)
 public String getName() {
 return this.name;
 }

 public void setName(String name) {
 this.name = name;
 }

 @Column(allowsNull=false)
 @MemberOrder(sequence=3)
 public Double getPrice() {
 return this.price;
 }

 public void setPrice(Double price) {
 this.price = price;
 }

 public String validatePrice(Double price) {
 if (price = 0) {
 return null;
 } else {
 return The price must not be negative!;
 }
 }

 @Override
 public int compareTo(Category category) {
 return ObjectContracts.compare(this, category, id);
 }

 @Override
 public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + ((id == null) ? 0 : id.hashCode());
 return result;
 }

 @Override
 public boolean equals(Object obj) {
 if (this == obj)
 return true;
 if (obj == null)
 return false;
 if (getClass() != obj.getClass())
 return false;
 Category other = (Category) obj;
 if (id == null) {
 if (other.id != null)
 return false;
 } else if (!id.equals(other.id))
 return false;
 return true;
 }

 @Override
 public String toString() {
 return ObjectContracts.toString(this, id,name,price);
 }
 }

 Thank you.
 Gabriel Malimpensa.


 2015-05-30 11:41 GMT-03:00 Vladimir Nišević vnise...@gmail.com:

  Hi ,Gabriel, is the price a property of domain object or action? Show us
 a
  whole class.
 
  Check
 
 http://isis.apache.org/how-tos/how-to-02-100-How-to-validate-user-input-for-a-property.html
  or
 
 http://isis.apache.org/how-tos/how-to-02-120-How-to-validate-an-action-parameter-argument.html
 
  lG,Vladimir
 
 
   Am 30.05.2015 um 16:00 schrieb Gabriel Malimpensa 
  ggmalimpe...@gmail.com:
  
   Sorry for insist in this question, but I have tried many things and I
  can't
   resolve. I have used the validate method for attributes in other
 systems
  I
   have made, but this one I really don't know what is happening. Maybe
   (propably) it's something stupid... =D
  
   Thank you for support.
  
   Gabriel Malimpensa.
   São Carlos, São Paulo, Brazil.
  
   2015-05-27 21:43 GMT-03:00 Gabriel Malimpensa ggmalimpe...@gmail.com
 :
  
   Hi.
  
   I've created a validate method for an attribute but when I insert the
   entity that contains such attribute, the validate is not called by the
   interface. I don't know what is wrong. Someone can help?
  
   Code:
  public String validatePrice(Double price) {
  if (price = 0) {
  return null;
  } else {
  return The price must not be negative!;
  }
  }
  
   Thanks.
  
   Gabriel Malimpensa.
   São Carlos, São

Fwd: Entity action with Clob parameter thru restful service

2015-03-12 Thread Vladimir Nišević
Hi there, here my question I've posted in isis dev mailing list. Probably it is 
isis-users question.
Maybe someone can help me with a hint.

BR,Vladimir


Anfang der weitergeleiteten E‑Mail:

 Von: Vladimir Nišević  vnise...@gmail.com
 Datum: 06. März 2015 10:00:53 MEZ
 An: d...@isis.apache.org d...@isis.apache.org
 Betreff: Entity action with Clob parameter thru restful service
 
 Hi, we want to expose upload file feature of an entity thru restful interface.
 
 According to restful spec https://github.com/danhaywood/restfulobjects-spec 
 it should go like this:
 
 16.2.2 Request (if blobClobs)
 Updating blobClob properties is performed by PUTting the actual value
 (e.g. image), with appropriate content type.
 Note that optional validation (x-ro-validate-only) and domain type
 metadata preferences (x-ro-domain-model) are not supported for
 blobClobs.
 16.2.2.1 Query String
 · none
 16.2.2.2 Headers
 · Content-Type: (depends on property type)
 o eg image/jpeg, image/png, application/pdf
 · If-Match
 o timestamp digest
  obtained from ETag header of representation
  only validate the request, do not modify the property
 16.2.2.3 Body
 · a byte array (for blobs)
 · a character array (for clobs)
 
 So our method signature is:
 
   public String uploadFile(Clob input) { }
 
 And calling restful description of single entity we get
 
 ...
 uploadFile: {
 id: uploadFile,
 memberType: action,
 links: [
 {
 rel: urn:org.restfulobjects:rels/details;action=\uploadFile\,
 href: 
 http://localhost:8080/restful/objects/ASE_BATCH_JOB/L_2354/actions/uploadFile;,
 method: GET,
 type: 
 application/json;profile=\urn:org.restfulobjects:repr-types/object-action\
 }
 ]
 }
 ...
 
 and  in the next step we have
 ...
 {
 rel: urn:org.restfulobjects:rels/invoke;action=\uploadFile\,
 href: 
 http://localhost:8080/restful/objects/ASE_BATCH_JOB/L_2354/actions/uploadFile/invoke;,
 method: POST,
 type: 
 application/json;profile=\urn:org.restfulobjects:repr-types/object-action\,
 arguments: {
 clob: {
 value: null
 }
 }
 },
 ...
 
 So we have playing around with executing the methods thru e.g. postman 
 (chrome app), but with no success.
 
 Here our questions:
 
 1. URL should be something like: 
 http://localhost:8080/restful/objects/ASE_BATCH_JOB/L_2354/actions/uploadFile/invoke
  - this is pretty clear, I think...
 
 2. Should we send PUT or POST Request ?
 
 3. May we define a method with return value, e.g. String, or must be void?
 
 4. Should we annotate our method  with @Action(semantics = 
 SemanticsOf.NON_IDEMPOTENT) ? Without annotations, Isis proposes the POST
 
 5. We put in request header 
 
 Content-Type:text/plain
 
 Should we put something else/more? If-Match element? If yes which value? *
 
 6. How the request body should look like?
 
 6a: raw text ? e.g. ABC
 
 6b: Json clob representation from previous description response
 {
 clob: {
 value: ABC
 }
 }
 
 6c: Json value 
 
 {
 value: ABC
 }
 
 
 Depending on request variants, we get different exceptions. So we are not 
 sure if we use it wrongly or we have a bug...
 
 
 
 Thanks,Vladmir
 
 


Re: Entity action with Clob parameter thru restful service

2015-03-12 Thread Vladimir Nišević
Hi Martin, thank you for your reply. Meanwhile I've made it.

Here my method on e.g. SimpleObject

*  @org.apache.isis.applib.annotation.MemberOrder(sequence = 5.1)*
*@Action(semantics = SemanticsOf.NON_IDEMPOTENT)*
*public void uploadFile(final Clob input) {*
*logger.info http://logger.info(Uploaded file details: \nName: 
+ input.getName() + , MimeType:  + input.getMimeType() + , Length:  +
input.getChars().length());*
*}*


After sending the post request

*URL:
 http://localhost:8080/restful/objects/SIMPLE/L_0/actions/uploadFile/invoke
http://localhost:8080/restful/objects/SIMPLE/L_0/actions/uploadFile/invoke*
*No specific headers like e.g. ContentType*
*Body: {clob:{value: test.txt:text/plain:abc}} *

I've got the correct instantiated Clob object as action parameter.


Thank you for your support!

@Dan: I'm not sure if the RO spec in this case is up to date.

Regs,Vladimir



2015-03-11 21:10 GMT+01:00 Martin Grigorov mgrigo...@apache.org:

 Hi,

 I haven't used Isis restful support yet but let me think loud on your
 questions:

 On Wed, Mar 11, 2015 at 6:33 PM, Vladimir Nišević vnise...@gmail.com
 wrote:

  Hi there, here my question I've posted in isis dev mailing list. Probably
  it is isis-users question.
  Maybe someone can help me with a hint.
 
  BR,Vladimir
 
 
  Anfang der weitergeleiteten E‑Mail:
 
   Von: Vladimir Nišević  vnise...@gmail.com
   Datum: 06. März 2015 10:00:53 MEZ
   An: d...@isis.apache.org d...@isis.apache.org
   Betreff: Entity action with Clob parameter thru restful service
  
   Hi, we want to expose upload file feature of an entity thru restful
  interface.
  
   According to restful spec
  https://github.com/danhaywood/restfulobjects-spec it should go like
 this:
  
   16.2.2 Request (if blobClobs)
   Updating blobClob properties is performed by PUTting the actual value
   (e.g. image), with appropriate content type.
   Note that optional validation (x-ro-validate-only) and domain type
   metadata preferences (x-ro-domain-model) are not supported for
   blobClobs.
   16.2.2.1 Query String
   · none
   16.2.2.2 Headers
   · Content-Type: (depends on property type)
   o eg image/jpeg, image/png, application/pdf
   · If-Match
   o timestamp digest
 obtained from ETag header of representation
 only validate the request, do not modify the property
   16.2.2.3 Body
   · a byte array (for blobs)
   · a character array (for clobs)
  
   So our method signature is:
  
 public String uploadFile(Clob input) { }
  
   And calling restful description of single entity we get
  
   ...
   uploadFile: {
   id: uploadFile,
   memberType: action,
   links: [
   {
   rel: urn:org.restfulobjects:rels/details;action=\uploadFile\,
   href: 
 
 http://localhost:8080/restful/objects/ASE_BATCH_JOB/L_2354/actions/uploadFile
  ,
   method: GET,
   type:
 
 application/json;profile=\urn:org.restfulobjects:repr-types/object-action\
   }
   ]
   }
   ...
  
   and  in the next step we have
   ...
   {
   rel: urn:org.restfulobjects:rels/invoke;action=\uploadFile\,
   href: 
 
 http://localhost:8080/restful/objects/ASE_BATCH_JOB/L_2354/actions/uploadFile/invoke
  ,
   method: POST,
   type:
 
 application/json;profile=\urn:org.restfulobjects:repr-types/object-action\,
   arguments: {
   clob: {
   value: null
   }
   }
   },
   ...
  
   So we have playing around with executing the methods thru e.g. postman
  (chrome app), but with no success.
  
   Here our questions:
  
   1. URL should be something like:
 
 http://localhost:8080/restful/objects/ASE_BATCH_JOB/L_2354/actions/uploadFile/invoke
  - this is pretty clear, I think...
 

 Agreed! Look correct!


  
   2. Should we send PUT or POST Request ?
 

 Use PUT for idempotent operations and POST for non-idempotent


  
   3. May we define a method with return value, e.g. String, or must be
  void?
 

 #uploadFile() is an action with a parameter (the Clob).
 I am not sure about restful.
 Wicket viewer will use the return type to render the result of the action.
 I guess restful will do something similar, i.e. will render a String or an
 empty response with code 200.


  
   4. Should we annotate our method  with @Action(semantics =
  SemanticsOf.NON_IDEMPOTENT) ? Without annotations, Isis proposes the POST
 

 See 2.


  
   5. We put in request header
  
   Content-Type:text/plain
  
   Should we put something else/more? If-Match element? If yes which
 value?
  *
 

 I guess you mean If-None-Match - this should be used for GET requests so
 the server can decide whether to stream the body or just response 304 (non
 modified).
 The content-type value will be put in Clob#contentType, I guess.


  
   6. How the request body should look like?
  
   6a: raw text ? e.g. ABC
 

 yes, if content-type is text/plain


  
   6b: Json clob representation from previous description response
   {
   clob: {
   value: ABC
   }
   }
  
   6c: Json value
  
   {
   value: ABC
   }
 

 6c looks correct if content-type

Re: Using property files to setup IsisSystemForTest

2014-12-04 Thread Vladimir Nišević
Hi Jeroen, was actually a bad idea.

Thanks,Vladimir

2014-11-24 15:15 GMT+01:00 Jeroen van der Wal jer...@stromboli.it:

 Hi Vladimir,

 The isis.properties you want to point to lives in a different project and
 might have a different purpose so you should rather not create and
 inter-project dependency like that. Also your example uses a resource
 location which is specific to your machine which is a pain if you want to
 have another developer work on the same code base.

 In general there are only a few properties you need to set in ISFT since
 most domain services are automatically discovered by the @DomainService
 annotation. We've had no requirement to use isis.properties in our
 integtest projects so far, perhaps you can share the reason why the current
 situation doesn't work for you?

 Cheers,

 Jeroen






 On Mon, Nov 24, 2014 at 11:52 AM, Vladimir Nišević vnise...@gmail.com
 wrote:

  Hi guys, based on example from ToDo, we have wrote an our own
  AppSystemInitializier, where we building our own IsisSystemForTest but
 with
  the difference that we want to reuse current property files, and not
  explicitly declare same we have in the properties again (e.g. domain
  services).
 
  So the question is how to build a IsisSystemForTest where we just point
 to
  webapp\WEBINF\ directory.
 
  Here what we tried using the idea (
  http://isis.apache.org/reference/externalized-configuration.html) but
 yet
  not succeeded.
 
 
  package integration;
 
  import org.apache.isis.core.commons.config.IsisConfiguration;
  import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
  import
 
 
 org.apache.isis.core.commons.config.IsisConfigurationBuilderResourceStreams;
  import
 org.apache.isis.core.commons.resource.ResourceStreamSourceComposite;
  import
  org.apache.isis.core.commons.resource.ResourceStreamSourceFileSystem;
  import org.apache.isis.core.integtestsupport.IsisSystemForTest;
 
  /**
   * Holds an instance of an {@link IsisSystemForTest} as a {@link
  ThreadLocal} on
   * the current thread, initialized with ToDo app's domain services.
   */
  public class AddressSearchEngineSystemInitializer {
 
  public static IsisSystemForTest initIsft() {
  IsisSystemForTest isft = IsisSystemForTest.getElseNull();
  if (isft == null) {
  isft = new
  AddressSearchEngineSystemBuilder().build().setUpSystem();
  IsisSystemForTest.set(isft);
  }
  return isft;
  }
 
  private static class AddressSearchEngineSystemBuilder extends
  IsisSystemForTest.Builder {
 
  public AddressSearchEngineSystemBuilder() {
  with(loadFromFileSystem());
 
  }
 
  private static IsisConfiguration loadFromFileSystem() {
  final String configLocation =
 
 
 D:\\aseDev\\WorkspaceAse.eclipse.luna\\ase\\webapp\\src\\main\\webapp\\WEB-INF\\;
  final ResourceStreamSourceComposite compositeSource = new
 
 
 ResourceStreamSourceComposite(ResourceStreamSourceFileSystem.create(configLocation));
  final IsisConfigurationBuilder isisConfigurationBuilder = new
  IsisConfigurationBuilderResourceStreams(compositeSource);
  return isisConfigurationBuilder.getConfiguration();
  }
  }
  }
 
 
 
  Thanks,Vladimir
 



Wicket viewer - Clob/Blob as return value of an domain service action, download file...

2014-12-04 Thread Vladimir Nišević
Hi there, I'm trying to implement an action on Domain Service (callable
form menu) with an Clob return value

e.g.

String content = HiThere;
return new org.apache.isis.applib.value.Clob(addresses.txt, new
MimeType(text, plain), content.toCharArray());


Would expect to get an Save As dialog to store a file.

Would that make sense?

At the moment I get in wicket (1.7.0)

Stack trace:

   -
   org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException
   - Behavior rejected interface invocation. Component: [AjaxButton
   [Component id = cancelButton]] Behavior:
   org.apache.wicket.ajax.markup.html.form.AjaxButton$1@56ced81f Listener:
   [RequestListenerInterface name=IBehaviorListener, method=public abstract
   void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
   -
   
org.apache.wicket.RequestListenerInterface#invoke(RequestListenerInterface.java:237)
   -
   
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#invokeListener(ListenerInterfaceRequestHandler.java:250)
   -
   
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#respond(ListenerInterfaceRequestHandler.java:236)


Regards,Vladimir


Re: Upgrade Jackson from 1.9.11 to 2.4.3

2014-11-26 Thread Vladimir Nišević
Hi Jeroen, I've just uploaded patch as attachment on
https://issues.apache.org/jira/browse/ISIS-959

Regards,Vladimir

2014-11-21 17:16 GMT+01:00 Jeroen van der Wal jer...@stromboli.it:

 Hi Vladimir,

 You could try to upgrade yourself. Patches are welcome!

 Cheers,

 Jeroen

 On Fri, Nov 21, 2014 at 5:03 PM, Dan Haywood d...@haywood-associates.co.uk
 
 wrote:

  That'll probably be ok to do, yes.
 
  Could you raise a ticket in JIRA, please?
 
  Thx
  Dan
 
 
  On 21 November 2014 14:51, Vladimir Nišević vnise...@gmail.com wrote:
 
   Hi guys, we are using ISIS with custom json representation of our
   responses, and for that purposes we are using Jackson
   https://github.com/FasterXML/jackson
  
   We want to use 2.4.x-version, but Isis is currently using 1.9.11
  
   Is there any chance to get an upgrade of isis to 2.4.3 ?
  
   Regards,Vladimir
  
 



Using property files to setup IsisSystemForTest

2014-11-24 Thread Vladimir Nišević
Hi guys, based on example from ToDo, we have wrote an our own
AppSystemInitializier, where we building our own IsisSystemForTest but with
the difference that we want to reuse current property files, and not
explicitly declare same we have in the properties again (e.g. domain
services).

So the question is how to build a IsisSystemForTest where we just point to
webapp\WEBINF\ directory.

Here what we tried using the idea (
http://isis.apache.org/reference/externalized-configuration.html) but yet
not succeeded.


package integration;

import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
import
org.apache.isis.core.commons.config.IsisConfigurationBuilderResourceStreams;
import org.apache.isis.core.commons.resource.ResourceStreamSourceComposite;
import org.apache.isis.core.commons.resource.ResourceStreamSourceFileSystem;
import org.apache.isis.core.integtestsupport.IsisSystemForTest;

/**
 * Holds an instance of an {@link IsisSystemForTest} as a {@link
ThreadLocal} on
 * the current thread, initialized with ToDo app's domain services.
 */
public class AddressSearchEngineSystemInitializer {

public static IsisSystemForTest initIsft() {
IsisSystemForTest isft = IsisSystemForTest.getElseNull();
if (isft == null) {
isft = new
AddressSearchEngineSystemBuilder().build().setUpSystem();
IsisSystemForTest.set(isft);
}
return isft;
}

private static class AddressSearchEngineSystemBuilder extends
IsisSystemForTest.Builder {

public AddressSearchEngineSystemBuilder() {
with(loadFromFileSystem());

}

private static IsisConfiguration loadFromFileSystem() {
final String configLocation =
D:\\aseDev\\WorkspaceAse.eclipse.luna\\ase\\webapp\\src\\main\\webapp\\WEB-INF\\;
final ResourceStreamSourceComposite compositeSource = new
ResourceStreamSourceComposite(ResourceStreamSourceFileSystem.create(configLocation));
final IsisConfigurationBuilder isisConfigurationBuilder = new
IsisConfigurationBuilderResourceStreams(compositeSource);
return isisConfigurationBuilder.getConfiguration();
}
}
}



Thanks,Vladimir


Upgrade Jackson from 1.9.11 to 2.4.3

2014-11-21 Thread Vladimir Nišević
Hi guys, we are using ISIS with custom json representation of our
responses, and for that purposes we are using Jackson
https://github.com/FasterXML/jackson

We want to use 2.4.x-version, but Isis is currently using 1.9.11

Is there any chance to get an upgrade of isis to 2.4.3 ?

Regards,Vladimir


Usage of multiple DomainObjectContainers ?

2014-10-01 Thread Vladimir Nišević
Hi guys, I have a requirement where parts of my domain objects come from
different sources.

a. reational database
b. elasticsearch (accessible thru REST interface)

What would be a feasible approach?

My first idea was to introduce a view models and instantiate them manually
and fill them from RDB and Elasticsearch sources. A kind of anticorruption
layer?

Or should I implement additional DomainObjectContainer interface (
https://isis.apache.org/reference/DomainObjectContainer.html ) for
elasticsearch?

Can I use multiple domain object container implementation at the same time?

Regs,Vladimir


Re: Usage of multiple DomainObjectContainers ?

2014-10-01 Thread Vladimir Nišević
Hi Dan, thanks for your feedback, I'll stick to my first idea, and as soon
I have something to share, will definitely come back to you.


Nevertheless, I have some show-stoppers there:

1. View model representation in wicket viewer - please check my latest
comments on  https://issues.apache.org/jira/browse/ISIS-899
2. View model entity referencing another view model entity - check also
same issue



3. Also have another question / feature request regarding restful viewer.

My service consumer needs actually simplified JSON response.  I guess I
would need a kind simplified rest viewer?

Regs,Vladimir



Here my spec by example:


*Given two view model objects and domain service returning instance of A.*

@ViewModel
Class A {

private int id;

private String a1;

private B b1;

}


@ViewModel
Class B {

private int id;
private String c1;
}

*when a 3rd party service consumer calls the domain service method
getForExample() thru restful invoke API*

@DomainService
public class Service1 {

public A getForExample() {
...
}
}

*then the answer should be a simple JSON structure representing only the
parameters of the objects*

{
id: 123,
a1: someTextHere,

b1 : {

c1: someAnotherTextHere

}

}






2014-10-01 9:50 GMT+02:00 Dan Haywood d...@haywood-associates.co.uk:

 Hi Vladimir,

 I would go with your first idea; this sort of side-loading approach
 should work fine.

 If you end up with anything that is reusable, please consider creating a
 github repo so that we can (at minimum) fork it into isisaddons [1]

 Cheers
 Dan

 [1] http://www.isisaddons.org/


 On 1 October 2014 08:44, Vladimir Nišević vnise...@gmail.com wrote:

  Hi guys, I have a requirement where parts of my domain objects come from
  different sources.
 
  a. reational database
  b. elasticsearch (accessible thru REST interface)
 
  What would be a feasible approach?
 
  My first idea was to introduce a view models and instantiate them
 manually
  and fill them from RDB and Elasticsearch sources. A kind of
 anticorruption
  layer?
 
  Or should I implement additional DomainObjectContainer interface (
  https://isis.apache.org/reference/DomainObjectContainer.html ) for
  elasticsearch?
 
  Can I use multiple domain object container implementation at the same
 time?
 
  Regs,Vladimir
 



Re: using externalized configuration parameter in a domain service

2014-09-24 Thread Vladimir Nišević
Hi Dan, yes I saw the Settings add-on.  Bur I need to use the configuration 
parameter when instantiating my domain service (Isis biotstrap?). 

As far I understand,the way would be to use ApplicationSettingsService 
(https://github.com/isisaddons/isis-module-settings/blob/master/dom/src/main/java/org/isisaddons/module/settings/dom/ApplicationSettingsService.java
 )

What I don't undersand is the order 
how Isis creates the domain services. Can I use the AppSettigsService in this 
early Isis bootstrapping phase?

Hope I explained this clearly...

BR,Vladimir


 Am 23.09.2014 um 15:53 schrieb Dan Haywood d...@haywood-associates.co.uk:
 
 Hi Vladimir,
 
 Not quite sure how the second doc helped you, but perhaps I misunderstood
 your original question.
 
 But at any rate, if you want to do is to store application-settings, then
 check out the Settings module add-on [1]...  that'll let you store such
 stuff in the database.
 
 Other add-ons listed at [2]
 
 Cheers
 Dan
 
 [1] https://github.com/isisaddons/isis-module-settings
 [2] http://www.isisaddons.org/
 
 
 On 23 September 2014 14:08, Vladimir Nišević vnise...@gmail.com wrote:
 
 Found on my own the answer in documentation (
 
 https://isis.apache.org/more-advanced-topics/how-to-09-020-How-to-write-a-typical-domain-service.html
 )
 
 
 Sorry and thanks!
 Vladimir
 
 2014-09-23 14:54 GMT+02:00 Vladimir Nišević vnise...@gmail.com:
 
 Hi guys, I have question how to deal with application specific
 configuration parameters...
 
 
 I use elasticsearch to put/get specific documents and use them in a
 domain
 model.
 
 So I defined a domain service EsClient to access to elasticsearch - I
 use service lifecycle to connect/disconnect to elasticseach.
 
 
 
 According to ((
 https://isis.apache.org/reference/configuration-files.html)
 ) my first idea was to:
 
 - put the configuration parameters into isis.properites
 - get the parameter value in a domain service by
 container.getProperty(propertyName);
 
 Currently I get null value here...
 
 Thanks,Vladimir
 
 
 
 Here my code (relevant parts)
 
 
 @Named(Elasticsearch)
 @DomainService(menuOrder = 1.2)
 public class EsClient {
 
 private static final String ES_CLUSTER_PROPERTY_NAME =
 elasticsearch.cluster;
 private static final String ES_SERVER_PROPERTY_NAME =
 elasticsearch.server;
 private static final String ES_SERVER_PORT_PROPERTY_NAME =
 elasticsearch.port;
 ..
 ...
 
  @SuppressWarnings(resource)
@PostConstruct
@Programmatic
public void connectToEs() {
 
final String esClusterName =
 container.getProperty(ES_CLUSTER_PROPERTY_NAME);
container.getUser()
final String esServer =
 container.getProperty(ES_SERVER_PROPERTY_NAME);
final String esPort =
 container.getProperty(ES_SERVER_PORT_PROPERTY_NAME);
 
logger.info(Using elasticsearch properties from
 isis.poperties:
 +  server= + esServer + , +  port= + esPort + , +  cluster= +
 esClusterName);
 
final Settings settings =
 ImmutableSettings.settingsBuilder().put(
 cluster.name, esClusterName)
// .put(node.name, ES_LOCAL_NODE_NAME)
.put(client.transport.nodes_sampler_interval, 10) //
 10
  //
 seconds
  //
 ping
.put(client.transport.sniff, false).build();
client = new TransportClient(settings).addTransportAddress(new
 InetSocketTransportAddress(esServer, Integer.valueOf(esPort)));
 
logger.info(Connected to elasticsearch: +   server= +
 esServer + , +  port= + esPort + , +  cluster= + esClusterName);
 
// instance a json mapper
mapper = new ObjectMapper(); // create once, reuse
 
}
 
@PreDestroy
@Programmatic
public void disconnectFromES() {
node.close();
}
 
 
 // //
// Injected Services
// //
 
@javax.inject.Inject
private DomainObjectContainer container;
 


Re: using externalized configuration parameter in a domain service

2014-09-24 Thread Vladimir Nišević
Hi Jeroen, thanks, that's exactly how I did it.
 
But Dan's proposal by using a database as a source for config items would be 
also interesting.

lG,Vladimir


 Am 24.09.2014 um 10:47 schrieb Jeroen van der Wal jer...@stromboli.it:
 
 Hi Vladimir,
 
 When you add an init method which takes a map of  tow strings as the
 parameter and mark that with postconstruct you can easily access the
 isis.properties values.
 
 @DomainService
 public class MyDomainService
private MapString, String properties
 
@Programmatic
@PostConstruct
public void init(final MapString,String properties) {
this.properties = properties;
}
 

 
 }
 
 On Wed, Sep 24, 2014 at 9:33 AM, Vladimir Nišević vnise...@gmail.com
 wrote:
 
 Hi Dan, yes I saw the Settings add-on.  Bur I need to use the
 configuration parameter when instantiating my domain service (Isis
 biotstrap?).
 
 As far I understand,the way would be to use ApplicationSettingsService (
 https://github.com/isisaddons/isis-module-settings/blob/master/dom/src/main/java/org/isisaddons/module/settings/dom/ApplicationSettingsService.java
 )
 
 What I don't undersand is the order
 how Isis creates the domain services. Can I use the AppSettigsService in
 this early Isis bootstrapping phase?
 
 Hope I explained this clearly...
 
 BR,Vladimir
 
 
 Am 23.09.2014 um 15:53 schrieb Dan Haywood d...@haywood-associates.co.uk
 :
 
 Hi Vladimir,
 
 Not quite sure how the second doc helped you, but perhaps I misunderstood
 your original question.
 
 But at any rate, if you want to do is to store application-settings, then
 check out the Settings module add-on [1]...  that'll let you store such
 stuff in the database.
 
 Other add-ons listed at [2]
 
 Cheers
 Dan
 
 [1] https://github.com/isisaddons/isis-module-settings
 [2] http://www.isisaddons.org/
 
 
 On 23 September 2014 14:08, Vladimir Nišević vnise...@gmail.com
 wrote:
 
 Found on my own the answer in documentation (
 https://isis.apache.org/more-advanced-topics/how-to-09-020-How-to-write-a-typical-domain-service.html
 )
 
 
 Sorry and thanks!
 Vladimir
 
 2014-09-23 14:54 GMT+02:00 Vladimir Nišević vnise...@gmail.com:
 
 Hi guys, I have question how to deal with application specific
 configuration parameters...
 
 
 I use elasticsearch to put/get specific documents and use them in a
 domain
 model.
 
 So I defined a domain service EsClient to access to elasticsearch - I
 use service lifecycle to connect/disconnect to elasticseach.
 
 
 
 According to ((
 https://isis.apache.org/reference/configuration-files.html)
 ) my first idea was to:
 
 - put the configuration parameters into isis.properites
 - get the parameter value in a domain service by
 container.getProperty(propertyName);
 
 Currently I get null value here...
 
 Thanks,Vladimir
 
 
 
 Here my code (relevant parts)
 
 
 @Named(Elasticsearch)
 @DomainService(menuOrder = 1.2)
 public class EsClient {
 
 private static final String ES_CLUSTER_PROPERTY_NAME =
 elasticsearch.cluster;
 private static final String ES_SERVER_PROPERTY_NAME =
 elasticsearch.server;
 private static final String ES_SERVER_PORT_PROPERTY_NAME =
 elasticsearch.port;
 ..
 ...
 
 @SuppressWarnings(resource)
   @PostConstruct
   @Programmatic
   public void connectToEs() {
 
   final String esClusterName =
 container.getProperty(ES_CLUSTER_PROPERTY_NAME);
   container.getUser()
   final String esServer =
 container.getProperty(ES_SERVER_PROPERTY_NAME);
   final String esPort =
 container.getProperty(ES_SERVER_PORT_PROPERTY_NAME);
 
   logger.info(Using elasticsearch properties from
 isis.poperties:
 +  server= + esServer + , +  port= + esPort + , +  cluster= +
 esClusterName);
 
   final Settings settings =
 ImmutableSettings.settingsBuilder().put(
 cluster.name, esClusterName)
   // .put(node.name, ES_LOCAL_NODE_NAME)
   .put(client.transport.nodes_sampler_interval, 10) //
 10
 //
 seconds
 //
 ping
   .put(client.transport.sniff, false).build();
   client = new TransportClient(settings).addTransportAddress(new
 InetSocketTransportAddress(esServer, Integer.valueOf(esPort)));
 
   logger.info(Connected to elasticsearch: +   server= +
 esServer + , +  port= + esPort + , +  cluster= +
 esClusterName);
 
   // instance a json mapper
   mapper = new ObjectMapper(); // create once, reuse
 
   }
 
   @PreDestroy
   @Programmatic
   public void disconnectFromES() {
   node.close();
   }
 
 
 // //
   // Injected Services
   // //
 
   @javax.inject.Inject
   private DomainObjectContainer container;
 


ViewModel as return value of domain service

2014-09-23 Thread Vladimir Nišević
Hi everybody, here my second question today.

I need to provide a domain service which handles multiple elasticsearch and
database queries and builds a non persistent domain object and gives that
as a response to the 3rd party client thru REST API.

So my idea is to define a ViewModel classes representing my non-persistent
domain model and use them as method return value of a domain service. In a
domain service method I would make those elasticsearch and database queries
and then build and provide that object as a return value.

It seems that ViewModel cannot be returned thru REST API?

BR,Vladimir


Re: Adding data Nucleus to Eclipse

2014-01-03 Thread Vladimir Nišević
Hi, Eclipse has various perspectives. When developing Java, you usually use
one of this perspectives:  Java or Java EE. Perspective Java EE comes
with specific Eclipse plugins - J2EE Development - see
http://www.eclipse.org/downloads/moreinfo/jee.php

I've observed that Datanucleus plugin and  Add DataNucleus support
appears only in if the perspective Java but not Java EE. Maybe others
can confirm that, ff so, maybe somebody should update the instructions.

I'm using Juno on Windows 8.1 (all 64-bit versions) and have behaviour as
described...

Vladimir


2014/1/2 dave.po...@pinan.co.uk

 hik list

 I am trying to follow the instructions

 http://isis.apache.org/components/objectstores/jdo/datanucleus-and-eclipse.html

 to add Data Nucleus to my copy Eclipse Version: Luna Release
 Build id: 20131219-0014, the Data Nucleus plugin is list as version 3.04.

 I do not see any of the 'Add DataNucleus support', on the dom project
 eclipse  properties menu, but it is listed when you click properties.

 On the same page, there is a section off code to add to a pom file, under
 the title 'Update the classpath', there is no version supplied which
 causes maven to barf when it see new dependency

 The platform is Windoz 7

 AM  I suffering from a version issues or is this case of out dated
 documentation?

 Dave.