Recent

Author Topic: Free Spider, a web development for Lazarus  (Read 36347 times)

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Free Spider, a web development for Lazarus
« on: September 11, 2009, 03:04:19 pm »
I finished developing Free Spider web development for Free Pascal/Lazraus
It is similar to Delphi's WebBroker CGI applications.
It has an automatic multipart/form-date decoder to upload/download files
for more information please visit FreeSpider homepage: http://code.sd/freespider
Motaz
« Last Edit: May 29, 2014, 03:52:46 pm by motaz »

DougNettleton

  • Jr. Member
  • **
  • Posts: 84
Re: Free Spider, a web development for Lazarus
« Reply #1 on: September 11, 2009, 11:47:29 pm »
Motaz:

Thanks for your efforts!  I downloaded the component, sample and manual.  Sorry to trouble you, but if I could ask some questions:

1) Has the package been tested at all with Windows?
After successfully installing the package, by changing the Compiler
Options/Pathes/Other Unit files to ...

$(LazarusDir)\lcl\units\$(TargetCPU)-$(TargetOS)\;$(LazarusDir)\lcl\units\$(TargetCPU)-$(TargetOS)\$(LCLWidgetType)\;$(LazarusDir)\packager\units\$(TargetCPU)-$(TargetOS)\

The sample program wouldn't Build.  After some warnings, I got fifty messages like ...

spidersample.lpr(13,1) Error: Undefined symbol: WSRegisterMenuItem

Followed by ...

spidersample.lpr(13,1) Fatal: There were 50 errors compiling module, stopping

Adding ", Interfaces" to the uses clause of the program caused these errors to go away.

2) Should there be a dependency for the LCL?

Since I couldn't get the sample to build, I started with the documentation and at Step 5 of ...

How to create Free Spider web applications

when I double clicked on the OnCreate event for DataModule1 I got an error message about not being able to find the "Controls" unit. 

Anyways, I've adde3d a dependency for LCL.

Thnaks, again.  Looking forward to exploring the possibilities over the weekend.

Doug

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Free Spider, a web development for Lazarus
« Reply #2 on: September 12, 2009, 09:19:24 am »
Hello Doug and thanks for your time to test my package.
1. I was searching for this global automatic path, and you gave it to me. Now there is no problem compiling in Windows/Linux

2. I modified the sample. I added UNIX, WINDOWS directives for .exe extention in windows

3. I was developing and testing this package in 0.9.26.2 in Linux and Winodws which is the stable and officital version.

4. There is no dependency LCL, all the components are inherited from TComponent

5. In Windows I found that there is a problem in Multipart form, I'm checking it now.

6. Now I've updated the home page of Free Spider by the latest modifications 1.0.1

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Free Spider, a web development for Lazarus
« Reply #3 on: September 12, 2009, 02:43:40 pm »
Now I fixed the bug of Windows uploading files. It was #26 Eof which interrupts the reading.
Now you can upload files in Windows and save it in the server, but there is still something wrong in downloading the same file to the client again.
Anybody can help?

DougNettleton

  • Jr. Member
  • **
  • Posts: 84
Re: Free Spider, a web development for Lazarus
« Reply #4 on: September 14, 2009, 04:05:50 pm »
Motaz:

Maybe I'm missing something, but if I try step by step from your documentation, as soon as I add a DataModule component to my new project and click on OnCreate, I get the error:

unit1.pas(8,59) Error: unit not found: Controls

If I try to compile an empty project with just the DataModule, I get the error:

unit1.pas(8,22) Fatal: Can't find unit FileUtil used by Unit1

so while technically, your components are not dependant on the LCL,  you can't really use them in a project that doesn't use the LCL.  Your sample includes TMemDataset which is dependant of the LCL.

I only offer the foregoing so you can update your documentation to save other future users - who might be as thick as me - some frustration.

BY the way I was testing with the following snapshot:

Lazarus-0.9.29-21640-fpc-2.3.1-20090910-win32

which as I indicated requires ...

Adding ", Interfaces" to the uses clause of the program.

Perhaps that wasn't required in the "stable" release 0.9.26.2, but I suspect it will be in release 0.9.28 since there are only 5 outstanding problems listed on the roadmap to 0.9.28 and none of them refer to this problem.

Regards,

Doug

P.S. I'm still looking forward to more exploration of your package.


motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Free Spider, a web development for Lazarus
« Reply #5 on: September 15, 2009, 11:37:35 am »
Hello Doug.
Should users add Interfaces into main application (Program) or the DataModule?
I'll install the latest version of Lazarus and I'll test it too.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Free Spider, a web development for Lazarus
« Reply #6 on: September 15, 2009, 11:53:52 am »
To the main program file.

IMHO, it is better to add the LCL as requirement than adding all those paths to the unit directories.

I have not looked at the package, but if you don't use something graphical, maybe it is better to try to remove the dependency on the LCL completely. How does TMemDataset on the LCL? I thought it was a fcl-db component.


motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Free Spider, a web development for Lazarus
« Reply #7 on: September 15, 2009, 02:37:19 pm »
How can I Remove/Add LCL requirement in the package?
and yes I have no graphical component, all of them are TComponent descendants
but the problem occurs when you create Program then add DataModule (Without adding FreeSpider components) you couldn't compile this new project because of lack of that path. I think this is a bug in Lazarus.


TMemDataset is in the sample program not the package itself

When I added Interfaces to main program uses caluse the sample works fine for the last snapshot in Windows
« Last Edit: September 15, 2009, 02:38:52 pm by motaz »

DougNettleton

  • Jr. Member
  • **
  • Posts: 84
Re: Free Spider, a web development for Lazarus
« Reply #8 on: September 15, 2009, 05:18:48 pm »
I guess if you add a DataModule to any kind of a project, it should add the requirement for the LCL since the uses for the unit has among other things the following ...

FileUtil, Forms, Controls, Dialogs

i.e. parts of the LCL.

To add the requirement, open your package file, click "add" go to the tab "New Requirement", choose the package from the pull down list, click "Ok"

Doug

bubulemaster

  • New Member
  • *
  • Posts: 47
Re: Free Spider, a web development for Lazarus
« Reply #9 on: September 15, 2009, 05:20:14 pm »
It's very good component.

Just question, in example :
Code: [Select]
SpiderTable1.ColumnCount:= 3;
SpiderTable1.SetHeader(['ID', 'Name', 'Telephone Number']);
SpiderTable1.AddRow('', ['1', 'Mohammed', '01223311']);
SpiderTable1.AddRow('#FFEEDD', ['2', 'Ahmed', '01754341']);
SpiderTable1.AddRow('#FFDDEE', ['3', 'Omer', '045667890']);
Response.Add(SpiderTable1.Contents);

How can specify a CSS class of table, row or cell ? (same for SpiderForm)

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Free Spider, a web development for Lazarus
« Reply #10 on: September 15, 2009, 09:28:24 pm »
Doug, I've added the LCL in New Requirement, and it works, Home Page updated. Thanks

bubulemaster, can you give me an example of a table that have CSS, and I'll try to add it immediately if it is simple.
Actually I was very rarely used CSS.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Free Spider, a web development for Lazarus
« Reply #11 on: September 15, 2009, 09:38:24 pm »
Can't you create a datamodule without using the Forms, Controls, Dialogs units? Then you don't need to use the interfaces unit.

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Free Spider, a web development for Lazarus
« Reply #12 on: September 15, 2009, 09:52:17 pm »
How can I remove them?
Should I create a descendant component from TDataModule and make it as a plate for FreeSpider components?
In the future I may think to make it from Project/New Project/Free Spider Web, but I'm sure that it is not easy.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Free Spider, a web development for Lazarus
« Reply #13 on: September 15, 2009, 09:55:10 pm »
I would have to install your package to give you good advice. Maybe I have some time tomorrow.

bubulemaster

  • New Member
  • *
  • Posts: 47
Re: Free Spider, a web development for Lazarus
« Reply #14 on: September 16, 2009, 09:48:49 am »
An example of CSS :
Code: [Select]
SpiderTable1.cssClass = 'myCssClassForTable' ;
CSSHeaderTableClass (
    cssClass = 'myCssClassForHeader';
    array of CSSCellTableClass = CSSCellTableClass('Telephone Number');
)

CSSRowTableClass (
    cssClass = 'myCssClassForRow';
    array of CSSCellTableClass ;
)

CSSCellTableClass (
    cssClass = 'myCssClassForCell';
    text = '01754341';
)

generate :
Code: [Select]
<table class='myCssClassForTable'>
  <thead class='myCssClassForHeader'>
    <td>Telephone Number</td>
  </thead>
  <tr class='myCssClassForRow'>
    <td class='myCssClassForCell'>01754341</td>
  </tr>
</table>

 

TinyPortal © 2005-2018