Vous êtes sur la page 1sur 12

Astro-Online

Documentation
2001-2011 Astro Share BV, Netherlands

Author:
Peter Schulz
Version:
1.0
Datum versie: 2-3-2011

Astro Share BV, Netherlands

www.astro-share.com

Introduction
Astro-Online is an open source astrology program that offers widget-based horoscopes. Horoscope
widgets can be added to any HTML website by adding just a few lines of HTML and JavaScript code.
Astro-Online consists of several components, which can be installed all together on the same server or all
separately on different servers. This architecture also allows users to call widgets from the cloud, which
eliminates the need for any software installation at all. Usage of widgets can be established by the
injection of a combination of HTML and JavaScript code in a website or a personal page e.g. in a social
network.
Different Astro-Online components use different technologies. The component-based architecture
eliminates the need to understand all the different technologies used as it offers users the possibility to
install only the components that need to be customized to their specific requirements. Astro Share offers
consultancy services for those who need development assistance in some specific areas and lack the
knowledge needed for customization.
This document explains the Astro-Online architecture and the different installation and usage types. It
also offers information on using arguments in widgets and customizing widget layout and/or content. If
you need assistance, please contact Astro Share at www.astro-share.com. If you are missing some
functionality or want to make suggestions for improvements, we value your feedback!
A lot of work, time and energy were put into the development of this astrology software. Please respect
our license agreement, which can be found at the same location as this document. We hope youll enjoy
our software and hope to stay in touch.

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com

Table of Content
Introduction .................................................................................................................................................. 2
1. Architecture .......................................................................................................................................... 4
1.1 Front End ........................................................................................................................................ 5
1.1.1 Astro-Online RIA ...................................................................................................................... 5
1.1.2 Yahoo User Interface ............................................................................................................... 5
1.2 Back End ........................................................................................................................................ 6
1.2.1 Astro-Online DS ....................................................................................................................... 6
1.2.2 Astro-Online WS ...................................................................................................................... 6
1.3 Cloud Computing ............................................................................................................................ 7
2. Using Astro-Online from the cloud........................................................................................................ 9
2.1 Adding a widget to your web page ................................................................................................. 9
2.2 Influencing a widgets layout ........................................................................................................... 9
2.3 Adding or changing widget functionality ....................................................................................... 10
2.4 Debugging a widget ...................................................................................................................... 11
2.5 Putting it all together ..................................................................................................................... 11
3. Installing and using Astro-Online components ................................................................................... 12
3.1 Astro-Online RIA ........................................................................................................................... 12
3.2 Astro-Online DS ............................................................................................................................ 12
3.3 Astro-Online WS ........................................................................................................................... 12

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com

1. Architecture
Before downloading our software, please have a look at our architecture. The architecture of Astro-Online
allows you to download and install only those parts of the software that you will need to customize for
your own usage. Once youll understand the architecture of the software youll know which components to
download or you might find out that you do not need to download and install any software at all and
instead use Astro-Online from the cloud.

Website visitors connect to the astrology program through Astro-Online RIA (Rich Internet Application),
which can best be regarded as the front end of Astro-Online. In the middle of Astro-Online RIA you can
see the Yahoo User Interface (YUI). The YUI library is used to add controls and dynamic features to the
Astro-Online user interface. If you like to make changes to the user interface, some knowledge of YUI
might be helpful or even needed.
The front end communicates with the back end through AJAX technology. The back end consists of two
components: (1) Astro-Online DS (Data Service) offers horoscope interpretations in XML or JSON format
and (2) Astro-Online WS (Web Service) is responsible for astrological calculations. Data returned from
Astro-Online WS is also either given in XML or JSON format.
When a user fills out an entry form Astro-Online RIA sends a request to Astro-Online WS. Astro-Online
WS returns a response in JSON format that includes the results of the astrological calculation. Astro-

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com

Online RIA uses these results to (1) paint a chart (Flash application ActionScript3) and (2) send a
request to Astro-Online DS for horoscope interpretations. Astro-Online DS returns a response in JSON
format including the requested horoscope interpretations, which is processed by Astro-Online RIA and
shown to the user.

1.1

Front End

The front end consists of Astro-Online RIA, which includes the YUI library. Both are explained in more
detail in this section.

1.1.1 Astro-Online RIA


From a users perspective Astro-Online RIA is probably the most important and central component of the
software. This component is responsible for building the user interface and the interaction with the back
end. The main language is JavaScript but there is some PHP code for parameter handling as well.
1
Besides ActionScript3 code (Adobe Flash ) was used to create charts online.
Astro-Online RIA uses the YUI library to create interactive and dynamic horoscope widgets. Astro-Online
RIA does however not only use the YUI library, but relies on it. As a result Astro-Online RIA only works
properly if JavaScript is enabled. Browsers in which JavaScript is disabled will not be able to use AstroOnline RIA.
JavaScript MUST be enabled in order to use Astro-Online RIA!
Although Astro-Online RIA uses the YUI library, it is not necessary to have the YUI library installed on
your own server even if you use your own copy of Astro-Online RIA. The software downloads a copy of
2
the YUI library from the Google libraries server at runtime. While this decreases the workload on your
own server, the Google libraries server is generally a very fast server and additionally increases the
possibility that the library is already in cache.
You can add a widget to your web page by calling our installation of Astro-Online RIA or you can
download Astro-Online RIA from Source Forge and use your own installation. While your own installation
certainly offers more possibilities for customization, you can also use our installation and still make
changes to the layout of your horoscope widgets. To read more about this option please check out
chapter 2 Using Astro-Online from the cloud.
If you decide to download your own copy of Astro-Online RIA and make changes to the software, please
respect our license agreement. We also appreciate that you add a link to our website on yours. More
information about customizing Astro-Online RIA can be found in section 3.1 Astro-Online RIA.

1.1.2 Yahoo User Interface


The YUI Library is a set of utilities and controls, written with JavaScript and CSS, for building richly
interactive web applications using techniques such as DOM scripting, DHTML and AJAX. YUI is available
3
under a BSD license and is free for all uses .

See http://www.adobe.com/
See http://code.google.com/
3
See http://developer.yahoo.com/yui/
2

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com

The YUI library is used to create dynamic and interactive widgets. The layout of controls used within the
widgets is managed at runtime. With the YUI library widgets can be submitted without the need to
completely reload the page. This rich Internet functionality gives users of widgets the possibility to add
horoscope widgets to their pages with a minimum effort and without the need to bother about navigational
and work flow issues.
Astro Share does not make any changes to the YUI library. If you wish to use your own copy of the YUI
library you can safely download the library and call it directly from your Astro-Online RIA installation.

1.2

Back End

The back end consists of Astro-Online DS and Astro-Online WS. Both are explained in more detail in this
section.

1.2.1 Astro-Online DS
Astro-Online DS is a Data Service that selects a set of horoscope interpretations from the database
based on a set of parameters given on the URL. While Astro Share offers a data service which can be
used freely from the cloud, you can also download you own copy of the software and create your own
data service. Astro Shares implementation of Astro-Online DS uses PHP and MySQL.
4

To write your own data service youll need a web server that supports PHP and MySQL . Besides youll
need some knowledge of PHP and MySQL. If you decide to write your own implementation of AstroOnline DS, the simplest option is probably to start downloading this component, install it on your server
and add the interpretations to your database that you want to be displayed in your horoscope. Please
check out section 3.2 Astro-Online DS fort more information.
Although the most obvious solution is to install your own version of Astro-Online RIA and Astro-Online DS
that cooperate with each other, it is also possible to write your own implementation of Astro-Online DS
while still using Astro-Online RIA from the cloud. How this functionality can be achieved is described in
chapter 2 Using Astro-Online from the cloud.

1.2.2 Astro-Online WS
Astro-Online WS is the Web Service that is responsible for all the astrological calculations. Please keep
in mind that Astro-Online RIA gives a visitor the possibility to enter personal data, while Astro-Online WS
uses this data to perform astrological calculation. Once the calculations have been performed, AstroOnline RIA calls Astro-Online DS to retrieve the corresponding horoscope interpretations.
Astro-Online WS is the only component that uses two integrated external sources which are licensed.
5
First it uses the ACS Atlas . Please be aware that the atlas data is necessary for Astro-Online WS to
work properly. This data however is not part of the download package. You need to purchase the ACS
atlas from Alabe to get your own version of Astro-Online WS working. Since you can call our Astro-Online
WS installation from your own implementation however, you will be still able to use Astro-Online with all
available functionality.

It is also possible to write a data service in another language and use another DBMS (C#.NET with SQL
Server for example). However, in that case youll need to write the data service from scratch.
5
See http://www.alabe.com/AtlasLicenseMenu.html

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com
6

