// Path: src/main/java/com/trsvax/facebook/services/FBAsyncSupport.java
// public interface FBAsyncSupport {
// 	
// 	public void init(FBInit fbinit);
// 	public void init(String init);
// 	public void meta(Tags tags);
// 	public void subscribe(String event, ComponentResources resources);
// 	public void render();
// 	public void updateDocument(FacebookEnvironment facebookEnvironment, Document document);
// 
// }


import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.AfterRender;
import org.apache.tapestry5.annotations.BeginRender;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
import com.trsvax.facebook.services.FBAsyncSupport;

//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.

package com.trsvax.facebook.components;



/**
 * @author bfb
 * Facebook XFBML Like Box component
 * @see <a href="http://developers.facebook.com/docs/reference/plugins/like-box/">Like Box</a>
 *
 */
@SupportsInformalParameters
public class LikeBox {

	@Parameter(value = "literal:edge.create,edge.remove")
	private String events;
	
	@Environmental
	private FBAsyncSupport fbAsync;

	@Inject
	private ComponentResources resources;

	@BeginRender
	void beginRender(MarkupWriter writer) {
		fbAsync.render();
		writer.element("fb:like-box");
		resources.renderInformalParameters(writer);
// Path: src/main/java/com/trsvax/facebook/services/FBAsyncSupport.java
// public interface FBAsyncSupport {
// 	
// 	public void init(FBInit fbinit);
// 	public void init(String init);
// 	public void meta(Tags tags);
// 	public void subscribe(String event, ComponentResources resources);
// 	public void render();
// 	public void updateDocument(FacebookEnvironment facebookEnvironment, Document document);
// 
// }


// Path: src/main/java/com/trsvax/facebook/components/LikeBox.java
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.AfterRender;
import org.apache.tapestry5.annotations.BeginRender;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
import com.trsvax.facebook.services.FBAsyncSupport;


//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.

package com.trsvax.facebook.components;



/**
 * @author bfb
 * Facebook XFBML Like Box component
 * @see <a href="http://developers.facebook.com/docs/reference/plugins/like-box/">Like Box</a>
 *
 */
@SupportsInformalParameters
public class LikeBox {

	@Parameter(value = "literal:edge.create,edge.remove")
	private String events;
	
	@Environmental
	private FBAsyncSupport fbAsync;

	@Inject
	private ComponentResources resources;

	@BeginRender
	void beginRender(MarkupWriter writer) {
		fbAsync.render();
		writer.element("fb:like-box");
		resources.renderInformalParameters(writer);
		writer.end();