Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 02 11:10

    FrankHossfeld on master

    Update wiki (compare)

  • Nov 21 11:57
    FrankHossfeld labeled #165
  • Nov 18 19:31

    FrankHossfeld on master

    update Wiki (compare)

  • Nov 18 08:09
    FrankHossfeld closed #170
  • Nov 18 07:09

    FrankHossfeld on master

    update Wiki (compare)

  • Nov 18 06:54

    FrankHossfeld on version

    (compare)

  • Nov 18 06:48

    FrankHossfeld on 170

    (compare)

  • Nov 18 06:48

    FrankHossfeld on master

    #170 - Add PostLoader to Nalu (… (compare)

  • Nov 18 06:48
    FrankHossfeld closed #171
  • Nov 18 06:48
    FrankHossfeld opened #171
  • Nov 18 06:48

    FrankHossfeld on 170

    #170 - Add PostLoader to Nalu (compare)

  • Nov 18 06:47
    FrankHossfeld edited #170
  • Nov 18 06:47
    FrankHossfeld edited #170
  • Nov 18 06:45
    FrankHossfeld edited #170
  • Nov 17 20:50
    FrankHossfeld milestoned #170
  • Nov 17 20:50
    FrankHossfeld labeled #170
  • Nov 17 20:50
    FrankHossfeld assigned #170
  • Nov 17 20:50
    FrankHossfeld opened #170
  • Nov 17 08:13
    FrankHossfeld closed #128
  • Nov 17 08:13
    FrankHossfeld commented #128
Daniel Korbel
@masterdany88
I am testing new 2.1.0 cache on composites.
But it seems to not clear cached controllers
Tino Desjardins
@TDesjardins

But it seems to not clear cached controllers

Could you clarify what you mean with "clear cached controllers"!

Or better what is your expectation.
Daniel Korbel
@masterdany88

I have this huge composite controller:


