Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN
Dansk Dansk

Home: Slashdemocracy: WS4LSQL:
First release - get the review copy

 

 


gotze
Site administrator / Moderator

Apr 15, 2003, 3:19 AM

Post #1 of 11 (10117 views)
Shortcut
First release - get the review copy Can't Post

OK, guys, are you ready?

Attached is the first release of my plugin. I don't consider it anything near completion, but it gives you the basic functionality.

Install it at your own risk

After installation, you need a few manual edits here and there before it works.

You will need to manually edit the WSDL-file to fit your database columns. You should find it in your main /pages directory. The first thing to edit is the following:


Code
       <xsd:complexType name="LinkElement"> 
<xsd:all>
<xsd:element name="ID" type="xsd:int"/>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="URL" type="xsd:string"/>
<xsd:element name="Description" type="xsd:string"/>
<xsd:element name="LongDescription" type="xsd:string"/>
<xsd:element name="BifogadFil" type="xsd:base64Binary"/>
<xsd:element name="Location" type="xsd:string"/>
<xsd:element name="RSS_XML" type="xsd:string"/>
<xsd:element name="NIFid" type="xsd:int"/>
<xsd:element name="Contact_Name" type="xsd:string"/>
<xsd:element name="Contact_Email" type="xsd:string"/> </xsd:all>
</xsd:complexType>

As you see, I use a few custom elements here. You need to edit it and make it fit your database. Most elements would be strings, but you can also use base64Binary for binary files.

I guess one could make the installer a bit smarter here? Ideally, it would present a list of all elements and allow you to choose which you want to be included in the WSDL. Can anyone help with this?

OK. There are probably two or three other customisations you need to do, but I can't remember which ...

Good luck out there Wink

John
Attachments: WS4LSQL.tar (30.0 KB)


pugdog
New User

Apr 16, 2003, 8:52 PM

Post #2 of 11 (10113 views)
Shortcut
Re: [gotze] First release - get the review copy [In reply to] Can't Post

Before I go crazy, what are the things you know need work, tweaking or otherwise?

I have not thought about xml for awhile, so this sort of took me by suprise, and is a bit ahead of my planned development schedule.

But, having this sort of capability is important.


gotze
Site administrator / Moderator

Apr 17, 2003, 3:37 AM

Post #3 of 11 (10110 views)
Shortcut
Re: [pugdog] First release - get the review copy [In reply to] Can't Post

Well, basically, the plugin works and could be "wrapped up" as is. When I say it works, I mean the search facility works. Of course, one could imagine other web services, such as a submission service for adding links to the database. But that would be a whole new project, for the future. Let's get this one consolidated first.

For now, I see a few concrete tasks:
  • 1. Installation procedure (automatically create correct WSDL-file)
  • 2. Code review (quality of code; can it be more efficient/faster?)
  • 3. Writing documentation (would include introdution to web services, especially SOAP and WSDL)
  • 4. Creating clients (the basic client included is not very helpful, and more clients should be made. I have created a PHP client. Anyone using .Net or J2EE??)


1: Beyond my coding abilities. Is it possible? It occurs to me that it's a matter of a few lines of code in Install.pm, but I may well be wrong.

2: It's a bit sluggish, isn't it? A qualified code review would be nice, and improvements most welcome.

3: I'm working on this, but would appreciate any assistance here. I'm not a technical writer ...

4: I'll post something more on this in a new thread.


klauslovgreen
New User

Apr 19, 2003, 10:22 PM

Post #4 of 11 (10108 views)
Shortcut
Re: [gotze] First release - get the review copy [In reply to] Can't Post

Hi,

How would I go about including an image for each link - just embed the url or is there a smarter way?

Klaus


gotze
Site administrator / Moderator

Apr 20, 2003, 5:12 AM

Post #5 of 11 (10107 views)
Shortcut
Images [In reply to] Can't Post

Klaus,

I'm not really sure how it works, but SOAP is basically just an envelope, in which you can put all kinds of stuff.

Images should be marked as base64Binary in the WSDL-file. But I must admit I haven't tried it, and wouldn't off hand kn ow how to do clientside ...


pugdog
New User

Apr 28, 2003, 10:48 AM

Post #6 of 11 (10103 views)
Shortcut
Re: [gotze] First release - get the review copy [In reply to] Can't Post

