bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception("Invalid stack state"); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,621
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int mdepth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int mdepth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,622
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,mdepth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,623
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); mdepth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,624
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { mdepth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,625
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (mdepth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,626
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (mdepth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,627
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int mdepth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int mdepth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); mdepth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
| 1,122,628
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS\n"); throw new IllegalStateException(sb.toString()); } }
|
public Iterator getEvents() throws IllegalStateException { try { ProfileEvent[] buf = _eventBuffer; final int numEvents = _qPtr / 2; if (buf.length < numEvents) { buf = new ProfileEvent[numEvents]; System.arraycopy(_eventBuffer,0,buf,0,buf.length); _eventBuffer = buf; } final int last = _qPtr; int next = -1; int lastOpen = -1; int depth = 0; for (int i = 0; i < last; i++) { String name = _qName[i]; long time = _qTime[i]; if (name != null) { // start a new event ProfileEvent wme = buf[++next]; if (wme == null) { wme = new ProfileEvent(); buf[next] = wme; } wme.name = name; wme.start = time; wme.duration = lastOpen; // tmp parent pointer wme.depth = depth++; lastOpen = next; } else { ProfileEvent wme = buf[lastOpen]; lastOpen = wme.duration; // a tmp parent pointer wme.duration = (int) (time - wme.start); depth--; } } if ((depth != 0) || (next+1 != numEvents)) { throw new Exception(); // not as many starts as stops } return new Iterator() { int pos = 0; public boolean hasNext() { return (pos < numEvents); } public Object next() { return (_eventBuffer[pos++]); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("Cannot remove"); } }; } catch (Exception e) { StringBuffer sb = new StringBuffer(); sb.append("Profile: start/stop timing call graph invalid:\n"); char[] indent = new char[_qPtr * 4]; Arrays.fill(indent, ' '); int depth = 0; for (int i = 0; i < _qPtr; i++) { if (_qName[i] != null) { sb.append(indent,0,depth); sb.append(_qName[i]); sb.append("\n"); depth += 2; } else { depth -= 2; } if (depth > _qPtr/2) { sb.append("AT THIS POINT MORE START TIMINGS THAN STOPS\n"); } if (depth < 0) { sb.append("AT THIS POINT MORE STOP TIMINGS THAN STARTS\n"); depth = 0; } } sb.append("NUMBER OF START TIMINGS NOT EQUAL NUMBER OF STOPS:" + "depth=" + depth + " " + "lastOpen=" + lastOpen + " " + "next=" + next + " " + "last=" + last + " " + "buf.length=" + buf.length); e.printStackTrace(); throw new IllegalStateException(sb.toString()); } }
| 1,122,629
|
public final void setValue (Context context, Object newValue) throws PropertyException { if (!context.setProperty(_names, newValue)) { throw new PropertyException("No method to set \"" + _vname + "\" to type " + ((newValue == null) ? "null" : newValue.getClass().toString()) + " in supplied context (" + context.getClass() + ")"); } }
|
public final void setValue (Context context, Object newValue) throws PropertyException { if (!context.setProperty(_names, newValue)) { throw new PropertyException("No method to set \"" + getVariableName() + "\" to type " + ((newValue == null) ? "null" : newValue.getClass().toString()) + " in supplied context (" + context.getClass() + ")"); } }
| 1,122,630
|
public final String toString () { return "property:" + _vname; }
|
public final String toString () { return "property:" + getVariableName(); }
| 1,122,631
|
protected EditArticleView getEditArticleView(){ WFTabbedPane tab = getWFTabbedPane(); if(tab!=null){ return (EditArticleView) tab.getPerspective(TASK_ID_EDIT); } return null; }
|
protected EditArticleView getEditArticleView(){ WFTabbedPane tab = getTabbedPane(); if(tab!=null){ return (EditArticleView) tab.getPerspective(TASK_ID_EDIT); } return null; }
| 1,122,632
|
protected EditArticleView getEditArticleView(){ WFTabbedPane tab = getWFTabbedPane(); if(tab!=null){ return (EditArticleView) tab.getPerspective(TASK_ID_EDIT); } return null; }
|
protected EditArticleView getEditArticleView(){ WFTabbedPane tab = getWFTabbedPane(); if(tab!=null){ return (EditArticleView) tab.getTabView(TASK_ID_EDIT); } return null; }
| 1,122,633
|
public void initializeComponent(FacesContext context){ //TODO Remove this and use newer localization system: WFPage.loadResourceBundles(context); super.initializeComponent(context); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabbedPane tb = new WFTabbedPane(); //tb.setMainAreaStyleClass(WFContainer.DEFAULT_STYLE_CLASS); tb.setId(TASKBAR_ID); add(tb); EditArticleView editArticleBlock = new EditArticleView(); tb.addTabVB(TASK_ID_EDIT, bref + "edit", editArticleBlock); tb.addTabVB(TASK_ID_DETAILS, bref + "details", new ArticleDetailView());// tb.addTabVB(TASK_ID_LIST, bref + "list", new ListArticlesBlock()); tb.addTabVB(TASK_ID_PREVIEW, bref + "preview", new ArticlePreview()); tb.setSelectedMenuItemId(TASK_ID_EDIT); //if (taskbarListener != null) { // tb.addTabListener(taskbarListener); //} String editMode = getEditMode(); if(editMode!=null){ editArticleBlock.setEditMode(editMode); } }
|
public void initializeComponent(FacesContext context){ //TODO Remove this and use newer localization system: WFPage.loadResourceBundles(context); UISaveState beanSaveState = new UISaveState(); ValueBinding binding = WFUtil.createValueBinding("#{"+ARTICLE_ITEM_BEAN_ID+"}"); beanSaveState.setId("articleItemBeanSaveState"); beanSaveState.setValueBinding("value",binding); add(beanSaveState); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabbedPane tb = new WFTabbedPane(); //tb.setMainAreaStyleClass(WFContainer.DEFAULT_STYLE_CLASS); tb.setId(TASKBAR_ID); add(tb); EditArticleView editArticleBlock = new EditArticleView(); tb.addTabVB(TASK_ID_EDIT, bref + "edit", editArticleBlock); tb.addTabVB(TASK_ID_DETAILS, bref + "details", new ArticleDetailView());// tb.addTabVB(TASK_ID_LIST, bref + "list", new ListArticlesBlock()); tb.addTabVB(TASK_ID_PREVIEW, bref + "preview", new ArticlePreview()); tb.setSelectedMenuItemId(TASK_ID_EDIT); //if (taskbarListener != null) { // tb.addTabListener(taskbarListener); //} String editMode = getEditMode(); if(editMode!=null){ editArticleBlock.setEditMode(editMode); } }
| 1,122,634
|
public void initializeComponent(FacesContext context){ //TODO Remove this and use newer localization system: WFPage.loadResourceBundles(context); super.initializeComponent(context); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabbedPane tb = new WFTabbedPane(); //tb.setMainAreaStyleClass(WFContainer.DEFAULT_STYLE_CLASS); tb.setId(TASKBAR_ID); add(tb); EditArticleView editArticleBlock = new EditArticleView(); tb.addTabVB(TASK_ID_EDIT, bref + "edit", editArticleBlock); tb.addTabVB(TASK_ID_DETAILS, bref + "details", new ArticleDetailView());// tb.addTabVB(TASK_ID_LIST, bref + "list", new ListArticlesBlock()); tb.addTabVB(TASK_ID_PREVIEW, bref + "preview", new ArticlePreview()); tb.setSelectedMenuItemId(TASK_ID_EDIT); //if (taskbarListener != null) { // tb.addTabListener(taskbarListener); //} String editMode = getEditMode(); if(editMode!=null){ editArticleBlock.setEditMode(editMode); } }
|
public void initializeComponent(FacesContext context){ //TODO Remove this and use newer localization system: WFPage.loadResourceBundles(context); super.initializeComponent(context); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabbedPane tb = new WFTabbedPane(); //tb.setMainAreaStyleClass(WFContainer.DEFAULT_STYLE_CLASS); tb.setId(TASKBAR_ID); add(tb); EditArticleView editArticleBlock = new EditArticleView(); tb.addTabVB(TASK_ID_EDIT, bref + "edit", editArticleBlock); tb.addTabVB(TASK_ID_DETAILS, bref + "details", new ArticleDetailView());// tb.addTabVB(TASK_ID_LIST, bref + "list", new ListArticlesBlock()); tb.addTabVB(TASK_ID_PREVIEW, bref + "preview", new ArticlePreview()); tb.setSelectedMenuItemId(TASK_ID_EDIT); //if (taskbarListener != null) { // tb.addTabListener(taskbarListener); //} String editMode = getEditMode(); if(editMode!=null){ editArticleBlock.setEditMode(editMode); } }
| 1,122,635
|
public void store() throws IDOStoreException{// public Boolean store() { boolean storeOk = true; clearErrorKeys(); ArticleDocument articleDoc = ArticleDocument.Factory.newInstance(); ArticleDocument.Article article = articleDoc.addNewArticle(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } article.setHeadline(getHeadline()); article.setBody(getBody()); article.setTeaser(getTeaser()); article.setAuthor(getAuthor()); article.setSource(getSource()); article.setComment(getComment()); String filename = getHeadline(); if(null==filename || filename.length()==0) { filename = "empty"; }/* File path = new File(getFolder()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String uri = service.getWebdavServerURI(); String folderLoaction = getFolderLocation();// String filePath = service.getWebdavServerURI()+getFolderLocation();// boolean success = rootResource.mkcolMethod(filePath);// createPath(getFolderLocation()); IWSlideService slideService = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); slideService.createAllFoldersInPath(getFolderLocation()); System.out.println("URI = "+uri); System.out.println("Folder location = "+folderLoaction); // System.out.println("success "+success);// success = rootResource.putMethod(getWebdavServletURL(iwuc)+getFolderLocation()+"/"+filename+".xml",articleDoc.toString());// System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getFolder();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getFolder());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getFolder()+"/"+filename+".xml");// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+".xml");// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+".xml");// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+".xml")); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml"); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getFolder()+"/"+filename+".xml"));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
|
public void store() throws IDOStoreException{// public Boolean store() { boolean storeOk = true; clearErrorKeys(); ArticleDocument articleDoc = ArticleDocument.Factory.newInstance(); ArticleDocument.Article article = articleDoc.addNewArticle(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } article.setHeadline(getHeadline()); article.setBody(getBody()); article.setTeaser(getTeaser()); article.setAuthor(getAuthor()); article.setSource(getSource()); article.setComment(getComment()); String filename = getHeadline(); if(null==filename || filename.length()==0) { filename = "empty"; }/* File path = new File(getFolder()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String uri = service.getWebdavServerURI(); String folderLoaction = getFolderLocation();// String filePath = service.getWebdavServerURI()+getFolderLocation();// boolean success = rootResource.mkcolMethod(filePath);// createPath(getFolderLocation()); IWSlideService slideService = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); slideService.createAllFoldersInPath(getFolderLocation()); System.out.println("URI = "+uri); System.out.println("Folder location = "+folderLoaction); // System.out.println("success "+success);// success = rootResource.putMethod(getWebdavServletURL(iwuc)+getFolderLocation()+"/"+filename+ARTICLE_SUFFIX,articleDoc.toString());// System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getFolder();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getFolder());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getFolder()+"/"+filename+".xml");// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+".xml");// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+".xml");// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+".xml")); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml"); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getFolder()+"/"+filename+".xml"));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
| 1,122,636
|
public HTMLReport(Map coverageData, File outputDir, File sourceDir) throws Exception { this.outputDir = outputDir; this.sourceDir = sourceDir; this.coverage = CoverageUnmarshaller.parse(coverageData); removeNonexistantClasses(); CopyFiles.copy(outputDir); generatePackageList(); generateClassLists(); generateOverviews(); generateSourceFiles(); }
|
public HTMLReport(Coverage coverage, File outputDir, File sourceDir) throws Exception { this.outputDir = outputDir; this.sourceDir = sourceDir; this.coverage = CoverageUnmarshaller.parse(coverageData); removeNonexistantClasses(); CopyFiles.copy(outputDir); generatePackageList(); generateClassLists(); generateOverviews(); generateSourceFiles(); }
| 1,122,637
|
public HTMLReport(Map coverageData, File outputDir, File sourceDir) throws Exception { this.outputDir = outputDir; this.sourceDir = sourceDir; this.coverage = CoverageUnmarshaller.parse(coverageData); removeNonexistantClasses(); CopyFiles.copy(outputDir); generatePackageList(); generateClassLists(); generateOverviews(); generateSourceFiles(); }
|
public HTMLReport(Map coverageData, File outputDir, File sourceDir) throws Exception { this.outputDir = outputDir; this.sourceDir = sourceDir; this.coverage = coverage; removeNonexistantClasses(); CopyFiles.copy(outputDir); generatePackageList(); generateClassLists(); generateOverviews(); generateSourceFiles(); }
| 1,122,638
|
public static String getXsdType(Type type) { String name = type.getName(); String xsdType = (String) XSD_TYPES.get(name); if (xsdType == null) { xsdType = "xsd:string"; } return xsdType; }
|
public static String getXsdType(Type type) { String name = type.getName(); String xsdType = (String) XSD_TYPES.get(name); if (xsdType == null) { xsdType = "xs:string"; } return xsdType; }
| 1,122,639
|
public void populateMenuBar(MenuManager menuBar) { noteMenu = new MenuManager("&Note"); menuBar.add(noteMenu); addNoteSubmenu = new MenuManager("&Add Note"); addNoteSubmenu.add(addNoteAfter); addNoteSubmenu.add(addNoteUnder); noteMenu.add(addNoteSubmenu); moveNoteSubmenu = new MenuManager("&Move Note"); moveNoteSubmenu.add(moveNoteLeft); moveNoteSubmenu.add(moveNoteRight); moveNoteSubmenu.add(moveNoteUp); moveNoteSubmenu.add(moveNoteDown); noteMenu.add(moveNoteSubmenu); noteMenu.add(removeNotes); noteMenu.add(renameNote); }
|
public void populateMenuBar(MenuManager menuBar) { noteMenu = new MenuManager("&Note"); menuBar.add(noteMenu); addNoteSubmenu = new MenuManager("&Add Note"); addNoteSubmenu.add(addNoteAfter); addNoteSubmenu.add(addNoteUnder); noteMenu.add(addNoteSubmenu); moveNoteSubmenu = new MenuManager("&Move Note"); moveNoteSubmenu.add(moveNoteLeft); moveNoteSubmenu.add(moveNoteRight); moveNoteSubmenu.add(moveNoteUp); moveNoteSubmenu.add(moveNoteDown); noteMenu.add(moveNoteSubmenu); noteMenu.add(removeNotes); noteMenu.add(renameNote); }
| 1,122,640
|
public void populateTreeContextMenu(MenuManager treeContextMenu) { addNoteTreeSubmenu = new MenuManager("&Add Note"); addNoteTreeSubmenu.add(addNoteAfter); addNoteTreeSubmenu.add(addNoteUnder); treeContextMenu.add(addNoteTreeSubmenu); moveNoteTreeSubmenu = new MenuManager("&Move Note"); moveNoteTreeSubmenu.add(moveNoteLeft); moveNoteTreeSubmenu.add(moveNoteRight); moveNoteTreeSubmenu.add(moveNoteUp); moveNoteTreeSubmenu.add(moveNoteDown); treeContextMenu.add(moveNoteTreeSubmenu); treeContextMenu.add(removeNotes); treeContextMenu.add(renameNote); }
|
public void populateTreeContextMenu(MenuManager treeContextMenu) { addNoteTreeSubmenu = new MenuManager("&Add Note"); addNoteTreeSubmenu.add(addNoteAfter); addNoteTreeSubmenu.add(addNoteUnder); treeContextMenu.add(addNoteTreeSubmenu); moveNoteTreeSubmenu = new MenuManager("&Move Note"); moveNoteTreeSubmenu.add(moveNoteLeft); moveNoteTreeSubmenu.add(moveNoteRight); moveNoteTreeSubmenu.add(moveNoteUp); moveNoteTreeSubmenu.add(moveNoteDown); treeContextMenu.add(moveNoteTreeSubmenu); treeContextMenu.add(removeNotes); treeContextMenu.add(renameNote); }
| 1,122,641
|
public void populateTreeContextMenu(MenuManager treeContextMenu) { addNoteTreeSubmenu = new MenuManager("&Add Note"); addNoteTreeSubmenu.add(addNoteAfter); addNoteTreeSubmenu.add(addNoteUnder); treeContextMenu.add(addNoteTreeSubmenu); moveNoteTreeSubmenu = new MenuManager("&Move Note"); moveNoteTreeSubmenu.add(moveNoteLeft); moveNoteTreeSubmenu.add(moveNoteRight); moveNoteTreeSubmenu.add(moveNoteUp); moveNoteTreeSubmenu.add(moveNoteDown); treeContextMenu.add(moveNoteTreeSubmenu); treeContextMenu.add(removeNotes); treeContextMenu.add(renameNote); }
|
public void populateTreeContextMenu(MenuManager treeContextMenu) { addNoteTreeSubmenu = new MenuManager("&Add Note"); addNoteTreeSubmenu.add(addNoteAfter); addNoteTreeSubmenu.add(addNoteUnder); treeContextMenu.add(addNoteTreeSubmenu); moveNoteTreeSubmenu = new MenuManager("&Move Note"); moveNoteTreeSubmenu.add(moveNoteLeft); moveNoteTreeSubmenu.add(moveNoteRight); moveNoteTreeSubmenu.add(moveNoteUp); moveNoteTreeSubmenu.add(moveNoteDown); treeContextMenu.add(moveNoteTreeSubmenu); treeContextMenu.add(removeNotes); treeContextMenu.add(renameNote); }
| 1,122,642
|
public void populateTreeContextMenu(MenuManager treeContextMenu) { addNoteTreeSubmenu = new MenuManager("&Add Note"); addNoteTreeSubmenu.add(addNoteAfter); addNoteTreeSubmenu.add(addNoteUnder); treeContextMenu.add(addNoteTreeSubmenu); moveNoteTreeSubmenu = new MenuManager("&Move Note"); moveNoteTreeSubmenu.add(moveNoteLeft); moveNoteTreeSubmenu.add(moveNoteRight); moveNoteTreeSubmenu.add(moveNoteUp); moveNoteTreeSubmenu.add(moveNoteDown); treeContextMenu.add(moveNoteTreeSubmenu); treeContextMenu.add(removeNotes); treeContextMenu.add(renameNote); }
|
public void populateTreeContextMenu(MenuManager treeContextMenu) { addNoteTreeSubmenu = new MenuManager("&Add Note"); addNoteTreeSubmenu.add(addNoteAfter); addNoteTreeSubmenu.add(addNoteUnder); treeContextMenu.add(addNoteTreeSubmenu); moveNoteTreeSubmenu = new MenuManager("&Move Note"); moveNoteTreeSubmenu.add(moveNoteLeft); moveNoteTreeSubmenu.add(moveNoteRight); moveNoteTreeSubmenu.add(moveNoteUp); moveNoteTreeSubmenu.add(moveNoteDown); treeContextMenu.add(moveNoteTreeSubmenu); treeContextMenu.add(removeNotes); treeContextMenu.add(renameNote); }
| 1,122,643
|
public void update() { if (tree.hasFocus()) { removeNotes.setEnabled(true); if (tree.getSelectionCount() == 1) { addNoteSubmenu.setVisible(true); moveNoteSubmenu.setVisible(true); removeNotes.setText("Remove Note"); renameNote.setEnabled(true); } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setText("Remove Notes"); renameNote.setEnabled(false); } } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setEnabled(false); renameNote.setEnabled(false); } }
|
public void update() { if (tree.hasFocus()) { removeNotes.setEnabled(true); if (tree.getSelectionCount() == 1) { addNoteSubmenu.setVisible(true); moveNoteSubmenu.setVisible(true); removeNotes.setText("Remove Note"); renameNote.setEnabled(true); } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setText("Remove Notes"); renameNote.setEnabled(false); } } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setEnabled(false); renameNote.setEnabled(false); } }
| 1,122,644
|
public void update() { if (tree.hasFocus()) { removeNotes.setEnabled(true); if (tree.getSelectionCount() == 1) { addNoteSubmenu.setVisible(true); moveNoteSubmenu.setVisible(true); removeNotes.setText("Remove Note"); renameNote.setEnabled(true); } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setText("Remove Notes"); renameNote.setEnabled(false); } } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setEnabled(false); renameNote.setEnabled(false); } }
|
public void update() { if (tree.hasFocus()) { removeNotes.setEnabled(true); if (tree.getSelectionCount() == 1) { addNoteSubmenu.setVisible(true); moveNoteSubmenu.setVisible(true); removeNotes.setText("Remove Note"); renameNote.setEnabled(true); } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setText("Remove Notes"); } } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setEnabled(false); } }
| 1,122,645
|
public void update() { if (tree.hasFocus()) { removeNotes.setEnabled(true); if (tree.getSelectionCount() == 1) { addNoteSubmenu.setVisible(true); moveNoteSubmenu.setVisible(true); removeNotes.setText("Remove Note"); renameNote.setEnabled(true); } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setText("Remove Notes"); renameNote.setEnabled(false); } } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setEnabled(false); renameNote.setEnabled(false); } }
|
public void update() { if (tree.hasFocus()) { removeNotes.setEnabled(true); if (tree.getSelectionCount() == 1) { addNoteSubmenu.setVisible(true); moveNoteSubmenu.setVisible(true); removeNotes.setText("Remove Note"); renameNote.setEnabled(true); } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setText("Remove Notes"); renameNote.setEnabled(false); } } else { addNoteSubmenu.setVisible(false); moveNoteSubmenu.setVisible(false); removeNotes.setEnabled(false); renameNote.setEnabled(false); } }
| 1,122,646
|
public DisplayedDocument(Shell shell) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener and Dispatcher Dispatcher dispatcher = new Dispatcher(); Listener listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); // Finish SashForm sashForm.setWeights(new int[] {20, 80}); // Controllers dispatcher.registerController(new MainController(this)); dispatcher.registerController(new MainMenuController(this)); dispatcher.registerController(new TreeController(tree, dispatcher)); }
|
public DisplayedDocument(Shell shell, Listener listener, Dispatcher dispatcher) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener and Dispatcher Dispatcher dispatcher = new Dispatcher(); Listener listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); // Finish SashForm sashForm.setWeights(new int[] {20, 80}); // Controllers dispatcher.registerController(new MainController(this)); dispatcher.registerController(new MainMenuController(this)); dispatcher.registerController(new TreeController(tree, dispatcher)); }
| 1,122,647
|
public DisplayedDocument(Shell shell) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener and Dispatcher Dispatcher dispatcher = new Dispatcher(); Listener listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); // Finish SashForm sashForm.setWeights(new int[] {20, 80}); // Controllers dispatcher.registerController(new MainController(this)); dispatcher.registerController(new MainMenuController(this)); dispatcher.registerController(new TreeController(tree, dispatcher)); }
|
public DisplayedDocument(Shell shell) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener and Dispatcher Dispatcher dispatcher = new Dispatcher(); Listener listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); // Finish SashForm sashForm.setWeights(new int[] {20, 80}); // Controllers dispatcher.registerController(new MainController(this)); dispatcher.registerController(new MainMenuController(this)); dispatcher.registerController(new TreeController(tree, dispatcher)); }
| 1,122,648
|
public void load(String fileName) throws InitException, IOException { load(fileName,this.getClass().getClassLoader()); }
|
public void load(String fileName) throws InitException, IOException { load(fileName,this.getClass().getClassLoader()); }
| 1,122,649
|
public void addImage(byte[] imageData, String contentType) { List l = getImages(); if (l == null) { l = new ArrayList(); } ContentItemField field = new ContentItemFieldBean(); field.setBinaryValue(imageData); field.setFieldType(contentType); field.setOrderNo(l.size()); l.add(field); setImages(l); }
|
public void addImage(byte[] imageData, String contentType) { List l = getImages(); if (l == null) { l = new ArrayList(); } ContentItemField field = new ContentItemFieldBean(); field.setBinaryValue(imageData); field.setFieldType(contentType); field.setOrderNo(l.size()); l.add(field); setImages(l); }
| 1,122,650
|
public void clear() { super.clear(); setHeadline(null); setTeaser(null); setBody(null); setAuthor(null); setSource(null); setComment(null); setImages(null); setFilename(null);// setFolderLocation(null); _isUpdated = false; setFolderLocation(null); }
|
public void clear() { super.clear(); setHeadline(null); setTeaser(null); setBody(null); setAuthor(null); setSource(null); setComment(null); setImages(null); setFilename(null);// setFolderLocation(null); _isUpdated = false; setFolderLocation(null); }
| 1,122,651
|
public String getAsXML() throws IOException, XMLException { XMLParser builder = new XMLParser(); XMLElement bodyElement = null; prettifyBody(); String bodyString = getBody(); if(bodyString != null && !bodyString.trim().equals("")){ XMLDocument bodyDoc = builder.parse(new ByteArrayInputStream(bodyString.getBytes("UTF-8"))); bodyElement = bodyDoc.getRootElement(); } XMLElement root = new XMLElement("article",idegaXMLNameSpace); XMLElement contentLanguage = new XMLElement(FIELDNAME_CONTENT_LANGUAGE,idegaXMLNameSpace).setText(getContentLanguage()); XMLElement headline = new XMLElement(FIELDNAME_HEADLINE,idegaXMLNameSpace).setText(getHeadline()); XMLElement teaser = new XMLElement(FIELDNAME_TEASER,idegaXMLNameSpace).setText(getTeaser()); XMLElement author = new XMLElement(FIELDNAME_AUTHOR,idegaXMLNameSpace).setText(getAuthor()); XMLElement source = new XMLElement(FIELDNAME_SOURCE,idegaXMLNameSpace).setText(getSource()); XMLElement articleComment = new XMLElement("article_comment",idegaXMLNameSpace).setText(getComment()); XMLElement body = new XMLElement(FIELDNAME_BODY,idegaXMLNameSpace); if(bodyElement != null){ body.addContent(bodyElement); } root.addContent(contentLanguage); root.addContent(headline); root.addContent(teaser); root.addContent(body); root.addContent(author); root.addContent(source); root.addContent(articleComment); XMLDocument doc = new XMLDocument(root); XMLOutput outputter = new XMLOutput(); return outputter.outputString(doc); }
|
public String getAsXML() throws IOException, XMLException { XMLParser builder = new XMLParser(); XMLElement bodyElement = null; prettifyBody(); String bodyString = getBody(); if(bodyString != null && !bodyString.trim().equals("")){ XMLDocument bodyDoc = builder.parse(new ByteArrayInputStream(bodyString.getBytes("UTF-8"))); bodyElement = bodyDoc.getRootElement(); } XMLElement root = new XMLElement("article",idegaXMLNameSpace); XMLElement contentLanguage = new XMLElement(FIELDNAME_CONTENT_LANGUAGE,idegaXMLNameSpace).setText(getContentLanguage()); XMLElement headline = new XMLElement(FIELDNAME_HEADLINE,idegaXMLNameSpace).setText(getHeadline()); XMLElement teaser = new XMLElement(FIELDNAME_TEASER,idegaXMLNameSpace).setText(getTeaser()); XMLElement author = new XMLElement(FIELDNAME_AUTHOR,idegaXMLNameSpace).setText(getAuthor()); XMLElement source = new XMLElement(FIELDNAME_SOURCE,idegaXMLNameSpace).setText(getSource()); XMLElement articleComment = new XMLElement("article_comment",idegaXMLNameSpace).setText(getComment()); XMLElement body = new XMLElement(FIELDNAME_BODY,idegaXMLNameSpace); if(bodyElement != null){ body.addContent(bodyElement); } root.addContent(contentLanguage); root.addContent(headline); root.addContent(teaser); root.addContent(body); root.addContent(author); root.addContent(source); root.addContent(articleComment); XMLDocument doc = new XMLDocument(root); XMLOutput outputter = new XMLOutput(); return outputter.outputString(doc); }
| 1,122,652
|
public String getAuthor() { return (String)getValue(FIELDNAME_AUTHOR); }
|
public String getAuthor() { return getLocalizedArticle().getAuthor(); }
| 1,122,653
|
public String getBody() { return (String)getValue(FIELDNAME_BODY); }
|
public String getBody() { return getLocalizedArticle().getBody(); }
| 1,122,654
|
public String getComment() { return (String)getValue(FIELDNAME_COMMENT); }
|
public String getComment() { return getLocalizedArticle().getComment(); }
| 1,122,655
|
public String[] getContentFieldNames(){ return ATTRIBUTE_ARRAY; }
|
public String[] getContentFieldNames(){ return ATTRIBUTE_ARRAY; }
| 1,122,656
|
public String getContentItemPrefix() { return "article_"; }
|
public String getContentItemPrefix() { return getLocalizedArticle().getContentItemPrefix(); }
| 1,122,657
|
public String getContentLanguage() { return (String)getValue(FIELDNAME_CONTENT_LANGUAGE); }
|
public String getContentLanguage() { return getLocalizedArticle().getContentLanguage(); }
| 1,122,658
|
public String getHeadline() { return (String)getValue(FIELDNAME_HEADLINE); }
|
public String getHeadline() { return getLocalizedArticle().getHeadline(); }
| 1,122,659
|
public List getImages() { return getItemFields(FIELDNAME_IMAGES); }
|
public List getImages() { return getLocalizedArticle().getImages(); }
| 1,122,660
|
public String getLanguageChange() { return (String)getValue(FIELDNAME_LANGUAGE_CHANGE); }
|
public String getLanguageChange() { return languageChange; }
| 1,122,661
|
public String getSource() { return (String)getValue(FIELDNAME_SOURCE); }
|
public String getSource() { return getLocalizedArticle().getSource(); }
| 1,122,662
|
public String getTeaser() { return (String)getValue(FIELDNAME_TEASER); }
|
public String getTeaser() { return getLocalizedArticle().getTeaser(); }
| 1,122,663
|
public String[] getToolbarActions(){ //return ACTION_ARRAY; return super.getToolbarActions(); }
|
public String[] getToolbarActions(){ //return ACTION_ARRAY; return super.getToolbarActions(); }
| 1,122,664
|
public boolean isUpdated() { return _isUpdated; }
|
public boolean isUpdated() { return getLocalizedArticle().isUpdated(); }
| 1,122,665
|
public boolean load(WebdavExtendedResource webdavResource) throws IOException { XMLParser builder = new XMLParser(); XMLDocument bodyDoc = null; try { WebdavResource theArticle = null; if(webdavResource.isCollection()){ IWContext iwc = IWContext.getInstance(); WebdavResources resources = webdavResource.getChildResources(); String userLanguageArticleName = getArticleName(iwc.getCurrentLocale()); String systemLanguageArticleName = getArticleName(iwc.getIWMainApplication().getDefaultLocale()); if(resources.isThereResourceName(userLanguageArticleName)){ //the language that the user has selected theArticle = resources.getResource(userLanguageArticleName); } else if(resources.isThereResourceName(systemLanguageArticleName)){ //the language that is default for the system theArticle = resources.getResource(systemLanguageArticleName); } else { // take the first language Enumeration en = resources.getResources(); if(en.hasMoreElements()){ theArticle = (WebdavResource)en.nextElement(); } } } else { theArticle = webdavResource; } if(theArticle!=null && !theArticle.isCollection()){ setArticleResourcePath(theArticle.getPath()); bodyDoc = builder.parse(new ByteArrayInputStream(theArticle.getMethodDataAsString().getBytes("UTF-8"))); } else { bodyDoc = null; } } catch (XMLException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } if(bodyDoc!=null){ XMLElement rootElement = bodyDoc.getRootElement(); try { XMLElement language = rootElement.getChild(FIELDNAME_CONTENT_LANGUAGE,idegaXMLNameSpace); if(language != null){ setContentLanguage(language.getText()); } else { setContentLanguage(null); } }catch(Exception e) { setContentLanguage(null); } try { XMLElement headline = rootElement.getChild(FIELDNAME_HEADLINE,idegaXMLNameSpace); if(headline != null){ setHeadline(headline.getText()); } else { setHeadline(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setHeadline(""); } try { XMLElement teaser = rootElement.getChild(FIELDNAME_TEASER,idegaXMLNameSpace); if(teaser != null){ setTeaser(teaser.getText()); } else { setTeaser(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setTeaser(""); } try { XMLElement author = rootElement.getChild(FIELDNAME_AUTHOR,idegaXMLNameSpace); if(author != null){ setAuthor(author.getText()); } else { setAuthor(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setAuthor(""); } //Parse out the body try { XMLNamespace htmlNamespace = new XMLNamespace("http://www.w3.org/1999/xhtml"); XMLElement bodyElement = rootElement.getChild(FIELDNAME_BODY,idegaXMLNameSpace); XMLElement htmlElement = bodyElement.getChild("html",htmlNamespace); XMLElement htmlBodyElement = htmlElement.getChild("body",htmlNamespace); String bodyValue = htmlBodyElement.getContentAsString(); setBody(bodyValue); }catch(Exception e) { //Nullpointer could occur if field isn't used // e.printStackTrace(); Logger log = Logger.getLogger(this.getClass().toString()); log.warning("Body of article is empty"); setBody(""); } try { XMLElement source = rootElement.getChild(FIELDNAME_SOURCE,idegaXMLNameSpace); if(source != null){ setSource(source.getText()); } else { setSource(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used setSource(""); } try { XMLElement comment = rootElement.getChild(FIELDNAME_ARTICLE_COMMENT,idegaXMLNameSpace); if(comment != null){ setComment(comment.getText()); } else { setComment(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setComment(""); } } else { //article not found Logger log = Logger.getLogger(this.getClass().toString()); log.warning("Article xml file was not found"); setRendered(false); return false; } return true;// setFilename();// setFolderLocation(bodyElement.getChild(FIELDNAME_FOLDER_LOCATION,idegans).getText()); }
|
public boolean load(WebdavExtendedResource webdavResource) throws IOException { XMLParser builder = new XMLParser(); XMLDocument bodyDoc = null; try { WebdavResource theArticle = null; if(webdavResource.isCollection()){ IWContext iwc = IWContext.getInstance(); WebdavResources resources = webdavResource.getChildResources(); String userLanguageArticleName = getArticleName(iwc.getCurrentLocale()); String systemLanguageArticleName = getArticleName(iwc.getIWMainApplication().getDefaultLocale()); if(resources.isThereResourceName(userLanguageArticleName)){ //the language that the user has selected theArticle = resources.getResource(userLanguageArticleName); } else if(resources.isThereResourceName(systemLanguageArticleName)){ //the language that is default for the system theArticle = resources.getResource(systemLanguageArticleName); } else { // take the first language Enumeration en = resources.getResources(); if(en.hasMoreElements()){ theArticle = (WebdavResource)en.nextElement(); } } } else { theArticle = webdavResource; } if(theArticle!=null && !theArticle.isCollection()){ setArticleResourcePath(theArticle.getPath()); bodyDoc = builder.parse(new ByteArrayInputStream(theArticle.getMethodDataAsString().getBytes("UTF-8"))); } else { bodyDoc = null; } } catch (XMLException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } if(bodyDoc!=null){ XMLElement rootElement = bodyDoc.getRootElement(); try { XMLElement language = rootElement.getChild(FIELDNAME_CONTENT_LANGUAGE,idegaXMLNameSpace); if(language != null){ setContentLanguage(language.getText()); } else { setContentLanguage(null); } }catch(Exception e) { setContentLanguage(null); } try { XMLElement headline = rootElement.getChild(FIELDNAME_HEADLINE,idegaXMLNameSpace); if(headline != null){ setHeadline(headline.getText()); } else { setHeadline(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setHeadline(""); } try { XMLElement teaser = rootElement.getChild(FIELDNAME_TEASER,idegaXMLNameSpace); if(teaser != null){ setTeaser(teaser.getText()); } else { setTeaser(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setTeaser(""); } try { XMLElement author = rootElement.getChild(FIELDNAME_AUTHOR,idegaXMLNameSpace); if(author != null){ setAuthor(author.getText()); } else { setAuthor(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setAuthor(""); } //Parse out the body try { XMLNamespace htmlNamespace = new XMLNamespace("http://www.w3.org/1999/xhtml"); XMLElement bodyElement = rootElement.getChild(FIELDNAME_BODY,idegaXMLNameSpace); XMLElement htmlElement = bodyElement.getChild("html",htmlNamespace); XMLElement htmlBodyElement = htmlElement.getChild("body",htmlNamespace); String bodyValue = htmlBodyElement.getContentAsString(); setBody(bodyValue); }catch(Exception e) { //Nullpointer could occur if field isn't used // e.printStackTrace(); Logger log = Logger.getLogger(this.getClass().toString()); log.warning("Body of article is empty"); setBody(""); } try { XMLElement source = rootElement.getChild(FIELDNAME_SOURCE,idegaXMLNameSpace); if(source != null){ setSource(source.getText()); } else { setSource(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used setSource(""); } try { XMLElement comment = rootElement.getChild(FIELDNAME_ARTICLE_COMMENT,idegaXMLNameSpace); if(comment != null){ setComment(comment.getText()); } else { setComment(""); } }catch(Exception e) { //Nullpointer could occur if field isn't used e.printStackTrace(); setComment(""); } } else { //article not found Logger log = Logger.getLogger(this.getClass().toString()); log.warning("Article xml file was not found"); setRendered(false); return false; } return true;// setFilename();// setFolderLocation(bodyElement.getChild(FIELDNAME_FOLDER_LOCATION,idegans).getText()); }
| 1,122,666
|
private void makesureStandardFolderisCreated() { IWUserContext iwuc = getIWUserContext(); IWSlideService slideService = getIWSlideService(iwuc); String contentFolderPath = ArticleUtil.getContentRootPath(); String articlePath = ArticleUtil.getArticleRootPath(); try { //first make the folder: slideService.createAllFoldersInPathAsRoot(articlePath); //was not used? slideService.getWebdavResourceAuthenticatedAsRoot(contentFolderPath); AccessControlList aclList = slideService.getAccessControlList(contentFolderPath); AuthenticationBusiness authBusiness = ((IWSlideServiceBean)slideService).getAuthenticationBusiness(); String editorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_EDITOR); Ace editorAce = new Ace(editorRoleUri); editorAce.addPrivilege(Privilege.READ); editorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry editorEntry = new AccessControlEntry(editorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(editorEntry); String authorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_AUTHOR); Ace authorAce = new Ace(authorRoleUri); authorAce.addPrivilege(Privilege.READ); authorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry authorEntry = new AccessControlEntry(authorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(authorEntry); slideService.storeAccessControlList(aclList); //debug: aclList = slideService.getAccessControlList(contentFolderPath); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
|
private void makesureStandardFolderisCreated() { IWUserContext iwuc = getIWUserContext(); IWSlideService slideService = getIWSlideService(iwuc); String contentFolderPath = ArticleUtil.getContentRootPath(); String articlePath = ArticleUtil.getArticleBaseFolderPath(); try { //first make the folder: slideService.createAllFoldersInPathAsRoot(articlePath); //was not used? slideService.getWebdavResourceAuthenticatedAsRoot(contentFolderPath); AccessControlList aclList = slideService.getAccessControlList(contentFolderPath); AuthenticationBusiness authBusiness = ((IWSlideServiceBean)slideService).getAuthenticationBusiness(); String editorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_EDITOR); Ace editorAce = new Ace(editorRoleUri); editorAce.addPrivilege(Privilege.READ); editorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry editorEntry = new AccessControlEntry(editorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(editorEntry); String authorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_AUTHOR); Ace authorAce = new Ace(authorRoleUri); authorAce.addPrivilege(Privilege.READ); authorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry authorEntry = new AccessControlEntry(authorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(authorEntry); slideService.storeAccessControlList(aclList); //debug: aclList = slideService.getAccessControlList(contentFolderPath); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
| 1,122,667
|
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); tidy.setCharEncoding(Configuration.UTF8); ByteArrayInputStream bais; try { bais = new ByteArrayInputStream(body.getBytes("UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); body = baos.toString("UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } // System.out.println("ArticleOut = "+articleOut); setBody(body); } }
|
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); tidy.setCharEncoding(Configuration.UTF8); ByteArrayInputStream bais; try { bais = new ByteArrayInputStream(body.getBytes("UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); body = baos.toString("UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } // System.out.println("ArticleOut = "+articleOut); setBody(body); } }
| 1,122,668
|
public void removeImage(Integer imageNumber) { int imageNo = imageNumber.intValue(); try { List l = getImages(); l.remove(imageNo); for (int i = 0; i < l.size(); i++) { ContentItemField field = (ContentItemField) l.get(i); field.setOrderNo(i); } } catch (Exception e) {} }
|
public void removeImage(Integer imageNumber) { int imageNo = imageNumber.intValue(); try { List l = getImages(); l.remove(imageNo); for (int i = 0; i < l.size(); i++) { ContentItemField field = (ContentItemField) l.get(i); field.setOrderNo(i); } } catch (Exception e) {} }
| 1,122,669
|
public void setAuthor(String s) { setValue(FIELDNAME_AUTHOR, s); }
|
public void setAuthor(String s) { getLocalizedArticle().setAuthor(s); }
| 1,122,670
|
public void setBody(String body) { setValue(FIELDNAME_BODY, body);// if (null != articleIn) {//// System.out.println("ArticleIn = "+articleIn);// //Use JTidy to clean up the html// Tidy tidy = new Tidy();// tidy.setXHTML(true);// tidy.setXmlOut(true);// ByteArrayInputStream bais = new ByteArrayInputStream(articleIn.getBytes());// ByteArrayOutputStream baos = new ByteArrayOutputStream();// tidy.parse(bais, baos);// String articleOut = baos.toString();//// System.out.println("ArticleOut = "+articleOut);// setValue(FIELDNAME_BODY, articleOut);//// setValue(FIELDNAME_BODY, articleIn);// }// else {// setValue(FIELDNAME_BODY, null);// } }
|
public void setBody(String body) { getLocalizedArticle().setBody(body);// if (null != articleIn) {//// System.out.println("ArticleIn = "+articleIn);// //Use JTidy to clean up the html// Tidy tidy = new Tidy();// tidy.setXHTML(true);// tidy.setXmlOut(true);// ByteArrayInputStream bais = new ByteArrayInputStream(articleIn.getBytes());// ByteArrayOutputStream baos = new ByteArrayOutputStream();// tidy.parse(bais, baos);// String articleOut = baos.toString();//// System.out.println("ArticleOut = "+articleOut);// setValue(FIELDNAME_BODY, articleOut);//// setValue(FIELDNAME_BODY, articleIn);// }// else {// setValue(FIELDNAME_BODY, null);// } }
| 1,122,671
|
public void setComment(String s) { setValue(FIELDNAME_COMMENT, s); }
|
public void setComment(String s) { getLocalizedArticle().setComment(s); }
| 1,122,672
|
public void setHeadline(String s) { setValue(FIELDNAME_HEADLINE, s); }
|
public void setHeadline(Object o) { getLocalizedArticle().setHeadline(o); }
| 1,122,673
|
public void setImages(List l) { setItemFields(FIELDNAME_IMAGES, l); }
|
public void setImages(List l) { getLocalizedArticle().setImages(l); }
| 1,122,674
|
public void setLanguageChange(String s) { setValue(FIELDNAME_LANGUAGE_CHANGE, s); }
|
public void setLanguageChange(String s) { languageChange=s; }
| 1,122,675
|
protected void setPublished(){ setStatus(ContentItemCase.STATUS_PUBLISHED); }
|
protected void setPublished(){ setStatus(ContentItemCase.STATUS_PUBLISHED); }
| 1,122,676
|
public void setSource(String s) { setValue(FIELDNAME_SOURCE, s); }
|
public void setSource(String s) { getLocalizedArticle().setSource(s); }
| 1,122,677
|
public void setTeaser(String s) { setValue(FIELDNAME_TEASER, s); }
|
public void setTeaser(String s) { getLocalizedArticle().setTeaser(s); }
| 1,122,678
|
public void setUpdated(boolean b) { _isUpdated = b; }
|
public void setUpdated(boolean b) { getLocalizedArticle().setUpdated(b); }
| 1,122,679
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
| 1,122,680
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
| 1,122,681
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
| 1,122,682
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
|
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if ( (getHeadline()==null) || (getHeadline().trim().equals("")) ) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; }// if (getBody().trim().equals("")) {// addErrorKey(KEY_ERROR_BODY_EMPTY);// storeOk = false;// } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// } if(storeOk){ try { IWUserContext iwuc = IWContext.getInstance(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); WebdavRootResource rootResource = session.getWebdavRootResource(); //Setting the path for creating new file/creating localized version/updating existing file String filePath=getResourcePath(); String articleFolderPath=getArticlePath(); if(articleFolderPath!=null) { filePath=articleFolderPath+"/"+getArticleName(); }else { filePath=getArticleResourcePath(); articleFolderPath = getArticlePath(); } boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath); if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } String article = getAsXML(); ByteArrayInputStream utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); // System.out.println(article); //Conflict fix: uri for creating but path for updating //Note! This is a patch to what seems to be a bug in WebDav //Apparently in verion below works in some cases and the other in other cases. //Seems to be connected to creating files in folders created in same tomcat session or similar //not quite clear... if(rootResource.putMethod(filePath,utf8stream)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } else{ utf8stream = new ByteArrayInputStream(article.getBytes("UTF-8")); String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,utf8stream); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); } rootResource.close(); try { //load(filePath); ArticleItemBean newBean = new ArticleItemBean(); newBean.load(filePath); } catch (Exception e) { //storeOk = false; //e.printStackTrace(); throw new ArticleStoreException(e.getMessage()); } } catch (IOException e1) { storeOk = false; e1.printStackTrace(); } catch (XMLException e) { storeOk = false; e.printStackTrace(); } } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
| 1,122,683
|
protected void tryPublish(){ //TODO: Implement publishing here: setPublished(); }
|
protected void tryPublish(){ //TODO: Implement publishing here: setPublished(); }
| 1,122,684
|
public void makePizza() { System.out.println("Making a pizza with topping: " + topping + " cheese: " + cheese + " with size: " + size); }
|
public void makePizza() { log.info("Making a pizza with topping: " + topping + " cheese: " + cheese + " with size: " + size); }
| 1,122,685
|
public ClassData getOrCreateClassData(String name) { ClassData classData = (ClassData)this.classes.get(name); if (classData == null) { classData = new ClassData(name); addClassData(classData); } return classData; }
|
public synchronized ClassData getOrCreateClassData(String name) { ClassData classData = (ClassData)this.classes.get(name); if (classData == null) { classData = new ClassData(name); addClassData(classData); } return classData; }
| 1,122,686
|
public void showService(String service) { if (serviceMap.containsKey(service)) { cardLayout.show(cardPanel, service); } else { // Create new Form SearchForm searchForm = new SearchForm(service); cardPanel.add(searchForm, service); serviceMap.put(service, searchForm); cardLayout.show(cardPanel, service); } SearchForm searchForm = (SearchForm)serviceMap.get(service); Form form = searchForm.getSearchForm(); String title = form.getTitle(); String description = form.getInstructions(); titlePanel.setTitle(title); titlePanel.setDescription(description); }
|
public void showService(String service) { if (serviceMap.containsKey(service)) { cardLayout.show(cardPanel, service); } else { // Create new Form SearchForm searchForm = new SearchForm(service); cardPanel.add(searchForm, service); serviceMap.put(service, searchForm); cardLayout.show(cardPanel, service); } SearchForm searchForm = (SearchForm)serviceMap.get(service); Form form = searchForm.getSearchForm(); String title = form.getTitle(); String description = form.getInstructions(); titlePanel.setTitle(Res.getString("title.person.search")); titlePanel.setDescription(description); }
| 1,122,687
|
public void performSearch() { searchResults.clearTable(); SwingWorker worker = new SwingWorker() { ReportedData data; public Object construct() { try { Form answerForm = questionForm.getFilledForm(); data = searchManager.getSearchResults(answerForm, serviceName); } catch (XMPPException e) { Log.error("Unable to load search service.", e); } return data; } public void finished() { if (data != null) { searchResults.showUsersFound(data); } else { JOptionPane.showMessageDialog(searchResults, Res.getString("message.no.results.found"), Res.getString("title.notification"), JOptionPane.ERROR_MESSAGE); } } }; worker.start(); searchResults.invalidate(); searchResults.validate(); searchResults.repaint(); }
|
public void performSearch() { searchResults.clearTable(); SwingWorker worker = new SwingWorker() { ReportedData data; public Object construct() { try { Form answerForm = questionForm.getFilledForm(); data = searchManager.getSearchResults(answerForm, serviceName); } catch (XMPPException e) { Log.error("Unable to load search service.", e); } return data; } public void finished() { if (data != null) { searchResults.showUsersFound(data); } else { JOptionPane.showMessageDialog(searchResults, Res.getString("message.no.results.found"), Res.getString("title.notification"), JOptionPane.ERROR_MESSAGE); } } }; worker.start(); searchResults.invalidate(); searchResults.validate(); searchResults.repaint(); }
| 1,122,688
|
final public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch(IOException e) { Engine.log.exception(e); Engine.log.warning( "Include: evaluate got IO exception on write to StringWriter"); return ""; } }
|
final public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, context.getEncoding()); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch(IOException e) { Engine.log.exception(e); Engine.log.warning( "Include: evaluate got IO exception on write to StringWriter"); return ""; } }
| 1,122,689
|
final public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch(IOException e) { Engine.log.exception(e); Engine.log.warning( "Include: evaluate got IO exception on write to StringWriter"); return ""; } }
|
final public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString(context.getEncoding()); } catch(IOException e) { Engine.log.exception(e); Engine.log.warning( "Include: evaluate got IO exception on write to StringWriter"); return ""; } }
| 1,122,690
|
public void setColumnNames(String[] colNames){ _colNames = colNames; }
|
public void setColumnNames(String[] colNames){ if (_caseSensitive){ _colNames = colNames; } else { _colNames = new String[colNames.length]; for (int i=0; i<colNames.length; i++){ _colNames[i] = colNames[i].toUpperCase(); } } }
| 1,122,691
|
public GatewayButton(final Transport transport) { setLayout(new GridBagLayout()); setOpaque(false); this.transport = transport; final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); final JPanel commandPanel = statusBar.getCommandPanel(); button.setIcon(transport.getInactiveIcon()); button.setToolTipText(transport.getInstructions()); commandPanel.add(button); statusBar.invalidate(); statusBar.validate(); statusBar.repaint(); button.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent mouseEvent) { handlePopup(mouseEvent); } }); // Send directed presence if registered with this transport. final boolean isRegistered = TransportUtils.isRegistered(SparkManager.getConnection(), transport); if (isRegistered) { // Check if auto login is set. boolean autoJoin = TransportUtils.autoJoinService(transport.getServiceName()); if (autoJoin) { Presence presence = statusBar.getPresence(); presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } } }
|
public GatewayButton(final Transport transport) { setLayout(new GridBagLayout()); setOpaque(false); this.transport = transport; final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); final JPanel commandPanel = statusBar.getCommandPanel(); button.setIcon(transport.getInactiveIcon()); button.setToolTipText(transport.getInstructions()); commandPanel.add(button); statusBar.invalidate(); statusBar.validate(); statusBar.repaint(); button.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent mouseEvent) { handlePopup(mouseEvent); } }); // Send directed presence if registered with this transport. final boolean isRegistered = TransportUtils.isRegistered(SparkManager.getConnection(), transport); if (isRegistered) { // Check if auto login is set. boolean autoJoin = TransportUtils.autoJoinService(transport.getServiceName()); if (autoJoin) { Presence oldPresence = statusBar.getPresence(); Presence presence = new Presence(oldPresence.getType(), oldPresence.getStatus(), oldPresence.getPriority(), oldPresence.getMode()); presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } } }
| 1,122,695
|
public static XmlBeanDefinitionReader createBeanDefinitionReader( SpringApplicationContext applicationContext, BeanDefinitionRegistry registry, List xmlPreprocessors) { String version = SpringVersion.getVersion(); String className = "org.apache.xbean.spring.context.v" + version.charAt(0) + ".XBeanXmlBeanDefinitionReader"; try { Class cl = Class.forName(className); Constructor cstr = cl.getConstructor(new Class[] { SpringApplicationContext.class, BeanDefinitionRegistry.class, List.class }); return (XmlBeanDefinitionReader) cstr.newInstance(new Object[] { applicationContext, registry, xmlPreprocessors }); } catch (Exception e) { throw (IllegalStateException) new IllegalStateException("Could not find valid implementation for: " + version).initCause(e); } }
|
public static XmlBeanDefinitionReader createBeanDefinitionReader( SpringApplicationContext applicationContext, BeanDefinitionRegistry registry, List xmlPreprocessors) { String version = "2.0"; try { Class spring20Clazz = Class.forName("org.springframework.core.AttributeAccessorSupport"); version = "2.0"; } catch(ClassNotFoundException e) { version = "1.2.8"; } String className = "org.apache.xbean.spring.context.v" + version.charAt(0) + ".XBeanXmlBeanDefinitionReader"; try { Class cl = Class.forName(className); Constructor cstr = cl.getConstructor(new Class[] { SpringApplicationContext.class, BeanDefinitionRegistry.class, List.class }); return (XmlBeanDefinitionReader) cstr.newInstance(new Object[] { applicationContext, registry, xmlPreprocessors }); } catch (Exception e) { throw (IllegalStateException) new IllegalStateException("Could not find valid implementation for: " + version).initCause(e); } }
| 1,122,696
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
| 1,122,697
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
| 1,122,698
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add( new File(baseDir, args[i])); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
| 1,122,699
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.isEmpty()) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
| 1,122,700
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
|
public Main(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); String baseDir = "."; Vector filesToMerge = new Vector(); // Go through all the parameters for (int i = 0; i < args.length; i++) { if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--basedir")) baseDir = args[++i]; else filesToMerge.add(baseDir + File.separator + args[i]); } // Load coverage data ProjectData projectData = null; if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); if (filesToMerge.size() == 0) { System.err.println("Error: No files were specified for merging."); System.exit(1); } // Merge everything Iterator iter = filesToMerge.iterator(); while (iter.hasNext()) { String newDataFileName = (String)iter.next(); File newDataFile = new File(newDataFileName); ProjectData projectDataNew = CoverageDataFileHandler .loadCoverageData(newDataFile); if (projectDataNew != null) projectData.merge(projectDataNew); } // Save the combined data file CoverageDataFileHandler.saveCoverageData(projectData, dataFile); }
| 1,122,701
|
private String handleError( Variable variable, Context context, Exception problem ) { String strError; ArrayList arlErrors = null; PropertyException propEx = null; if (problem instanceof PropertyException) propEx = (PropertyException)problem; else { propEx = new PropertyException( "Error expanding $" + variable.getVariableName()); propEx.setContextLocation(context.getCurrentLocation()); } strError = propEx.getMessage(); if ( context.containsKey( "WMERROR" ) ) { arlErrors = ( ArrayList ) context.get( "WMERROR" ); } else { arlErrors = new ArrayList(); context.put( "WMERROR", arlErrors ); } arlErrors.add( strError ); if ( _log != null ) { _log.warning( strError, problem ); } return errorString( strError ); }
|
private String handleError( Variable variable, Context context, Exception problem ) { String strError; ArrayList arlErrors = null; PropertyException propEx = null; if (problem instanceof PropertyException) propEx = (PropertyException)problem; else propEx = new PropertyException( "Error expanding $" + variable.getVariableName()); propEx.setContextLocation(context.getCurrentLocation()); } strError = propEx.getMessage(); if ( context.containsKey( "WMERROR" ) ) { arlErrors = ( ArrayList ) context.get( "WMERROR" ); } else { arlErrors = new ArrayList(); context.put( "WMERROR", arlErrors ); } arlErrors.add( strError ); if ( _log != null ) { _log.warning( strError, problem ); } return errorString( strError ); }
| 1,122,702
|
private String handleError( Variable variable, Context context, Exception problem ) { String strError; ArrayList arlErrors = null; PropertyException propEx = null; if (problem instanceof PropertyException) propEx = (PropertyException)problem; else { propEx = new PropertyException( "Error expanding $" + variable.getVariableName()); propEx.setContextLocation(context.getCurrentLocation()); } strError = propEx.getMessage(); if ( context.containsKey( "WMERROR" ) ) { arlErrors = ( ArrayList ) context.get( "WMERROR" ); } else { arlErrors = new ArrayList(); context.put( "WMERROR", arlErrors ); } arlErrors.add( strError ); if ( _log != null ) { _log.warning( strError, problem ); } return errorString( strError ); }
|
private String handleError( Variable variable, Context context, Exception problem ) { String strError; ArrayList arlErrors = null; PropertyException propEx = null; if (problem instanceof PropertyException) propEx = (PropertyException)problem; else { propEx = new PropertyException( "Error expanding $" + variable.getVariableName()); propEx.setContextLocation(context.getCurrentLocation()); } strError = propEx.getMessage(); if ( context.containsKey( "WMERROR" ) ) { arlErrors = ( ArrayList ) context.get( "WMERROR" ); } else { arlErrors = new ArrayList(); context.put( "WMERROR", arlErrors ); } arlErrors.add( strError ); if ( _log != null ) { _log.warning( strError, problem ); } return errorString( strError ); }
| 1,122,703
|
public void setEnabled(boolean enabled) { if (this.enabled != enabled) { this.enabled = enabled; if (headingItem != null) headingItem.setEnabled(enabled); } }
|
public void setEnabled(boolean enabled) { if (this.enabled != enabled) { this.enabled = enabled; if (headingItem != null && !headingItem.isDisposed()) headingItem.setEnabled(enabled); } }
| 1,122,704
|
public void update() { super.update(); if (headingItem != null && headingItem.isEnabled() != enabled) { headingItem.setEnabled(enabled); } }
|
public void update() { super.update(); if (headingItem != null && !headingItem.isDisposed() && headingItem.isEnabled() != enabled) { headingItem.setEnabled(enabled); } }
| 1,122,705
|
public void updateAll(boolean arg0) { super.updateAll(arg0); if (headingItem != null && headingItem.isEnabled() != enabled) { headingItem.setEnabled(enabled); } }
|
public void updateAll(boolean arg0) { super.updateAll(arg0); if (headingItem != null && !headingItem.isDisposed() && headingItem.isEnabled() != enabled) { headingItem.setEnabled(enabled); } }
| 1,122,706
|
public final void backup(int amount) { backupChars += amount; if (curBuf.curPos - amount < 0) { int addlChars = amount - 1 - curBuf.curPos; curBuf.curPos = 0; swapBuf(); curBuf.curPos = curBuf.dataLen - addlChars - 1; } else { curBuf.curPos -= amount; } }
|
public final void backup(int amount) { backupChars += amount; if (curBuf.curPos - amount < 0) { int addlChars = amount - (inputStreamClosed? 0 : 1) - curBuf.curPos; curBuf.curPos = 0; swapBuf(); curBuf.curPos = curBuf.dataLen - addlChars - 1; } else { curBuf.curPos -= amount; } }
| 1,122,709
|
protected WMTemplate(Broker broker) { _broker = broker; }
|
protected WMTemplate(Broker broker) { this(broker,"wm"); }
| 1,122,711
|
public Filter getFilter(String name) { return (Filter) myFilters.get(name); }
|
public Filter getFilter(String name) { return (Filter) _filters.get(name); }
| 1,122,712
|
public Object getParam(String key) throws IOException, TemplateException { // perform double checked lock in case template has not yet // been parsed. try { return myParameters.get(key); } catch (NullPointerException e) { synchronized(this) { parse(); return myParameters.get(key); } } }
|
public Object getParam(String key) throws IOException, TemplateException { // perform double checked lock in case template has not yet // been parsed. try { return _parameters.get(key); } catch (NullPointerException e) { synchronized(this) { parse(); return _parameters.get(key); } } }
| 1,122,713
|
public HashMap getParameters() { return myParameters; }
|
public HashMap getParameters() { return _parameters; }
| 1,122,714
|
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
|
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
| 1,122,715
|
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
|
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
| 1,122,716
|
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
|
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = _content; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
| 1,122,717
|
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
|
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (_content == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
| 1,122,718
|
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
|
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = _content; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = _content; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
| 1,122,719
|
final public Object get(Object name) { return (_globals != null) ? _globals.get(name) : null; }
|
final public Object get(Object name) { if (_globals != null) return _globals.get(name); if (_beanGet != null){ try { return _beanGet.invoke(_bean, new Object[]{ name }); } catch (Exception e){} } return null; }
| 1,122,720
|
final public void put(Object name, Object value) { if (_globals == null) { getGlobalVariables().put(name,value); } else { _globals.put(name,value); } }
|
final public void put(Object name, Object value) { if (_globals == null) { if (_beanPut != null){ try { _beanPut.invoke(_bean, new Object[]{ name, value }); } catch (Exception e){} } else { getGlobalVariables().put(name,value); } } else { _globals.put(name,value); } }
| 1,122,721
|
protected String renderQuotedBlock(String text) { StringBuffer sb = new StringBuffer (text.length()); sb.append ("<pre>") .append (text) .append ("</pre>"); return sb.toString (); }
|
protected String renderQuotedBlock(String text) { StringBuffer sb = new StringBuffer (text.length()); sb.append ("<pre>") .append (replace (replace (text, "<", "<"), ">", ">")) .append ("</pre>"); return sb.toString (); }
| 1,122,725
|
protected String renderUnknown(WikiData data) { return "<!-- " + data.getType() + " is an unknown WikiData type"; }
|
protected String renderUnknown(WikiData data) { return "<!-- " + data.getType() + " is an unknown WikiData type -->"; }
| 1,122,726
|
public boolean isOwnerOrAdmin(Occupant occupant) { if (occupant != null) { String affiliation = occupant.getAffiliation(); if ("owner".equals(affiliation) || "admin".equals(affiliation)) { return true; } } return false; }
|
public boolean isOwnerOrAdmin(GroupChatRoom groupChatRoom, String nickname) { Occupant occupant = getOccupant(groupChatRoom, nickname); if (occupant != null) { String affiliation = occupant.getAffiliation(); if ("owner".equals(affiliation) || "admin".equals(affiliation)) { return true; } } return false; }
| 1,122,728
|
public boolean isModerator(Occupant occupant) { if (occupant != null) { String role = occupant.getRole(); if ("moderator".equals(role)) { return true; } } return false; }
|
public boolean isModerator(GroupChatRoom groupChatRoom, String nickname) { Occupant occupant = getOccupant(groupChatRoom, nickname); if (occupant != null) { String role = occupant.getRole(); if ("moderator".equals(role)) { return true; } } return false; }
| 1,122,729
|
public static String getVersion() { return "1.1.9.6"; }
|
public static String getVersion() { return "1.1.9.7"; }
| 1,122,730
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.