Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze ZK configuration files similar to Spring #15

Closed
schauder opened this issue Jan 26, 2013 · 4 comments
Closed

Analyze ZK configuration files similar to Spring #15

schauder opened this issue Jan 26, 2013 · 4 comments
Labels

Comments

@schauder
Copy link
Collaborator

This should probably done in a separate project, since ZK is somewhat obscure. But it could be a great example for a plugin like thin.

@schauder
Copy link
Collaborator Author

all *.zul files in the directory structure should get considered

<include src="x">

should be considered a dependency from the current file to the "x"

@ref Elements in the file shoud be considered dependencies
fully qualified class Names should be considered dependencies to these classes

@matthiasthieroff
Copy link

An example for included zul files

tabbox.zul (reduced to minimum necessary information)

<zk>
    <!-- Option 1 -->
    <include src="/WEB-INF/styles/default.zul" />

    <tabbox >
        <tabs>
            <tab label="1" />
            <tab label="2" />
        </tabs>
        <tabpanels>
            <tabpanel>
                <!-- Option 2 -->
                <include src="@load(xyzVW.getSrc('tabpanel1.zul'))" />
            </tabpanel>
            <tabpanel>
                <!-- Option 3 -->
                <include src="@load(xyzVW.getSrc('subdir/tabpanel2.zul'))" />
            </tabpanel>
        </tabpanels>
    </tabbox>
</zk>

Option 1: The src path is a path relative to the web apps root folder.

Option 2: The src path is composed of a root path and the filename 'tabpanel1.zul'. By convention the root path is the exact same directory where 'tabbox.zul' is located.

Option 3: The src path is composed of a root path and a subdirectory/filename 'subdir/tabpanel2.zul'. By convention the root path is the exact same directory where 'tabbox.zul' is located.

@matthiasthieroff
Copy link

An example for dependent Java classes

viewModel.zul

<zk>
    <!-- Option 1 -->
    <div apply="org.zkoss.bind.BindComposer"
        viewModel="@id('xyz') 
        @init('com.abc.def.XyzVM')">

        <!-- Option 2 -->
        <include src="other.zul"
            otherVM="@ref(xyz.other)"/>

        <!-- Option 3 -->
        <div apply="${mnoCtrl}"/>

        <!-- Option 4 -->
        <div apply="com.abc.def.pqsCtrl"/>

    </div>
</zk>

Option 1: Full qualified name to a dependent viewModel 'com.abc.def.XyzVM'.

Option 2: The variable 'otherVM' points to the return value of 'XyzVM.getOther()' and is accessible in 'other.zul'. This class could be everywhere :(

Option 3: A controller which gets injected via spring. You have to look up all spring conexts or scan all source files to resolve the dependency :(

Option 4: A controller with a full qualified name.

@schauder
Copy link
Collaborator Author

Sorry, currently I have no intention to make analysis pluggable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants