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
package cz.novoj.spring.security.aop; | |
import cz.novoj.spring.security.annotation.RulesRelation; | |
import cz.novoj.spring.security.annotation.RulesRelation.BooleanOperation; | |
import org.springframework.core.annotation.AnnotationUtils; | |
import org.springframework.security.access.ConfigAttribute; | |
import org.springframework.security.access.method.AbstractMethodSecurityMetadataSource; | |
import org.springframework.security.access.prepost.*; | |
import org.springframework.util.Assert; | |
import org.springframework.util.ClassUtils; |
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.Random; | |
public class MonteCarlo { | |
private enum Choice { | |
WINNING, LOSING | |
} | |
private static int ITERATIONS = 1000000; | |
private static final Random randomGenerator = new Random(); | |
private static GuessStrategy stayStrategy = new StayStrategy(); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<gui> | |
<staticPage id="mail" storagePath="file:/www/p_java/cps/libs_java/prj_edeecms/prj_mail/lib_mail/src/main/resources/META-INF/lib_mail/templates/"> <!-- todo ${moduleName}, v MailModule uz je to pripravene --> | |
<dictionary> | |
<dataProviders> | |
<campaignRecordSource class="com.fg.mail.web.ramjet.campaign.datasource.CampaignRecordSource"/> | |
<campaignByTitleRecordSource class="com.fg.mail.web.ramjet.campaign.datasource.AggregatedCampaignRecordSource"/> | |
<recipientAutocompletionDataProvider class="com.fg.mail.web.ramjet.campaign.datasource.RecipientAutocompletionDataProvider"/> | |
<channelItemProvider class="com.fg.mail.web.ramjet.campaign.datasource.ChannelItemsProvider"/> |
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
V commandu: | |
@Autowired private EdeeUiAsyncConversationManager conversationMgr; | |
public Resolution perform(..) { | |
conversationMgr.addConversation( | |
new UiConversation() extends Conversation implements ApplicationListener { | |
public void onEvent(Application event) { | |
if (event instanceof BatchStoredEvent) { |
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
@Test | |
public void shouldSubscribeAlreadyConfirmedRecipientByExternalApplication() throws Exception { | |
Recipient rcp = recipientListManager.createNewRecipient(); | |
rcp.setName("Uďo"); | |
rcp.setAddress(new EmailAddress("novotnaci+udo@gmail.com")); | |
recipientListManager.subscribeConfirmedRecipient(rcp); | |
Recipient createdRcpt = recipientListManager.getRecipientByAddress("novotnaci+udo@gmail.com"); | |
assertNotNull(createdRcpt); | |
assertEquals(RecipientState.Confirmed, createdRcpt.getState()); |
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
public class RunAsSupportTestExecutionListener extends AbstractTestExecutionListener { | |
private static final ThreadLocal<User> savedAuthentication = new ThreadLocal<User>(); | |
@Override | |
public void prepareTestInstance(TestContext testContext) throws Exception { | |
super.prepareTestInstance(testContext); | |
try { | |
testContext.getApplicationContext().getBean(CpsModuleSecuritySupport.class); | |
} catch (NoSuchBeanDefinitionException ignored) { | |
CpsModuleSupport moduleSupport = mock(CpsModuleSupport.class); |
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
public void render(RequestContext context, WidgetDefinition widgetDefinition, TemplateReference templateReference, ServletContext servletContext, HttpServletRequest request, HttpServletResponse response) throws TemplateNotFoundException, TemplateProcessingException { | |
try { | |
//we have to set encoding before writer is fetche | |
try { | |
response.setCharacterEncoding(configuration.getDefaultEncoding()); | |
} catch (NoSuchMethodError e) { | |
// servlet spec 2.3 | |
response.setContentType("text/html; encoding=" + configuration.getDefaultEncoding()); | |
} | |
PageDefinition pageDefinition = (PageDefinition) context.getRequestable(); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<dictionary> | |
<widgets> | |
<rowFluid extends="widgetContainer" template="inherit"> | |
<metadata> | |
<htmlClass>row-fluid</htmlClass> | |
</metadata> | |
</rowFluid> | |
<span1 extends="widgetContainer" template="inherit"> | |
<metadata> |
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
package net.sourceforge.stripes.controller; | |
import net.sourceforge.stripes.action.ActionBean; | |
import net.sourceforge.stripes.exception.StripesServletException; | |
import net.sourceforge.stripes.util.HttpUtil; | |
import net.sourceforge.stripes.util.Log; | |
import org.w3c.dom.Document; | |
import org.w3c.dom.Node; | |
import org.w3c.dom.NodeList; | |
import org.xml.sax.SAXException; |
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
package com.fg.doxx.gastro.web.user.validator; | |
import com.fg.doxx.gastro.business.GastroUserManager; | |
import com.fg.doxx.gastro.model.user.GastroUser; | |
import com.fg.form.core.context.RequestContext; | |
import com.fg.form.core.data.state.State; | |
import com.fg.form.core.lifecycle.validate.impl.AbstractSingleValueWidgetValidator; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.util.StringUtils; |
OlderNewer