[Gambas-devel] gambas wiki db scheme

Sebastian Kulesz sebikul at ...176...
Thu Sep 20 02:51:35 CEST 2012


On Tue, Sep 18, 2012 at 8:35 PM, Benoît Minisini
<gambas at ...1...> wrote:
> Le 19/09/2012 00:14, Sebastian Kulesz a écrit :
>> On Tue, Sep 18, 2012 at 6:51 PM, Benoît Minisini
>> <gambas at ...1...> wrote:
>>> Le 18/09/2012 23:34, Sebastian Kulesz a écrit :
>>>>
>>>> Actually, the parsing could be done inside a module, input text with
>>>> markup > output html. So, if we start building the website now, this
>>>> module would just plug in really easily, so it's not a hard
>>>> requirement for now.
>>>>
>>>
>>> The current markup routine can be used. It is just that the '@' special
>>> commands are not implemented. But this can be done later.
>>>
>>>>>
>>>>> I'd like the new wiki to be entirely based on one Gambas CGI script
>>>>> using the gb.web component and ASP-like pages. That way it will be a
>>>>> good demo for how to use that component.
>>>>
>>>> I like the idea, but i think that the ASP rendering engine would need
>>>> a few changes. First, it should be possible to get the result without
>>>> it being printed.
>>>
>>> What for? What do you mean?
>>>
>>>> Second, i don't know if this currently exists, but
>>>> there should be a syntax declaration to include the content of another
>>>> webpage inside the current one. Maybe <% Include "Webpage2" %>
>>>
>>> The syntax exists, but it is not wonderful:
>>>
>>> <%:WebPage2%>
>>>
>>> But it can take arguments: <%:WebPage2 foo="bar" zip="zap"%>
>>>
>>> And these arguments can be used inside WebPage2 with <%!foo%> and <%!zip%>
>>>
>>> Not wonderful syntaxes! :-/
>>>
>>> Maybe I could change them into something like that:
>>>
>>> <<WebPage2> foo="bar" zip="zap">
>>> <%=[foo]%>
>>>
>>> More readable? More logical?
>>
>> What about something like... <% Webpage2, ("foo", "bar", ...) %>
>
> This is ambiguous: <% ... %> is gambas code.
>
>>
>> <%=Args[0] %> --> foo
>> <%=Args[1] %> --> bar
>>
>> <%=Args[2] %> --> NULL, no error should be thrown, but instead return
>> an empty string.
>
> Ambiguous too: <%=xxx%> is just the same as "Print Html$(xxx)" (see below).
>
>>
>> This way we don't get local vs global variables, and is easy to check
>> if an argument was passed or not. A webpage should be much more
>> "malleable" than a class. What do you think?
>
> Maybe you should look at the source code of gbc_form_webpage.c. :-)
>
> A WebPage is just a class with a big "Render" routine that use Print to
> send the HTML.
>
> All these markups are converted to Print instructions, or directly sent
> to the compiler when you use <% ... %>.
>
> And the Webpage arguments are just a collection sent to the Render
> routine through its first argument, named "_Args" - you almost got it,
> just an underscore! :-) So if you need you can use _Args["foo"]... but
> of course this is not recommended nor documented.
>
> So all you want has already been done.
>
> All these <% ... %> syntaxes are syntactic sugar whose aim is just being
> easier to read, and make think that a WebPage can be included like a
> HTML markup (<%: ... %>).
>
> Regards,
>
> --
> Benoît Minisini
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel

I've been playing around a bit with the code. I already have most of
the basics, the database, user management and sessions are working.
I'm moving the header code, it's not easy, but when inside a Web Page,
it looks really good and easy to modify. I'm currently working with
the functions necessary to translate URL paths into pages and vice
versa, hoping to keep the pattern untouched.

The gb.web component really saves a lot of code, mostly because of how
the wiki handles url parameters. Using it proved to be really helpful.
I've also added some specific MySQL routines from gb.mysql, but that
shouldn't be a problem. I've not implemented sessions yet, but they
seem really easy to use.

I saw how symbols are automatically detected, but i don't want to
touch that part of the app, seems too delicate.

If possible, could you post the content of the .htaccess or, at least,
the code that handles redirection and URL translation?

Thanks!




More information about the Devel mailing list