Giter VIP home page Giter VIP logo

tapestry-facebook's Introduction

No Longer maintained moving to node/graphql/react

//Copyright [2011] [Barry Books]

// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.

This Tapestry component library implements the Facebook XFBML async javascript library. It will also write OpenGraph meta tags.

Currently to use the components you need to build the source then add the following to your pom file.

 <dependency>
	<groupId>com.trsvax</groupId>
	<artifactId>tapestry-facebook</artifactId>
	<version>0.0.1-SNAPSHOT</version>
</dependency>

To use the tags on a page you'll need at least the <t:fb.asyncInit t:id="fbinit"/> element in your page/layout file and something like the following in your java file.

@Property
private FBInit fbInit;

@SetupRender
void setupRender() {
	fbInit = new FBInit();
	fbInit.setAppID("your facebook app id");
	fbInit.setCookie(true);
	fbInit.setStatus(true);
}

Then

<t:fb.like />

which by default has the following events

void onEdgeCreate(@RequestParameter("url") String url) {
	logger.info("edge create {}",url);
}

void onEdgeRemove(@RequestParameter("url") String url) {
	logger.info("edge remove {}",url);
}

If you want OpenGraph tags

@Environmental private FBAsyncSupport fbAsyncSupport;

@SetupRender void setupRender() { Tags tags = new Tags(); tags.setSomeStuff(); fbAsyncSupport.setTags(tags); }

tapestry-facebook's People

Contributors

trsvax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tapestry-facebook's Issues

Events in 'Like'

I'd suggest Events default to null:

  1. when ur URL is 'URLRewrite', those events usually not correct.
  2. most of time user does not need those edgeCreate and remove.

actually it will be ok with current setup as long as we have a way to specify null, but can't find one.

License?

Don't know what the license is for this code.

Could you put the license block on the top of the code files.

After all GPL and Apache are both open source but big difference in license terms.

Components don't include tapestry.js

If you try to use onEdgeCreate as shown in the readme, it fails unless tapestry.js is being included by another component. Any component that can call onEdgeCreate should probably include tapestry.js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.