rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
Dimension size = getSize();
final Dimension size = getSize();
public void paint( Graphics g ) { wasPainted = true; Dimension size = getSize(); g.setColor( getBackground() ); g.fillRect( 0, 0, size.width, size.height ); if( isEnabled() ) { switch( state ) { case STATE_BLANK: paintBlank( g )...
default: paintInvalid( g ); break;
public void paint( Graphics g ) { wasPainted = true; Dimension size = getSize(); g.setColor( getBackground() ); g.fillRect( 0, 0, size.width, size.height ); if( isEnabled() ) { switch( state ) { case STATE_BLANK: paintBlank( g )...
private void paintBlank( Graphics g ) {
private void paintBlank( final Graphics g ) {
private void paintBlank( Graphics g ) { drawText( g, "" ); }
private void paintImage( Graphics g ) {
private void paintImage( final Graphics g ) {
private void paintImage( Graphics g ) { g.drawImage( previewImage, 0, 0, null ); }
private void paintInvalid( Graphics g ) {
private void paintInvalid( final Graphics g ) {
private void paintInvalid( Graphics g ) { drawText( g, "Not a Photo." ); }
private void paintLoading( Graphics g ) {
private void paintLoading( final Graphics g ) {
private void paintLoading( Graphics g ) { drawText( g, "Loading Preview..." ); }
if( image != null ) { setImage( image ); } else {
if( image == null ) {
public void setImage( File file ) { this.imageFile = file; if( file == null ) { setImage( (BufferedImage)null ); } else { // If the image is in the cache, show it immediately: BufferedImage image = cache.getImage( file.getAbsolutePath() ); if( ...
else { setImage( image ); }
public void setImage( File file ) { this.imageFile = file; if( file == null ) { setImage( (BufferedImage)null ); } else { // If the image is in the cache, show it immediately: BufferedImage image = cache.getImage( file.getAbsolutePath() ); if( ...
public void setKeepLoading( boolean keepLoading ) {
public void setKeepLoading( final boolean keepLoading ) {
public void setKeepLoading( boolean keepLoading ) { this.keepLoading = keepLoading; }
String key = imageFile.getAbsolutePath(); BufferedImage cachedImage = cache.getImage( key );
final String key = imageFile.getAbsolutePath(); final BufferedImage cachedImage = cache.getImage( key );
private void startPreviewThread() { previewThreadAlive = true; new Thread() { public void run() { // Keep track of the file we just loaded to see if we // can rest or if we have to load another one. File justLoaded = null; ...
String key = imageFile.getAbsolutePath(); BufferedImage cachedImage = cache.getImage( key );
final String key = imageFile.getAbsolutePath(); final BufferedImage cachedImage = cache.getImage( key );
public void run() { // Keep track of the file we just loaded to see if we // can rest or if we have to load another one. File justLoaded = null; do { if( imageFile == justLoaded ) { try { ...
Thread suggestThread = new Thread() {
final Thread suggestThread = new Thread() {
public void suggestList( final File[] fileList ) { Thread suggestThread = new Thread() { public void run() { for( int i = 0; keepLoading && (i < fileList.length); i++ ) { if( cache.available() > 0 ) { try { loadAnd...
try { boolean doXMLRequest = DASCapabilities.checkCapable(new URL(dataSourceURL, "../"), DASCapabilities.CAPABILITY_EXTENDED, DASCapabilities.CAPABILITY_EXTENDED_FEATURES); ffetcher.setUseXMLFetch(doXMLRequest); } catch (MalformedURLException ex) { throw new BioException(ex); }
private FeatureFetcher makeFeatureFetcher(URL dataSourceURL, String triggerType, String triggerCategory) throws BioException { FeatureFetcher ffetcher = new FeatureFetcher(dataSourceURL, triggerType, triggerCategory);// try {// boolean doXMLRequest = DASCapabilities.checkCapable(new UR...
ps.close();
void runFetch() throws BioException, ParseException { DAS.startedActivity(this); try { String fetchEncoding = "dasgff"; if (DASCapabilities.checkCapable(new URL(dataSource, "../"), DASCapabilities.CAPABILITY_FEATURETABLE, DASCapabilities.CAPABILITY_FEATURETABLE_XFF)) { fetchEnco...
while (rs.next()) { recipients.add(rs.getString("user_email"));
String mail = null; while (rs.next()) { mail = rs.getString("user_email"); if(mail != null && !mail.trim().equals("") ) recipients.add(mail);
public List listRecipients() throws Exception { String query = SystemGlobals.getSql("SummaryDAO.selectAllRecipients"); PreparedStatement p = JForum.getConnection().prepareStatement(query); List recipients = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { recipients.add(rs.getSt...
public void forumTopics() throws Exception
public void forumTopics()
public void forumTopics() throws Exception { int forumId = this.request.getIntParameter("forum_id"); if (!TopicsCommon.isTopicAccessible(forumId)) { JForumExecutionContext.requestBasicAuthentication(); return; } List topics = TopicsCommon.topicsByForum(forumId, 0); Forum forum = ForumRepository.ge...
public void forums() throws Exception
public void forums()
public void forums() throws Exception { String title = I18n.getMessage("RSS.Forums.title"); String description = I18n.getMessage("RSS.Forums.description"); RSSAware rss = new ForumRSS(title, description, ForumCommon.getAllCategoriesAndForums(false)); this.context.put("rssContents", rss.createRSS()); }
public void list() throws Exception
public void list()
public void list() throws Exception { this.forums(); }
SimpleHash context) throws Exception
SimpleHash context)
public Template process(ActionServletRequest request, HttpServletResponse response, SimpleHash context) throws Exception { if (!SessionFacade.isLogged() && UserAction.hasBasicAuthentication(request)) { new UserAction().validateLogin(request); JForumExecutionContext.setRedirect(null)...
public void recentTopics() throws Exception
public void recentTopics()
public void recentTopics() throws Exception { String title = I18n.getMessage("RSS.RecentTopics.title", new Object[] { SystemGlobals.getValue(ConfigKeys.FORUM_NAME) }); String description = I18n.getMessage("RSS.RecentTopics.description"); RSSAware rss = new RecentTopicsRSS(title, description, new RecentTopicsA...
public void showPostsByUser() throws Exception
public void showPostsByUser()
public void showPostsByUser() throws Exception { int uid = this.request.getIntParameter("user_id"); UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(uid); if (u == null || u.getId() == 0) { return; } List topics = DataAccessDriver.getInstance().newPostDAO().selectByUserByL...
public void showTopicsByUser() throws Exception
public void showTopicsByUser()
public void showTopicsByUser() throws Exception { int uid = this.request.getIntParameter("user_id"); UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(uid); if (u == null || u.getId() == 0) { return; } List topics = DataAccessDriver.getInstance().newTopicDAO().selectByUserB...
public void topicPosts() throws Exception
public void topicPosts()
public void topicPosts() throws Exception { int topicId = this.request.getIntParameter("topic_id"); PostDAO pm = DataAccessDriver.getInstance().newPostDAO(); TopicDAO tm = DataAccessDriver.getInstance().newTopicDAO(); Topic topic = tm.selectById(topicId); if (!TopicsCommon.isTopicAccessible(topic.getForumId()...
public static void requestBasicAuthentication() throws IOException {
public static void requestBasicAuthentication() {
public static void requestBasicAuthentication() throws IOException { getResponse().addHeader("WWW-Authenticate", "Basic realm=\"JForum\""); getResponse().sendError(HttpServletResponse.SC_UNAUTHORIZED); enableCustomContent(true); }
getResponse().sendError(HttpServletResponse.SC_UNAUTHORIZED);
try { getResponse().sendError(HttpServletResponse.SC_UNAUTHORIZED); } catch (IOException e) { String es = "Erorr add()"; logger.error(es, e); throw new RuntimeException(es, e); }
public static void requestBasicAuthentication() throws IOException { getResponse().addHeader("WWW-Authenticate", "Basic realm=\"JForum\""); getResponse().sendError(HttpServletResponse.SC_UNAUTHORIZED); enableCustomContent(true); }
if (getStaticArguments().size() == 1) { setStaticArguments(Collections.EMPTY_MAP); }
public Object function(VariableStack stack) throws ExecutionException { if (name == null) { name = TypeUtil.toString(A_NAME.getStatic(this)).toLowerCase(); } if (stack.parentFrame().isDefined("#quoted")) { Object value = new Identifier(name); setValue(value); setSimple(true); return value; } else { re...
throws Exception
public List loadConfigurations(String xmlFile) throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); SAXParser parser = factory.newSAXParser(); File fileInput = new File(xmlFile); if (fileInput.exists()) { parser.parse(fileInput, this); } else { In...
SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); SAXParser parser = factory.newSAXParser(); File fileInput = new File(xmlFile); if (fileInput.exists()) { parser.parse(fileInput, this); } else { InputSource inputSource = new InputSource(xmlFile); parser.parse(inputSource, this);...
try { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); SAXParser parser = factory.newSAXParser(); File fileInput = new File(xmlFile); if (fileInput.exists()) { parser.parse(fileInput, this); } else { InputSource inputSource = new InputSource(xmlFile); parser.parse(inputSource, ...
public List loadConfigurations(String xmlFile) throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); SAXParser parser = factory.newSAXParser(); File fileInput = new File(xmlFile); if (fileInput.exists()) { parser.parse(fileInput, this); } else { In...
ResultSet rs = null; PreparedStatement p = null;
public void startElement( String namespaceURI, String localName, String tag, Attributes atts) throws SAXException { if (tag.equals("section")) { this.section = new PermissionSection(atts.getValue("title"), atts.getValue("id")); } else if (tag.equals("permission")) { this.permissionName = atts.getValue("ti...
throw new XMLException(e);
String es = "Erorr startElement()"; log.error(es, e); throw new RuntimeException(es, e);
public void startElement( String namespaceURI, String localName, String tag, Attributes atts) throws SAXException { if (tag.equals("section")) { this.section = new PermissionSection(atts.getValue("title"), atts.getValue("id")); } else if (tag.equals("permission")) { this.permissionName = atts.getValue("ti...
try { if (rs != null) { rs.close(); p.close(); } } catch (Exception e) { throw new XMLException(e); }
DbUtils.close(rs, p);
public void startElement( String namespaceURI, String localName, String tag, Attributes atts) throws SAXException { if (tag.equals("section")) { this.section = new PermissionSection(atts.getValue("title"), atts.getValue("id")); } else if (tag.equals("permission")) { this.permissionName = atts.getValue("ti...
DOMParser parser = new DOMParser(); parser.parse(is); Document doc = parser.getDocument();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(false); DocumentBuilder parser = dbf.newDocumentBuilder(); Document doc = parser.parse(is);
public static void main(String[] args) { try { if (args.length != 1) { throw new RuntimeException("Usage: java eponine.AppBeanRunner app.xml"); } String name = args[0]; String[] altArgs = new String[args.length - 1]; for (int i = 1; i < args.length; ++i) altArgs[i-1] = args[i]; InputS...
this.changeState(STARTUP);
public void parse(InputSource poSource ) throws IOException, SAXException { BufferedReader oContents; String oLine; //Use method form superclass oContents = this.getContentStream(poSource); //This sets contentHandler document for XSLT this.getContentHandler().star...
throw new NestedError( e, "Can't create symbols to represent dice rolls"
throw new AssertionFailure( "Can't create symbols to represent dice rolls", e
public static MarkovModel createCasino() { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { try { rolls[i-1]= AlphabetManager.createSymbol((char)('0'+i),""+i,Annotation.EMP...
throw new NestedError(e, "Can't create distributions");
throw new AssertionFailure("Can't create distributions", e);
public static MarkovModel createCasino() { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { try { rolls[i-1]= AlphabetManager.createSymbol((char)('0'+i),""+i,Annotation.EMP...
throw new NestedError(e, "Can't add states to model");
throw new AssertionFailure("Can't add states to model", e);
public static MarkovModel createCasino() { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { try { rolls[i-1]= AlphabetManager.createSymbol((char)('0'+i),""+i,Annotation.EMP...
throw new NestedError(e, "Can't create transitions");
throw new AssertionFailure("Can't create transitions", e);
public static MarkovModel createCasino() { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { try { rolls[i-1]= AlphabetManager.createSymbol((char)('0'+i),""+i,Annotation.EMP...
throw new NestedError(e, "Can't set emission probabilities");
throw new AssertionFailure("Can't set emission probabilities", e);
public static MarkovModel createCasino() { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { try { rolls[i-1]= AlphabetManager.createSymbol((char)('0'+i),""+i,Annotation.EMP...
throw new NestedError(e, "Can't set transition probabilities");
throw new AssertionFailure("Can't set transition probabilities", e);
public static MarkovModel createCasino() { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { try { rolls[i-1]= AlphabetManager.createSymbol((char)('0'+i),""+i,Annotation.EMP...
Distribution oldDist = model.getWeights(oldState); try { symScore += oldDist.getWeight(oldState); } catch (IllegalSymbolException ite) { throw new BioError(ite, "Transition returned from sampleTransition is invalid"); }
symScore += model.getWeights(model.magicalState()).getWeight(oldState);
public StatePath generate(int length) throws IllegalSymbolException, BioException { List tokenList = new ArrayList(); List stateList = new ArrayList(); List scoreList = new ArrayList(); double totScore = 0.0; double symScore = 0.0; int i = length; State oldState; Symbol token; oldState = (...
public ArrayList getGroups (String type);
public List getGroups (String type);
public ArrayList getGroups (String type);
case ACC_MIXIN_INTERFACE: return "mixinifc"; case ACC_MIXIN: return "mixin";
public static String getName(int mod) { switch (mod) { case ACC_PUBLIC : return "public"; case ACC_PRIVATE : return "private"; case ACC_PROTECTED : return "protected"; case ACC_STATIC : return "static"; ...
if (command.offset == partition.getOffset()) {
if (command.offset == partition.getOffset() && document.getChar(command.offset) != ';') {
public void customizeDocumentCommand(IDocument document, DocumentCommand command) { if (command.text.length() != 0) return; if (command.length != 1) return; try { ITypedRegion partition = document.getPartition(command.offset); if (partition.getType() ...
"\" alt=\""+resOutput.getString("CLICK_ZOOM")+"\">" +
"\" alt=\""+resOutput.getString("CLICK_ZOOM")+"\"/>" +
private String generateDetailPage( int index, int indexPageNum ) throws IOException { ArrayList photos = publishManager.getPhotoSource().getSelectedPhotos(); int numPhotos = photos.size(); OutputPhoto outPhoto = (OutputPhoto)photos.get( index ); String imageFilename = outPhoto....
"<img src=\"resized-" + outImageFilename + "\">" );
"<img src=\"resized-" + outImageFilename + "\"/>" );
private String generateDetailPage( int index, int indexPageNum ) throws IOException { ArrayList photos = publishManager.getPhotoSource().getSelectedPhotos(); int numPhotos = photos.size(); OutputPhoto outPhoto = (OutputPhoto)photos.get( index ); String imageFilename = outPhoto....
out.print( "<img src=\"" + outImageFilename + "\">" );
out.print( "<img src=\"" + outImageFilename + "\"/>" );
private String generateDetailPage( int index, int indexPageNum ) throws IOException { ArrayList photos = publishManager.getPhotoSource().getSelectedPhotos(); int numPhotos = photos.size(); OutputPhoto outPhoto = (OutputPhoto)photos.get( index ); String imageFilename = outPhoto....
"\">"+Constants.APP_NAME+"</a>" +
"/>"+Constants.APP_NAME+"</a>" +
private String generateDetailPage( int index, int indexPageNum ) throws IOException { ArrayList photos = publishManager.getPhotoSource().getSelectedPhotos(); int numPhotos = photos.size(); OutputPhoto outPhoto = (OutputPhoto)photos.get( index ); String imageFilename = outPhoto....
"\"></a>\n" +
"\"/></a>\n" +
public void generateThumbnailPage( int index, int perPage, int numPages ) throws IOException { ArrayList photos = publishManager.getPhotoSource().getSelectedPhotos(); int numPhotos = photos.size(); int beginIndex = index * perPage; int endIndex = (index + 1) * perPage -...
"\">"+Constants.APP_NAME+"</a>" +
"/>"+Constants.APP_NAME+"</a>" +
private void printFooter ( PrintWriter out, String todaysDate ) {// out.print( // " </table>\n" +// " </div>\n" +// " <hr align=\"Left\" width=\"100%\" size=\"2\" noshade>\n" +// " <i>"+resOutput.getString("PUBLISHED")+": " + todaysD...
printFooter( out, todaysDate );
printDetailFooter( out );
public void generateDescriptionPage() throws IOException { if (publishManager.getAlbumDescription().length() > 0) { SimpleDateFormat sdf = new SimpleDateFormat( resOutput.getString("DATE_FORMAT") ); String todaysDate = sdf.format( new Date() ); String indexFile...
" <div align=\"right\"><small><i>"+resOutput.getString("GENERATED_BY")+"</i><br/>\n" + " <a href=\""+Constants.SITE_URL+"\"" + "/>"+Constants.APP_NAME+"</a>" + "</small></div>\n" +
private String generateDetailPage( int index, int indexPageNum ) throws IOException { ArrayList photos = publishManager.getPhotoSource().getSelectedPhotos(); int numPhotos = photos.size(); OutputPhoto outPhoto = (OutputPhoto)photos.get( index ); String imageFilename = outPhoto.getFile...
printFooter( out, todaysDate );
printThumbnailFooter( out, todaysDate );
public void generateThumbnailPage( int index, int perPage, int numPages ) throws IOException { ArrayList photos = publishManager.getPhotoSource().getSelectedPhotos(); int numPhotos = photos.size(); int beginIndex = index * perPage; int endIndex = (index + 1) * perPage - 1; ...
public void insert() throws Exception
public void insert()
public void insert() throws Exception { if (!SecurityRepository.canAccess(SecurityConstants.PERM_KARMA_ENABLED)) { this.error("Karma.featureDisabled", null); return; } int postId = this.request.getIntParameter("post_id"); int fromUserId = SessionFacade.getUserSession().getUserId(); PostDAO pm = DataAccessDriv...
public void list() throws Exception
public void list()
public void list() throws Exception { this.setTemplateName(TemplateKeys.KARMA_LIST); this.context.put("message", I18n.getMessage("invalidAction")); }
public boolean userCanAddKarma(int userId, int postId) throws Exception;
public boolean userCanAddKarma(int userId, int postId) ;
public boolean userCanAddKarma(int userId, int postId) throws Exception;
public void addKarma(Karma karma) throws Exception;
public void addKarma(Karma karma) ;
public void addKarma(Karma karma) throws Exception;
public User validateLogin(String username, String password, Map extraParams) throws Exception
public User validateLogin(String username, String password, Map extraParams)
public User validateLogin(String username, String password, Map extraParams) throws Exception { Hashtable environment = this.prepareEnvironment(); StringBuffer principal = new StringBuffer(256) .append(SystemGlobals.getValue(ConfigKeys.LDAP_LOGIN_PREFIX)) .append(username) .append(',') .append(SystemGlobal...
finally {
catch (NamingException e) { return null; } finally {
public User validateLogin(String username, String password, Map extraParams) throws Exception { Hashtable environment = this.prepareEnvironment(); StringBuffer principal = new StringBuffer(256) .append(SystemGlobals.getValue(ConfigKeys.LDAP_LOGIN_PREFIX)) .append(username) .append(',') .append(SystemGlobal...
dir.close(); }
try { dir.close(); } catch (NamingException e) { } }
public User validateLogin(String username, String password, Map extraParams) throws Exception { Hashtable environment = this.prepareEnvironment(); StringBuffer principal = new StringBuffer(256) .append(SystemGlobals.getValue(ConfigKeys.LDAP_LOGIN_PREFIX)) .append(username) .append(',') .append(SystemGlobal...
this.login();
int start = this.preparePagination(DataAccessDriver.getInstance().newUserModel().getTotalUsers()); int usersPerPage = SystemGlobals.getIntValue(ConfigKeys.USERS_PER_PAGE); this.context.put("users", DataAccessDriver.getInstance().newUserModel().selectAll(start ,usersPerPage)); this.context.put("moduleAction", "user_lis...
public void list() throws Exception { this.login(); }
protected String getPostTextFromResultSet(ResultSet rs) throws Exception {
protected String getPostTextFromResultSet(ResultSet rs) throws SQLException {
protected String getPostTextFromResultSet(ResultSet rs) throws Exception { return OracleUtils.readBlobUTF16BinaryStream(rs, "post_text"); }
public List getPosts(int start, int count, int minPostId, int maxPostId, Connection conn) throws Exception
public List getPosts(int start, int count, int minPostId, int maxPostId, Connection conn)
public List getPosts(int start, int count, int minPostId, int maxPostId, Connection conn) throws Exception { return super.getPosts(start, start + count, minPostId, maxPostId, conn); }
if (ex.getStack() != null) { failImmediately(ex.getStack(), ex);
if (ex.getStack() == null) { ex.setStack(e.getStack());
public void event(final Event e) throws ExecutionException { try { final EventClass cls = e.getEventClass(); if (EventClass.CONTROL_EVENT.equals(cls)) { controlEvent((ControlEvent) e); } else if (EventClass.NOTIFICATION_EVENT.equals(cls)) { notificationEvent((NotificationEvent) e); } else if (EventC...
else { failImmediately(e.getStack(), ex); }
failImmediately(e.getStack(), ex);
public void event(final Event e) throws ExecutionException { try { final EventClass cls = e.getEventClass(); if (EventClass.CONTROL_EVENT.equals(cls)) { controlEvent((ControlEvent) e); } else if (EventClass.NOTIFICATION_EVENT.equals(cls)) { notificationEvent((NotificationEvent) e); } else if (EventC...
throw new ExecutionException(stack, message, cause);
throw new ExecutionException(stack.copy(), message, cause);
public void fail(VariableStack stack, String message, Throwable cause) throws ExecutionException { checkCompleted(stack); throw new ExecutionException(stack, message, cause); }
throw new ExecutionException(stack, message);
throw new ExecutionException(stack.copy(), message);
public void failIfNotDefined(VariableStack stack, String var, String message) throws ExecutionException { if (!stack.isDefined(var)) { throw new ExecutionException(stack, message); } }
throw new ExecutionException(stack, "Required property not present: " + name);
throw new ExecutionException(stack.copy(), "Required property not present: " + name);
public void failIfNull(VariableStack stack, String name) throws ExecutionException { if (failIfNull(name)) { throw new ExecutionException(stack, "Required property not present: " + name); } }
public Object getProperty(final String name) { return properties.get(name.toLowerCase());
public Object getProperty(String name) { name = name.toLowerCase(); if (name.equals(UID)) { return uid; } else { return properties.get(name.toLowerCase()); }
public Object getProperty(final String name) { return properties.get(name.toLowerCase()); }
this.properties = properties;
uid = (Integer) properties.remove(UID); if (properties.size() == 0) { return; } else { this.properties = properties; }
public void setProperties(Map properties) { this.properties = properties; }
if (name.equals(UID)) { uid = (Integer) value; return; }
public void setProperty(final String name, final Object value) { if (properties.isEmpty()) { properties = new HashMap(); } properties.put(name.toLowerCase(), value); }
public FailureNotificationEvent(FlowElement source, VariableStack stack, String message, Throwable exception) { this(source, stack, stack != null ? stack.copy() : null, message, exception);
public FailureNotificationEvent(FlowElement source, VariableStack stack, VariableStack initialStack, String message, Throwable exception) { super(source, NotificationEventType.EXECUTION_FAILED, stack); this.initialStack = initialStack; if (exception instanceof NullPointerException) { this.message = "NullPointerExceptio...
public FailureNotificationEvent(FlowElement source, VariableStack stack, String message, Throwable exception) { this(source, stack, stack != null ? stack.copy() : null, message, exception); }
setFault(e);
recordFault(e);
public void execute() { assertNotCompleted(); try { getProvider().deleteConnectionFactory(getName()); } catch (RuntimeException e) { setFault(e); } completed(); }
private void commonData() throws Exception
private void commonData()
private void commonData() throws Exception { this.context.put("selectedList", new ArrayList()); this.context.put("groups", new TreeGroup().getNodes()); this.setTemplateName(TemplateKeys.USER_ADMIN_COMMON); this.context.put("searchAction", "list"); this.context.put("searchId", new Integer(-1)); }
public void delete() throws Exception
public void delete()
public void delete() throws Exception { String ids[] = this.request.getParameterValues("user_id"); UserDAO um = DataAccessDriver.getInstance().newUserDAO(); if (ids != null) { for (int i = 0; i < ids.length; i++) { int user = Integer.parseInt(ids[i]); if (um.isDeleted(user)){ um.undelete(user)...
public void edit() throws Exception
public void edit()
public void edit() throws Exception { int userId = this.request.getIntParameter("id"); UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(userId); this.context.put("u", u); this.context.put("action", "editSave"); this.setTemplateName(TemplateKeys.USER_ADMIN_EDIT); this.context...
public void editSave() throws Exception
public void editSave()
public void editSave() throws Exception { int userId = this.request.getIntParameter("user_id"); UserCommon.saveUser(userId); this.list(); }
public void groupSearch() throws Exception
public void groupSearch()
public void groupSearch() throws Exception { final int groupId = this.request.getIntParameter("group_id"); if (groupId == 0) { this.list(); return; } UserDAO um = DataAccessDriver.getInstance().newUserDAO(); int start = this.preparePagination(um.getTotalUsersByGroup(groupId)); int usersPerPage = SystemGl...
public void groups() throws Exception
public void groups()
public void groups() throws Exception { int userId = this.request.getIntParameter("id"); UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(userId); List selectedList = new ArrayList(); for (Iterator iter = u.getGroupsList().iterator(); iter.hasNext(); ) { selectedList.add(new ...
public void groupsSave() throws Exception
public void groupsSave()
public void groupsSave() throws Exception { int userId = this.request.getIntParameter("user_id"); UserDAO um = DataAccessDriver.getInstance().newUserDAO(); GroupDAO gm = DataAccessDriver.getInstance().newGroupDAO(); // Remove the old groups List allGroupsList = gm.selectAll(); int[] allGroups = new int[allGr...
public void list() throws Exception
public void list()
public void list() throws Exception { int start = this.preparePagination(DataAccessDriver.getInstance().newUserDAO().getTotalUsers()); int usersPerPage = SystemGlobals.getIntValue(ConfigKeys.USERS_PER_PAGE); this.context.put("users", DataAccessDriver.getInstance().newUserDAO().selectAll(start ,usersPerPage)); th...
public void search() throws Exception
public void search()
public void search() throws Exception { List users = new ArrayList(); String search = this.request.getParameter("username"); String group = this.request.getParameter("group"); if (search != null && !"".equals(search)) { users = DataAccessDriver.getInstance().newUserDAO().findByName(search, false); this.co...
List users = new ArrayList();
public void search() throws Exception { List users = new ArrayList(); String search = this.request.getParameter("username"); String group = this.request.getParameter("group"); if (search != null && !"".equals(search)) { users = DataAccessDriver.getInstance().newUserDAO().findByName(search, false); this.co...
return;
public void search() throws Exception { List users = new ArrayList(); String search = this.request.getParameter("username"); String group = this.request.getParameter("group"); if (search != null && !"".equals(search)) { users = DataAccessDriver.getInstance().newUserDAO().findByName(search, false); this.co...
public int addNew(Category category) throws Exception
public int addNew(Category category)
public int addNew(Category category) throws Exception { int order = 1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.getMaxOrder")); ResultSet rs = p.executeQuery(); if (rs.next()) { order = rs.getInt(1) + 1; } rs.close(); p.close(); p = ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.getMaxOrder")); ResultSet rs = p.executeQuery(); if (rs.next()) { order = rs.getInt(1) + 1; } rs.close(); p.close();
ResultSet rs=null; PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.getMaxOrder")); rs = p.executeQuery(); if (rs.next()) { order = rs.getInt(1) + 1; } rs.close(); rs=null; p.close(); p=null;
public int addNew(Category category) throws Exception { int order = 1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.getMaxOrder")); ResultSet rs = p.executeQuery(); if (rs.next()) { order = rs.getInt(1) + 1; } rs.close(); p.close(); p = ...
p = this.getStatementForAutoKeys("CategoryModel.addNew"); p.setString(1, category.getName()); p.setInt(2, order); p.setInt(3, category.isModerated() ? 1 : 0); this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("CategoryModel.lastGeneratedCategoryId")); int id = this.executeAutoKeysQuery(p); p.close(); category.setI...
p = this.getStatementForAutoKeys("CategoryModel.addNew"); p.setString(1, category.getName()); p.setInt(2, order); p.setInt(3, category.isModerated() ? 1 : 0); this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("CategoryModel.lastGeneratedCategoryId")); int id = this.executeAutoKeysQuery(p); category.setId(id); categ...
public int addNew(Category category) throws Exception { int order = 1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.getMaxOrder")); ResultSet rs = p.executeQuery(); if (rs.next()) { order = rs.getInt(1) + 1; } rs.close(); p.close(); p = ...
public boolean canDelete(int categoryId) throws Exception
public boolean canDelete(int categoryId)
public boolean canDelete(int categoryId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.canDelete")); p.setInt(1, categoryId); ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { return true; } ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.canDelete")); p.setInt(1, categoryId); ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { return true; } rs.close(); p.close(); return false; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.canDelete")); p.setInt(1, categoryId); rs = p.executeQuery(); return !rs.next() || rs.getInt("total") < 1; } catch (SQLException e) { String es = "Erorr canDelete()"; log....
public boolean canDelete(int categoryId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.canDelete")); p.setInt(1, categoryId); ResultSet rs = p.executeQuery(); if (!rs.next() || rs.getInt("total") < 1) { return true; } ...
public void delete(int categoryId) throws Exception
public void delete(int categoryId)
public void delete(int categoryId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.delete")); p.setInt(1, categoryId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.delete")); p.setInt(1, categoryId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.delete")); p.setInt(1, categoryId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr delete()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p...
public void delete(int categoryId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.delete")); p.setInt(1, categoryId); p.executeUpdate(); p.close(); }
protected Category getCategory(ResultSet rs) throws Exception
protected Category getCategory(ResultSet rs) throws SQLException
protected Category getCategory(ResultSet rs) throws Exception { Category c = new Category(); c.setId(rs.getInt("categories_id")); c.setName(rs.getString("title")); c.setOrder(rs.getInt("display_order")); c.setModerated(rs.getInt("moderated") == 1); return c; }
public List selectAll() throws Exception
public List selectAll()
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getCategory(rs)); } rs.close(); p.close(...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getCategory(rs)); } rs.close(); p.close(); return l; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectAll")); List l = new ArrayList(); rs = p.executeQuery(); while (rs.next()) { l.add(this.getCategory(rs)); } return l; } catch (SQLException e) { String es = "Erorr se...
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.getCategory(rs)); } rs.close(); p.close(...
public Category selectById(int categoryId) throws Exception
public Category selectById(int categoryId)
public Category selectById(int categoryId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectById")); p.setInt(1, categoryId); ResultSet rs = p.executeQuery(); Category c = new Category(); if (rs.next()) { c = this.get...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectById")); p.setInt(1, categoryId); ResultSet rs = p.executeQuery(); Category c = new Category(); if (rs.next()) { c = this.getCategory(rs); } rs.close(); p.close(); return c; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectById")); p.setInt(1, categoryId); rs = p.executeQuery(); Category c = new Category(); if (rs.next()) { c = this.getCategory(rs); } return c; } catch (SQLException e...
public Category selectById(int categoryId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.selectById")); p.setInt(1, categoryId); ResultSet rs = p.executeQuery(); Category c = new Category(); if (rs.next()) { c = this.get...
private void setOrder(Category category, Category otherCategory, boolean up) throws Exception
private void setOrder(Category category, Category otherCategory, boolean up)
private void setOrder(Category category, Category otherCategory, boolean up) throws Exception { int tmpOrder = otherCategory.getOrder(); otherCategory.setOrder(category.getOrder()); category.setOrder(tmpOrder); // ********* PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobal...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.setOrderById")); p.setInt(1, otherCategory.getOrder()); p.setInt(2, otherCategory.getId()); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.setOrderById")); p.setInt(1, otherCategory.getOrder()); p.setInt(2, otherCategory.getId()); p.executeUpdate(); p.close(); p=null;
private void setOrder(Category category, Category otherCategory, boolean up) throws Exception { int tmpOrder = otherCategory.getOrder(); otherCategory.setOrder(category.getOrder()); category.setOrder(tmpOrder); // ********* PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobal...
p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.setOrderById")); p.setInt(1, category.getOrder()); p.setInt(2, category.getId()); p.executeUpdate(); p.close();
p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.setOrderById")); p.setInt(1, category.getOrder()); p.setInt(2, category.getId()); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setOrder()"; log.error(es, e); throw new RuntimeException(es, e); } finally {...
private void setOrder(Category category, Category otherCategory, boolean up) throws Exception { int tmpOrder = otherCategory.getOrder(); otherCategory.setOrder(category.getOrder()); category.setOrder(tmpOrder); // ********* PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobal...
public void setOrderDown(Category category, Category relatedCategory) throws Exception
public void setOrderDown(Category category, Category relatedCategory)
public void setOrderDown(Category category, Category relatedCategory) throws Exception { this.setOrder(category, relatedCategory, false); }
public void setOrderUp(Category category, Category relatedCategory) throws Exception
public void setOrderUp(Category category, Category relatedCategory)
public void setOrderUp(Category category, Category relatedCategory) throws Exception { this.setOrder(category, relatedCategory, true); }