The second external component is the Swiss Ephemeris from the Astrodienst . Please be aware that you
are licensed to use the Swiss Ephemeris for non-commercial usage only. If you want to use this software
commercially, youll need to buy a license from the Astrodienst.

1.3

Cloud Computing

Cloud computing describes computation, software, data access, and storage services that do not require
end-user knowledge of the physical location and configuration of the system that delivers the services.
The key characteristic of cloud computing is that the computing is "in the cloud" i.e. the processing (and
the related data) is not in a specified, known or static place(s). This is in contrast to a model in which the
processing takes place in one or more specific servers that are known. Cloud architecture, the systems
architecture of the software systems involved in the delivery of cloud computing, typically involves
multiple cloud components communicating with each other over application programming interfaces,
usually web services and 3-tier architecture. The two most significant components of cloud computing
7
architecture are known as the front end and the back end.

In the picture above we can see how the four Astro-Online components interact with each other while all
components can either reside in one or in different locations. The different locations where components
reside may be unknown to a visitor.
6
7

See http://www.astro.com/swisseph/swephinfo_e.htm?lang=e
See http://en.wikipedia.org/wiki/Cloud_computing

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com

Below youll find a table which shows a number of possibilities to locate the different components. The
values in the different cells indicate the server on which a component might reside (e.g. Google means
the Google libraries server).

100% from cloud


Your server 1
Your server 2
Your server 3
Astrologer 1
Astrologer 2
Astrologer 3

Astro-Online RIA
Astro Share
Astro Share
Your server
Your server
Astro Share
Astrologers server
Your server

YUI Library
Google
Google
Google
Your server
Google
Google
Google

Astro-Online DS
Astro Share
Your server
Your server
Your server
Astrologers server
Astrologers server
Astrologers server

Astro-Online WS
Astro Share
Astro Share
Astro Share
Astro Share
Astro Share
Astro Share
Astro Share

As you can see there are many combinations possible. Basically you just need to call some Astro-Online
RIA installation, which in turn needs to know where to find the other components. For your visitors it
makes no difference where the components are located.

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com

2. Using Astro-Online from the cloud


Using Astro-Online from the cloud means that you offer your visitors horoscope widgets without installing
any Astro-Online components at all. This is the simplest way to use Astro-Online as it requires you to just
add a few lines of HTML and JavaScript code to your web page. Since no software installation is needed
Astro-Online widgets can be added to any HTML page, even to personal pages on social networks.
A number of horoscope widgets are available for those who prefer to use Astro-Online without software
installation. Please check our website at www.astro-share.com for available widgets and how to add them
to your own web page.

2.1

Adding a widget to your web page

In its simplest form adding a horoscope widget to your web page might look something like this:
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script src="http://www.astro-share.com/aowidgets.php?AO_Container=AO_ContainerNatal&AO_Id=natal&AO_Language=nl"
type="text/javascript"></script>
<div id='AO_ContainerNatal' name='AO_ContainerNatal' class='yui-skin-sam'></div>
NOTE Please be aware this is just an example. Check our website for the latest code snippets.
This example downloads the YUI library from the Google libraries server and calls Astro-Online RIA from
Astro Shares web server. The version of Astro-Online RIA installed on Astro Shares web server decides
from where to call Astro-Online DS and Astro-Online WS.
NOTE The locations from where to load Astro-Online DS and Astro-Online WS can be taken from the file
ao-widgets.php, vars: YAHOO.astroshare.astroonline.DS and YAHOO.astroshare.astroonline.WS
respectively.
If you download a script snippet to add a horoscope widget to your web page, a noscript tag will be added
as well. This noscript tag consist a message that will be shown only in case a visitors browser has
JavaScript disabled.

2.2

Influencing a widgets layout

The first way to influence a widgets layout is by adding a parameter to the URL. By default every widget
is shown at a default width for example. The default width differs from widget to widget. You might
however decide to define another width for a widget. Here is an example of code that sets the width of the
natal horoscope to 600px:
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script src="http://www.astro-share.com/aowidgets.php?AO_Container=AO_ContainerNatal&AO_Id=natal&AO_Language=nl&AO_ContainerWidth=
600" type="text/javascript"></script>
<div id='AO_ContainerNatal' name='AO_ContainerNatal' class='yui-skin-sam'></div>
NOTE Be aware that you always need to check the result if you change the layout of a widget. We
havent tested all the possible combinations.
The second way to influence a widgets layout offers far more possibilities. If you call Astro-Online from
the cloud, Astro-Online RIA loads a stylesheet by default that includes all the styles needed to manage

