This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.Cipher; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.apache.cayenne.conf.PasswordEncoding; | |
import sun.misc.BASE64Decoder; | |
import sun.misc.BASE64Encoder; | |
/** | |
* @author mrg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import org.apache.cayenne.CayenneDataObject; | |
import org.apache.cayenne.DataObjectUtils; | |
import org.apache.cayenne.DataRow; | |
import org.apache.cayenne.ObjectContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import javax.naming.Context; | |
import javax.naming.InitialContext; | |
import javax.naming.NamingException; | |
import your.test.TestModule; | |
import org.apache.cayenne.ObjectContext; | |
import org.apache.cayenne.access.DataContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This Tapestry 5.4 component allows you to use a standard HTML upload | |
input (<input type="file" ... /> -- as produced Tapestry's upload | |
component), but with a more modern-looking Bootstrap styling. | |
Screenshot: | |
https://raw.githubusercontent.com/mrg/mrg-sandbox/master/screenshots/BootstrapUpload.png | |
This component only includes the upload facility and the parent must | |
provide the HTML FORM to handle the upload. Currently does not support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A simple Tapestry 5.4 + Bootstrap Alert component to warn users they | |
shouldn't be using older versions of IE. | |
Note: This requires the UserAgent service: | |
https://gist.github.com/mrg/b814a42d86597440c9d9 | |
To use, simply include it in your page TML somewhere, perhaps in your | |
Layout component for best results: | |
<t:ieWarning/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a Tapestry 5 service to query a browser's User Agent. | |
Inject it into your page when you need to do browser-specific | |
customizations. Make it a property and you can query via TML. | |
Add to AppModule.java to make the service available: | |
public static void bind(ServiceBinder binder) | |
{ | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In your AppModule: | |
public static void bind(ServiceBinder binder) | |
{ | |
... | |
binder.bind(FormPreProcessorFilter.class, FormPreProcessorFilterImplementation.class); | |
... | |
} | |
/** |