Re: T5: How to remove default.css?not replace

2008-03-16 Thread jimlaren
I notice the TAPESTRY-2161 which is about this problem, Christian said 
"I would close this issue because you can override the default CSS with 
an empty one (which is in fact the same as disabling it).",but I try 
empty string and null both do not work,what is the meaning of empty one,

thanks!

jim
jimlaren wrote:

I would like to remove the default.css.I developed a site for i-mode
with chtml which have problem if there is a css file in the page.
any idea?

Thanks.

jim


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: How to remove default.css?not replace

2008-03-15 Thread jimlaren
I would like to remove the default.css.I developed a site for i-mode
with chtml which have problem if there is a css file in the page.
any idea?

Thanks.

jim


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: InjectPageLink and InjectExternalLink

2006-12-13 Thread jimlaren

done!

http://issues.apache.org/jira/browse/TAPESTRY-1184

>andyhot wrote:
> Looks interesting.
> Please add a JIRA and attach the files there.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



InjectPageLink and InjectExternalLink

2006-12-11 Thread jimlaren
As a return type of listener method,ILink can be used to perform a 
redirect-after-post.So it will be a great convenience to inject ILink 
using annotations.

@InjectPageLink("Home")
public abstract ILink getHomeLink();

@InjectExternalLink("ShowCategory")
public abstract ILink getCategoryLink(Long id);

public ILink goHome(){
   return getHomeLink();
}
public ILink showCategory(Long id){
return getCategoryLink(id);
}

The sources:

PageLink
@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface InjectPageLink {
String value();
}

public class InjectPageLinkAnnotationWorker implements
MethodAnnotationEnhancementWorker {

public void performEnhancement(EnhancementOperation op,
IComponentSpecification spec, Method method, Location 
location) {
if (!method.getReturnType().equals(ILink.class))
throw new ApplicationRuntimeException(
"InjectPageLink annotation must return 
ILink");

InjectPageLink injectPageLink = method
.getAnnotation(InjectPageLink.class);

String pageName = injectPageLink.value();

BodyBuilder builder = new BodyBuilder();

builder.begin();
builder
.addln(
		"return 
getPage().getRequestCycle().getInfrastructure().getServiceMap().getService(org.apache.tapestry.Tapestry.PAGE_SERVICE).getLink(false,\"{0}\");",

pageName);

builder.end();

op.addMethod(Modifier.PUBLIC, new MethodSignature(method), 
builder
.toString(), location);

if (isGetter(method))

op.claimReadonlyProperty(AnnotationUtils.getPropertyName(method));
}

boolean isGetter(Method method) {
return method.getName().startsWith("get")
&& method.getParameterTypes().length == 0;
}
}

ExternalLink

@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface InjectExternalLink {
String value();
}
public class InjectExternalLinkAnnotationWorker implements
MethodAnnotationEnhancementWorker {

public void performEnhancement(EnhancementOperation op,
IComponentSpecification spec, Method method, Location 
location) {
if (!method.getReturnType().equals(ILink.class))
throw new ApplicationRuntimeException(
"injectExternalLink annotation must return 
ILink");

InjectExternalLink injectExternalLink = method
.getAnnotation(InjectExternalLink.class);

String pageName = injectExternalLink.value();

BodyBuilder builder = new BodyBuilder();

builder.begin();

Class[] parameterTypes = method.getParameterTypes();
int paramCount = Tapestry.size(parameterTypes);

if (paramCount > 0) {
if (parameterTypes[0].isArray()) {
builder
.addln(
"return 
getPage().getRequestCycle().getInfrastructure().getServiceMap().getService(org.apache.tapestry.Tapestry.EXTERNAL_SERVICE).getLink(false, 
new org.apache.tapestry.engine.ExternalServiceParameter(\"{0}\",$1));",

pageName);
} else {
builder
.addln(
"java.lang.Object[] 
params = new java.lang.Object[{0}];",
paramCount);
for (int i = 0; i < paramCount; i++) {
builder.add("params[{0}] = ", i);
if (parameterTypes[i].isPrimitive())
builder.add("($w) ");
builder.addln("${0};", i + 1);
}
builder
.addln(
"return 
getPage().getRequestCycle().getInfrastructure().getServiceMap().getService(org.apache.tapestry.Tapestry.EXTERNAL_SERVICE).getLink(false, 
new org.apache.tapestry.engine.ExternalServiceParameter(\"{0}\",params));",

pageName);
}
}

builder.end();

op.addMethod(Modifier.PUBLIC, new MethodSignature(method), 
builder
 

Re: ILink return type for page listener.

2006-10-24 Thread jimlaren

Your page class define (Example YourBasePageClass):

@InjectObject("engine-service:external")
public abstract IEngineService getExternalService();

public ILink getExternalLink(String pageName, Object[] parameters) {
ExternalServiceParameter esp = new 
ExternalServiceParameter(pageName,
parameters);
return getExternalService().getLink(false, esp);
}

Your require parameters page class:

public abstract class YourPageClass extends BasePage implements
IExternalPage {
public abstract void setName(String name);
public void activateExternalPage(Object[] parameters, RequestCycle 
cycle) {
setName(parameters[0].toString()));
}

}

invoke:

public ILink yourListenerMethod(){
 return getExternalLink("YourPageClass","your name");
}


Leo Sakhvoruk wrote:
I'm trying to figure out how to use an ILink return type for a listener 
method in my page. I'm wanting to use it for the purpose of 
redirect-after-post in order so that the page the user is sent to 
displays the correct URL for it for page refreshes and user tracking 
statistics.


It seems ok for pages that don't require parameters but how would I 
construct an ILink for a page that renders data that is passed to it via 
parameters and such? The page service doesn't handle that so what 
service should I use when constructing a link or is there even a way to 
do that?


Thanks in advance.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]