Hi,

I'm pretty good at packaging plugins, and creating install routines (which is why I *HATE* plugins <G>) I get lost in the install routines.

What specifically do you need it to do?

"automatically create correct WSDL file"

Which file?


gotze
Site administrator / Moderator

Apr 28, 2003, 1:12 PM

Post #7 of 11 (10101 views)
Shortcut
Re: [pugdog] First release - get the review copy [In reply to] Can't Post

What I mean is that the generated WSDL-file has hard-coded references to names of fields in the LSQL database. It would be much better if it used the actual database table names.

Not knowing the plugin system very well, but trusting it to be as smart as LSQL in general is, I would imagine it being relative simple to have the plugin installer write correct names in the WSDL-file. If it's really intelligent, it would check the field type and use appropriate such in the WSDL schema too (I think only 'string' and 'base64Binary' (for binary files) are needed).

In the installer there is also asked a strange question about copying files. The developer had some reason, but I still think it's confusing ...


pugdog
New User

Apr 29, 2003, 2:25 PM

Post #8 of 11 (10098 views)
Shortcut
Re: [gotze] First release - get the review copy [In reply to] Can't Post

Hi,

How long are your session cookies set for?? I wrote a reply, got interupted by a customer, came back, and it ate it, and logged me out?

Not having to type it all again, you can use the plugin_cfg to store values, and use $plugin_cfg->{Field_1} to map to whatever name you entered in the configuration.


gotze
Site administrator / Moderator

Apr 29, 2003, 2:38 PM

Post #9 of 11 (10097 views)
Shortcut
Re: [pugdog] First release - get the review copy [In reply to] Can't Post

Cookie sessions were set to one hour; now, they're set to 24 hours. Don't know what went wrong

I'll have a look into the WSDL-generation procedure. Thanks for the help.


pugdog
New User

Apr 29, 2003, 2:46 PM

Post #10 of 11 (10096 views)
Shortcut
Re: [gotze] First release - get the review copy [In reply to] Can't Post

Hi,

If you point me to the part of the code you are talking about, I have the install/config routines already written for other programs. Just have to cut/paste them in.

Robert


gotze
Site administrator / Moderator

Apr 29, 2003, 3:13 PM

Post #11 of 11 (10095 views)
Shortcut
Re: [pugdog] First release - get the review copy [In reply to] Can't Post

Great, thanks. OK, let's see. The code I'm concerned with is the following, in the WSDL-file:


Code
       <xsd:complexType name="LinkElement"> 
<xsd:all>
<xsd:element name="ID" type="xsd:int"/>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="URL" type="xsd:string"/>
<xsd:element name="Description" type="xsd:string"/>
<xsd:element name="LongDescription" type="xsd:string"/>
<xsd:element name="BifogadFil" type="xsd:base64Binary"/>
<xsd:element name="Location" type="xsd:string"/>
<xsd:element name="RSS_XML" type="xsd:string"/>
<xsd:element name="NIFid" type="xsd:int"/>
<xsd:element name="Contact_Name" type="xsd:string"/>
<xsd:element name="Contact_Email" type="xsd:string"/>
</xsd:all>
</xsd:complexType>




The WSDL-file is written via Install.pm using the following code:


Code
  #copy file to build_root_path folder 
$file = $tar->get_file ('ws4lsql.wsdl');
$des="$CFG->{build_root_path}/ws4lsql.wsdl";
$body = $file->body_as_string();
$body =~ s/<%(.*)%>/$1?$CFG->{$1}:''/ge;
$file->body($body);
$file->name($des);
$file->write or return Plugins::WS4LSQL->error("Unable to extract file: '$des' ($GT::Tar::error)", 'WARN');
chmod(0666,"$des");



I just found out that the plugin package I uploaded has some more hard-coded stuff in the WSDL. It's way down at the bottom, where it should be:


Code
   

<!-- Endpoint for WS4lsql Web APIs -->
<service name="WS4lsqlService">
<port name="WS4lsqlPort" binding="typens:WS4lsqlBinding">
<soap:address location="<%db_cgi_url%>/ws4lsql.cgi"/>
</port>
</service>



John

 
 
 


Search for (options) Powered by Gossamer Forum v.1.2.4