Then how to write an amazing Facebook extension for your java web-application and get more people to your 2.0 app? it's Simple, incapsulate Facebook Apps complexity in Zembly, then incapsulate Zembly complexity in ZCL, then use ZCL in your app!
But what's Zembly? Zembly is a wonderfull idea: an all-in-browser social development environment in wich you can create applications for social networks using a set of APIs, code-editors, and re-using and customizing community developed widgets (that's the magic: in Zembly open source is mandatory!!!)
Zembly features:
Bring your creativity, bring your skills, bring your friends
* Browser-based: Do everything in your browser. No downloads or installs. * Social programming: Create apps socially with other users, and reuse pieces and parts that they create. You choose the level of collaboration, from keeping everything private to making your app public and open source. We call it social programming. * Social networking: Connect with other zembly developers, watch their activity feeds, and send them messages. Be an expert, or get to know one, while working side-by-side with people in your social graph. * Templates: Community-provided templates let you create a useful application with a click. Even after you've created your application, it remains a template that you can easily customize with its graphical customization page. When you're ready, you can choose to customize every aspect of your application with zembly's IDE-class editor. * Cloning: Find an application or widget you like in zembly and clone it to make it your own, subject to the original author's permission of course. * IDE-class editor: When you want absolute control, use zembly's exclusive IDE-class editor to tweak any aspect of your app. Features like full syntax highlighting, error annotations, code completion, and automatic formatting and full language support for HTML, CSS, JavaScript, FBML, and FBJS give you all the power you need to make advanced changes your application. * Programming model: zembly makes consuming popular web APIs like Yahoo, Google, Flickr, Amazon, Twitter, YouTube, Dapper, and more trivially easy, with a single line of code. zembly's philosophy is that the web is your library. * BYOAPI: Have your own server or API? Describe it to zembly and then call it from your app. Or, publish your API to other zembly users and let them call it from their apps. zembly can make just about any RESTful API easy callable from your app with a single line of code. You can call APIs outside of zembly from your Java or JavaFx application. * Built-in hosting: Not only is zembly the fastest and easiest way to create your application, it's the fastest and easiest way to deploy it. Click the publish button and your app just runs. Best of all, zembly apps elastically scale on Sun's cloud infrastructure so you don't need to worry about creating or maxing our your own datacenter.
yes, you've read correct: Zembly is aslo a free hosting service for Facebook apps (and not only Facebook apps..)
Oh i'm loving my work, and i'm loving my Era: open source is the new kind of freedom!!!
But stop phyloshopying, let's get concrete:
here there are the Zembly-Facebook how-tos (videotutorials)
In PostgreSQL integer counters are more advanced than the MySQL auto_increments:
Them are sequences (like in Oracle) this mean that them can be used like "shared counters in the db" (very usefull in my opinion to implement a global object id between tables and can be usefull aslo in class table inheritance implementations)
This powerfull strument is a little boring to implement in Oracle:
you need to create the sequence:
create table mytable (id number,txt varchar(255));
create sequence mytable_seq
start with 1
increment by 1
nomaxvalue;
and to associate it to the column inserts with a trigger:
create trigger mytable_seq_trigger
before insert on test
for each row
begin
select mytable_seq.nextval into :new.id from dual;
end;
or instead of the trigger you can simply hardcode sequence next value call into insert statments:
insert into mytable values(mytable_seq.nextval, 'yes but who does
hardcoded inserts today?');
but i think the best way to do this in Oracle is the following:
create table mytable (id number default mytable_seq.nextval,
txt varchar(255));
in this way you emulate the mysql way, that's usefull too: infact in this way if you want, you can specify the id value in an insert query or get the magic just not providing any value for the id in the insert query.
this method is also the PostgreSQL's one, infact postgre combine the simplicty and comfort of MySQL auto_increments with the power of Oracle sequences:
how to declare auto_increment in postgre:
create table mytable (id serial, name chararter varying(255));
that's all!
but "serial" is just a shortcut-keyword: this is the real auto generated sql code :
CREATE SEQUENCE inscritto_column_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE inscritto_column_seq OWNER TO rdbapp;
and
ALTER TABLE mytable ALTER COLUMN id
SET DEFAULT nextval('mytable_column_seq'::regclass);
(i think in MySQL too happen a thing of this type, but the difference is that in PostgreSQL you can create and manage manually sequences like in Oracle, and take advantage of them power... for instance think at how easy and secure can be getting the last_insert_id of a table: select currval('ente_column_seq'::regclass); )
but attention, in Postgre you got an error when try to change an integer column to serial:
create table mytable (id integer, name chararter varying(255));
alter table mytable alter column id type serial;
(ERROR: Type serial does not exist)
this can be an issue?
uhm.. no! that's how to alter integer to sequences in postgre:
CREATE SEQUENCE mytable_id_seq
INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;
ALTER TABLE test_table ALTER COLUMN test_column
SET DEFAULT nextval('mytable_id_seq'::regclass);
final Store store = new SimpleStore(new String[]{"theme", "label"}, new Object[][]{ new Object[]{"themes/green/css/xtheme-green.css", "Green"}, new Object[]{"themes/slate/css/xtheme-slate.css", "Slate"}, new Object[]{"js/ext/resources/css/xtheme-gray.css", "Gray"}, new Object[]{"xtheme-default.css", "Aero Glass"}, new Object[]{"themes/indigo/css/xtheme-indigo.css", "Indigo"}, new Object[]{"themes/silverCherry/css/xtheme-silverCherry.css", "Silver Cherry"} });