Astro-Online Documentation

Astro Share BV, Netherlands

www.astro-share.com

horoscope widgets. You can however create your own stylesheet and tell Astro-Online RIA to overwrite
the default. To do this you first need to write your own stylesheet and then add your stylesheet URL to
your widget call. Here is an example:
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
var AO_Css=[
"http://domain/path/stylesheet.css"
];
</script>
<script src="http://www.astro-share.com/aowidgets.php?AO_Container=AO_ContainerNatal&AO_Id=natal&AO_Language=nl"
type="text/javascript"></script>
<div id='AO_ContainerNatal' name='AO_ContainerNatal' class='yui-skin-sam'></div>
As you can see a stylesheet can be added to create a variable named AO_Css. Please be aware that this
variable name is case sensitive and must be define as an array. Since this variable is an array, you can
also use this variable to add more than one stylesheet.
NOTE Astro-Online uses its own set of stylesheet classes to prevent its stylesheet from overwriting
yours. To influence the layout of your widgets, please download a copy of our standard stylesheet
and modify it to your personal needs.

2.3

Adding or changing widget functionality

If you have a web site running on an ISPs server with PHP and MySQL services available, you can add
your own horoscope interpretations to Astro-Online widgets without the need to have the front end
installed on your server. This functionality is also available through a local JavaScript variable.
First you need to write your own Astro-Online Data Service. Section 3.2 Astro-Online DS describes how
to do this. Once you have your data service up and running your just need to add an extra parameter to
your call to Astro-Online RIA in the cloud and the widget will use your data service instead of the standard
data service as defined in the Astro-Online RIA installation you are calling. Here is an example:
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
var AO_MyDS="http://domain/path/ ";
</script>
<script src="http://www.astro-share.com/aowidgets.php?AO_Container=AO_ContainerNatal&AO_Id=natal&AO_Language=nl"
type="text/javascript"></script>
<div id='AO_ContainerNatal' name='AO_ContainerNatal' class='yui-skin-sam'></div>
If you are an astrologer this is a very powerful feature to offer your horoscope interpretations to web site
administrators without having to manage everything yourself. Web site administrators who like to add
your horoscope interpretations to their website can call Astro-Online RIA from the Astro Share server,
while adding the JavaScript variable AO_MyDS to the call that includes a URL to your data service.
Although the same functionality can easily be implemented for a call to a personal Astro-Online Web
Service installation, this functionality is not implemented. We think developers having their own AtroOnline WS installation will probably have installed all Astro-Online components. Should you however be
in need of such functionality, please contact us and we will gladly make the necessary changes to our
Astro-Online RIA installation.

10

Astro-Online Documentation

Astro Share BV, Netherlands

2.4

www.astro-share.com

Debugging a widget

Sometimes youll need to debug your widget changes. Debugging dynamic JavaScript application can
however be really hard. The best option is often to use a debugger like Firebug. Sometimes however you
also need to know whats happening during processing. Fortunately the YUI library contains a debugger,
which is can easily be called from Astro-Online RIA. You just need to turn the debugger on. Here is an
example how to turn the debugger on:
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
var AO_Debug=true;
</script>
<script src="http://www.astro-share.com/aowidgets.php?AO_Container=AO_ContainerNatal&AO_Id=natal&AO_Language=nl"
type="text/javascript"></script>
<div id='AO_ContainerNatal' name='AO_ContainerNatal' class='yui-skin-sam'></div>
Once you turn the debugger on, two buttons will appear on top of your widget. One button shows you the
current form values if you click on it. This functionality can be handy if you for example want to check
what values are currently stored in hidden fields. The other button shows you the YUI debugger panel. Be
aware that this panel only shows you message that have been added to your code. You will find that a
number of messages were already added to the widget code. If you need to debug a specific part of the
widget however, you can add your own messages to the widget code to get a better impression of whats
going on when you call your widget.

2.5

Putting it all together

Coming soon

Astro-Online Documentation

11

Astro Share BV, Netherlands

www.astro-share.com

3. Installing and using Astro-Online components


Coming soon

3.1

Astro-Online RIA

Coming soon

3.2

Astro-Online DS

Coming soon

3.3

Astro-Online WS

Coming soon

12

Astro-Online Documentation

Vous aimerez peut-être aussi