@Controller(
        route = Routes.NETWORK_CONFIGURATION,
        selector = HTMLSelectors.CONTENT,
        componentInterface = INetworkComponent.class,
        component = NetworkComponent.class
)
@Composites({
        @Composite(name = NetworkHTMLSelectors.NETWORK_CONFIGURATION_LAN_SELECTOR,
                compositeController = LanController.class,
                selector = NetworkHTMLSelectors.NETWORK_CONFIGURATION_LAN_SELECTOR),
        @Composite(name = NetworkHTMLSelectors.NETWORK_CONFIGURATION_WIFI_SELECTOR,
                compositeController = WifiController.class,
                selector = NetworkHTMLSelectors.NETWORK_CONFIGURATION_WIFI_SELECTOR),
        @Composite(name = NetworkHTMLSelectors.NETWORK_PROXY_CONFIGURATION_SELECTOR,
                compositeController = ProxyController.class,
                selector = NetworkHTMLSelectors.NETWORK_PROXY_CONFIGURATION_SELECTOR),
        @Composite(name = NetworkHTMLSelectors.NETWORK_CERTIFICATE_SELECTOR,
                compositeController = CertificateController.class,
                selector = NetworkHTMLSelectors.NETWORK_CERTIFICATE_SELECTOR),
})
public class NetworkController extends AbstractComponentController<APContext, INetworkComponent, HTMLElement>
        implements INetworkComponent.Controller {

And most of its composites controller are cached, f.e.:


@CompositeController(
        componentInterface = ILanComponent.class,
        component = LanComponent.class
)
public class LanController extends AbstractCompositeController<APContext, ILanComponent, HTMLElement> implements ILanComponent.Controller {
    private UiLocker uiLocker;

    @Override
    public void start() {
        router.storeInCache(this);
        LanRestResourceFactory.INSTANCE.get()
                .onBeforeSend(() -> uiLocker.start())
                .onSuccess(dto -> component.edit(dto))
                .onComplete(() -> uiLocker.stop())
                .send();
}


    @Override
    public void stop() {
        router.removeFromCache(this);
    }

public class LogoutHelper {
    public static void logout(APContextcontext, Router router) {
        AppDialog.closeAll();
        context.clear();
        router.clearCache();
        router.forceRoute(Routing.LOGIN.getRoute());
        RestConfig.removeAuthorizationHeader();
    }

As You can see I am doing REST call on controller start. If nalu would cache such controller I would have this request after each logout and login.
Right now is not happening I think.

See my logout class
Frank Hossfeld
@FrankHossfeld
This does not make sense:
@Override
    public void stop() {
        router.removeFromCache(this);
    }
Tino Desjardins
@TDesjardins
@masterdany88 Is NetworkController cached?
Frank Hossfeld
@FrankHossfeld
Why do you think, the cache is not cleared? The event handler are not removed?
Daniel Korbel
@masterdany88
I am not getting rest calls on cached subcontrollers
if It would be cleared I would get new data from backend
NetworkController is not cached
Frank Hossfeld
@FrankHossfeld
Hard to say without seeing the code.
Tino Desjardins
@TDesjardins
@masterdany88 Is NetworkController cached?
Daniel Korbel
@masterdany88
NetworkController is not cached
Frank Hossfeld
@FrankHossfeld
where do you do your REST calls?
Daniel Korbel
@masterdany88
in start() of LanController
Frank Hossfeld
@FrankHossfeld
Is LanController cached?
Daniel Korbel
@masterdany88
yes
see classes pasted earielr
Frank Hossfeld
@FrankHossfeld
What is the expected behavior?
Daniel Korbel
@masterdany88
When I logut and login back I should have fresh lancontroller
so start method should be excuted
and so Rest call
Frank Hossfeld
@FrankHossfeld
Only, if you reload the application, remove the LanController from cahceh or clear the cache
Daniel Korbel
@masterdany88
I do clear the cache
it not work
why I reload it works
see my logout:
public class LogoutHelper {
    public static void logout(APContextcontext, Router router) {
        AppDialog.closeAll();
        context.clear();
        router.clearCache();
        router.forceRoute(Routing.LOGIN.getRoute());
        RestConfig.removeAuthorizationHeader();
    }
Frank Hossfeld
@FrankHossfeld
Which version are you using?
Daniel Korbel
@masterdany88
newest
2.1.0
Frank Hossfeld
@FrankHossfeld
Try HEAD-SNAPSHOT
please
Frank Hossfeld
@FrankHossfeld
Tino Desjardins
@TDesjardins
The application version is then hardcoded?
Frank Hossfeld
@FrankHossfeld
atm yes, as String inside the Version annotation. May be we can move the version to a property file. Neeed to check weather it is possible to read properties during annotation processing.
Ahmad K. Bawaneh
@vegegoku
this can be done with a system property, which can be passed from the build system from any ci tool
Frank Hossfeld
@FrankHossfeld
Yeap, sounds good. Nalu can look for a System proerpty like ‚application.version‘. If found, Nalu use this and if not the String from the version annotation. What do you think?
Ahmad K. Bawaneh
@vegegoku
why would you need the annotation, it is either provided from build system or not
Frank Hossfeld
@FrankHossfeld
@/all The latest SNAPSHOT has a breaking change: AbstractApplicationLoaderis renamed to AbstractLoader.
hossein-tabei
@hossein-tabei
Hi, I want to create an application that user dynamically can create new page(i.e new route). In fact I want to write a News website which admin user is able to add new pages for each news. Anything I have read about Nalu, is that all routes must be declared during developing time. And after building the project it is impossible to declare new route dynamically by user. Is it true or I'm wrong? If I'm wrong please help me.
Frank Hossfeld
@FrankHossfeld
Hi, will the news websites have the same layout? And only the content changes?
hossein-tabei
@hossein-tabei
Yes, layouts are the same and only content changes.
Frank Hossfeld
@FrankHossfeld
In tthis case I would store the news inside a database, create one route with a key and use the key to access the database.
Frank Hossfeld
@FrankHossfeld
So, you have one route - the variable part is the key - and one Controller and one Component.
hossein-tabei
@hossein-tabei
I think it can resolve my problem. Thank you for your help Frank. And thanks for creating Nalu. It's very useful.
Frank Hossfeld
@FrankHossfeld
Thank you … feel free to conbtact me, if you ran into problems or have questions.
hossein-tabei
@hossein-tabei
Sure. Thanks