Datecomparator
In the below comparator is not working?
p1.getDate() this one returns a String format like 12241998 and i converted into dateformat after that i compared?but its not working plz help me?is possible to compare the dates Using compareTo method?
if there is any wrong in this code plz help me?
public class dateComparator implements Comparator {
public int compare(Object o1, Object o2) {
Person p1 = (Person) o1;
Person p2 = (Person) o2;
String newDate1;
String newDate2;
newDate1 = convertStringToDate(p1.getDate());
newDate2 = convertStringToDate(p1.getDate());
System.out.println((-1)*newDate1.compareTo(newDate2));
return newDate1.compareTo(newDate2);
public static String convertStringToDate(String date) {
String billCycleEDate= null;
SimpleDateFormat df = new SimpleDateFormat("MMddyyyy");
SimpleDateFormat df1 = new SimpleDateFormat("MM/dd/yyyy");
Date endDate;
try {
endDate = df.parse(date);
billCycleEDate = df1.format(endDate);
System.out.println(billCycleEDate);
return billCycleEDate;
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return billCycleEDate;
}
1) When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
Please format ant repost. Don't just copy/paste from here, though, because there's no indenting. Paste it from the properly indented version in your editor.
2) Define "doesn't work."
Similar Messages
-
Why is there an offset when using DateConvert with DateCompare?
I'm developing on my local server and my current timezone is GMT +11 hours.
<cfset date1 = DateConvert("Local2UTC", now())>
<cfset date2 = '2014-03-06'> <!--- (Tomorrow at time of writing) --->
So, I was expecting that when I ran this code:
#DateCompare(date1,date2,'d' )#
that it would return a "-1" but it returned a "0" implying that the "day" was the same.
So, to double check I output:
DateConvert("Local2UTC", now())
grabbed its displayed value : {ts '2014-03-05 07:08:58'} and inserted that for comparison thus:
DateCompare("{ts '2014-03-05 07:08:58'}",date2,'d' ) and sure enough, it did return a "-1" reflecting that the day of date1 is indeed earlier than date 2.
Further investigation showed that I had to add my timezone difference to date2 in hours thus:
<cfset date2 = '2014-03-06 11:00:00> to get
#DateCompare(date1,date2,'d' )#
to return a "-1".
Is this a bug or am I misinterpreting??Hmmm, like with like and all other good practices aside, there is a bug. Also, like just about everyone else, I develop locally in one timezone +10 hours and run my sites remotely on a different timezone -5 hours, altogether a significant time difference. So after coming to understand how to deal with the bug I've come up with a way to compare dateTimes on the remote server, but it does require a spot of copying a string in where you've been advising not to.
First, to the dateCompare() bug. To expose the bug we better use a finer increment than days, so instead of specifying, simply leave the “datepart” attribute empty so that it defaults to seconds. You say you’re in a +1hour timezone so try this.
Presuming a local time of 16:00 on August 7th 2014
<cfset date1 = DateConvert('local2Utc', now())>
<cfdump var="#date1#"> should produce {ts '2014-08-07 15:00:00'}
Now create a dateTime using CreateDateTime(2014,08,07,15,30,00) This time half way between your local dateTime and UTCDateTIme.
<cfset date2 = CreateDateTime(2014,08,07,15,30,00)>
Now compare them <cfdump var="# DateCompare(date1, date2 )#> in this example on your local server, you would expect to return a -1 since date1 is earlier, but in fact it will return a +1 because it seems to be somehow only looking at the now() time (later) instead of the UTC converted time. This is a bug, DateCompare should not care where it gets its data from it should simply get it and then compare the two values. Usually there is no problem using dateCompare but when used in conjunction with the DateConvert('local2Utc', now()) it ignores the value generated by the conversion. Anyway, so much for the bug, Now to the procedure that I’m using that requires copying a string.
I’m wishing to compare a dateTime that I want something to stop being displayed on the remote server.
<cfset myDate = CreateDateTime(2014,08,05,17,0,0)>
<cfset myDateInUTC = DateAdd("s", GetTimeZoneInfo().UTCTotalOffset, myDate)>
<cfdump var="#myDateInUTC#">
This produces the string: {ts '2014-08-15 07:00:00'} .
I then generate currentUTCDateTime from:
<cfset currentUTCDateTime = DateAdd("s", GetTimeZoneInfo().UTCTotalOffset, now())>
Both these dates are then compared thus:
DateCompare(currentUTCDateTime, "{ts '2014-08-07 15:00:00'}" )
I have to generate the string on my local server and then upload it which is why I’m unable to simply use a function. It’s a bit convoluted but it does work. Note that in this example I’m setting the currentUTCDateTime using DateAdd instead which doesn’t trip up like DateConvert. -
Multi-date range within single report
I'm hoping you all find this a very basic question. I have two columns of data which I want to review for 2 different time periods on the same report. In this case I am looking at individuals scores in two performance metrics for the prior 6 weeks and then for the current week. I would like to have the 4 culumns total displayed side by side for each individual. I hope I am making sense. Can anyone give me some guidance on this?
Nevermind, My late night brain forgot about dual-query reports and I was able to do just what I wanted.
Edited by: Sarah Negovetich on Aug 7, 2008 11:28 PMYet another method...
<cfset start_date = DateFormat('01/01/2007',
'mm/dd/yyyy')>
<cfset end_date = DateFormat('09/30/2009',
'mm/dd/yyyy')>
<cfset start_year = DatePart('yyyy', start_date)>
<cfset end_year = DatePart('yyyy', end_date)>
<cfset schoolyear_start = '09/01/'>
<cfset schoolyear_end = '06/30/'>
<cfset count = 0>
<cfloop index="rec" from="#start_year#"
to="#end_year#">
<cfset tmp_start = DateFormat('#schoolyear_start##rec#',
'mm/dd/yyyy')>
<cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
'mm/dd/yyyy')>
<cfif DateCompare(tmp_start,start_date) gt -1 and
DateCompare(tmp_end, end_date) eq -1>
<cfset count = count + 1>
</cfif>
</cfloop>
<cfoutput>
<br>There are #count# school year periods between
#start_date# and #end_date#
</cfoutput> -
Compare dates....
Hi,
I have a question. I have to get information out of a Novell
database using LDAP. One thing is the "LastRegisteredTime" all that
is possibble and it give the dat like this:
20060507072033Z To us e this date I had to rearrange it a
little bit...
So it ends up like this:
2006-05-07.
What I really want to do is to compare this date with the
current date... And if the date has another (earlyer) year or a
month value of two months earlier then the current month (in the
same year)... Then I would like to show the data for these
records...
Currently I made something like this:
However it still doesn't do what I want:
<cfset jaar1 = DateFormat(Now(), "YYYY-MM-DD")>
<cfldap action="QUERY"
name="qtest"
attributes="cn, wMNAMEUser, zENINVSerialNumber,
ZENINVlastscandate, wMLastRegisteredTime, lastLoginTime"
start=""
scope="SUBTREE"
filter="objectClass=Workstation"
server=""
>
<!--- last registered date bewerken--->
<cfset jaar= left(qtest.wMLastRegisteredTime, 4)>
<cfset maand= Mid(qtest.wMLastRegisteredTime,5,2)>
<cfset dag= Mid(qtest.wMLastRegisteredTime,7,2)>
<cfset datum = #DateFormat(CreateDate(jaar, maand, dag),
"yyyy-mm-dd")#>
<cfloop query="qtest">
<cfset jaar= left(qtest.wMLastRegisteredTime, 4)>
<cfset maand= Mid(qtest.wMLastRegisteredTime,5,2)>
<cfset dag= Mid(qtest.wMLastRegisteredTime,7,2)>
<cfset datum = #DateFormat(CreateDate(jaar, maand, dag),
"yyyy-mm-dd")#>
<cfset comparison = DateCompare(datum, jaar1)>
<cfswitch expression = #comparison#>
<cfcase value = "-1">
<h3><cfoutput>#DateFormat(datum)#
</cfoutput> (Date 1) is
earlier than <cfoutput>#DateFormat(jaar1)#
</cfoutput> (Date 2)</h3>
<I>The dates are not equal</I>
</cfcase>
<cfcase value = "0">
<h3><cfoutput>#DateFormat(datum)#
</cfoutput> (Date 1) is equal
to <cfoutput>#DateFormat(jaar1)#
</cfoutput> (Date 2)</h3>
<I>The dates are equal!</I>
</cfcase>
<cfcase value = "1">
<h3><cfoutput>#DateFormat(datum)#
</cfoutput> (Date 1) is later
than <cfoutput>#DateFormat(jaar1)#
</cfoutput> (Date 2)</h3>
<I>The dates are not equal</I>
</cfcase>
<CFDEFAULTCASE>
<h3>This is the default case</h3>
</CFDEFAULTCASE>
</cfswitch>
</loop>
Is there somebody who could help me? The yyy-mm-dd notation
is usable in MySQL, but it is not a Coldfusion date I believe??
(maybe?). Could that also be a problem?
Hopefully somebody understands what I mean.
Thank you in advance.
Regards,
KabbiIf qTest.LastRegisteredTime is this:
20060507072033Z
You can do this
<cfset myDate = CreateDate(left(qTest.LastRegisteredTime,
4),
mid(qTest.LastRegisteredTime, 5, 2),
mid(qTest.LastRegisteredTime, 7, 2)>
For this part:
And if the date has another (earlyer) year or a month value
of two months earlier then the current month (in the same year)..
Do this
<cfif datediff("yyyy", mydate, now()) gte 1
or
( datediff("m", mydate, now()) gte 2
and year(mydate) is year(now())
>
do something -
I have an input on a form set to default to todays date. I
want to check to see if the date is less than todays date and if so
just set it to todays date. I cannot figure out how to do this.
Here is my code.
<body>
<cfset todayDate = now()>
<cfquery name="suidsearch" datasource="bldgaccess">
select * from SU_IDs
where EmpNumber = '#suid#'
</cfquery>
<table border="0" cellpadding="0" cellspacing="0"
width="1109" leftmargin="0">
<tr>
<td width="84" height=21 class=pad5 style="BORDER-TOP:
#ccc 1px dotted; font-weight:bold"><span class="pad5"
style="BORDER-TOP: #ccc 1px dotted;
font-weight:bold"><cfoutput>#form.suid#</cfoutput></span></td>
<td width="104" align="left" class=pad5
style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span
class="pad5" style="BORDER-TOP: #ccc 1px dotted;
font-weight:bold"><cfoutput>#form.Name#</cfoutput></span></td>
<td width="161" height=21 align="left" class=pad5
style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span
class="pad5" style="BORDER-TOP: #ccc 1px dotted;
font-weight:bold"><cfoutput>#form.bldgarea#</cfoutput></span></td>
<td width="760" align="left" class=pad5
style="BORDER-TOP: #ccc 1px dotted;
font-weight:bold"><cfoutput>#form.schedule#</cfoutput></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0"
width="1109" leftmargin="0">
<tr>
<td width="89" class=pad5>Start Date </td>
<td width="104" class=pad5>Exiration Date </td>
<td width="916" colspan="2"
class=pad5> </td>
</tr>
<tr>
<form name="form3" method="post"
action="confirmation.cfm" target="_self"><td height=21
class=pad5 style="BORDER-TOP: #ccc 1px dotted">
<cfoutput>
<input type="text" name="startdate" style="width:60"
value="#dateFormat( todayDate, "mm/dd/yyyy" )#">
</cfoutput>
If anyone has any ideas I would appreciate it. Thanks!Yup, I goofed. I gave you the wrong function. DateDiff tells
you how many 'x' difference there is between two dates. X indicates
years, months, days, hours, minutes, or seconds.
I should have given you datecompare().
Change this line:
<cfif datediff(dateFormat( todayDate, "mm/dd/yyyy" ),
startdate) lt 0>
to this line
<cfif datediff(datecompare( todayDate, "mm/dd/yyyy" ),
startdate) lt 0>
sorry about the confusion. -
Sort Column Date - DataGrid - Flex 4.5.1
Hi
I made download the function (below) to sort column date in DateGrid, but is not working
private function date_sortCompareFunc(itemA:
Object, itemB:Object):int
var dateA:Date=new Date(Date.parse(itemA.dob));
var dateB:Date=new Date(Date.parse(itemB.dob));
return ObjectUtil.dateCompare(dateA, dateB);
<s:GridColumn dataField="DATA_VENCIMENTO_ID"
width="115"
headerText="Data Vencimento"
dataTipFunction="date_sortCompareFunc">
someone can help me?
MarcosHi Marcos,
This forum here is for questions related to the LiveCycle Collaboration Service product.
You might want to post your question to the Flex forum:
http://forums.adobe.com/community/flex/flex_general_discussion
Hope this helps.
Good luck,
Julien
LCCS Quality Engineering -
Hi,
Is there a cold fusion function that checks the complete date (mm/dd/yyyy) against another compelete date (mm/dd/yyyy)?
I have used the DateCompare but it only checks the month, day or year depending on the precision being used.
Thanks,
MikeI think you might need to read the docs a bit more closely. From the docs for dateCompare():
datePart
Optional. String. Precision of the comparison.
s Precise to the second (default)
n Precise to the minute
h Precise to the hour
d Precise to the day
m Precise to the month
yyyy Precise to the year
Indeed, even by default its behaviour is not what you suggest it is.
Adam -
Hi all,
How can I compare a date in query of query? The date can be null in some records.
<cfquery name="qryData" dbtype="query">
select *
from qryTempData
where (datecompare(ppbe_id_expiration, dateFormat(now())) >= 0) OR (ppbe_id_expiration is NULL)
</cfquery>
I also try:
<cfquery name="qryData" dbtype="query">
select *
from qryTempData
where (ppbe_id_expiration is NULL) OR (cast(ppbe_id_expiration as date) >= cast(dateFormat(now(),'mm/dd/yyyy') as date)
</cfquery>
Using CF9.
Thanks,Couple suggestions:
In my experience QoQ does not store NULLs; instead they are stored as empty strings ('').
Try cfqueryparam: where (ppbe_id_expiration = <cfqueryparam value="" cfsqltype="cf_sql_varchar" />') OR (ppbe_id_expiration >= <cfqueryparam value="#now()#" cfsqltype="cf_sql_date" />)
Lastly, your code does not show how the original query was created. If it was manually created using QueryNew(), the data columns need to be defined as date contents, otherwise values are treated as strings and you need to match whatever row format the strings are saved (and adjust the cfqueryparam parameters to match). -
Re: Using ScopeCache custom tag
Hi, I am quite new to ColdFusion and I have a calendar that
is quite slow due to the cfloops it uses to build the calendar. As
the page does not change very often I wanted to use Raymond
Camden's ScopeCache custom tag. However, for some reason the custom
tag was not getting picked up from the custom tag folder on the
server. I have successfully used components so have tried to
convert the custom tag to a component but get the following error
message:
Routines cannot be declared more than once.
The routine scope_Cache has been declared twice in the same
file.
This is the component:
<!---
Name : scopeCache
Author : Raymond Camden ([email protected])
Created : December 12, 2002
Last Updated : November 6, 2003
History : Allow for clearAll (rkc 11/6/03)
: Added dependancies, timeout, other misc changes (rkc
1/8/04)
Purpose : Allows you to cache content in various scopes.
Documentation:
This tag allows you to cache content and data in various RAM
based scopes.
The tag takes the following attributes:
name/cachename: The name of the data. (required)
scope: The scope where cached data will reside. Must be
either session,
application, or server. (required)
timeout: When the cache will timeout. By default, the year
3999 (i.e., never).
Value must be either a date/time stamp or a number
representing the
number of seconds until the timeout is reached. (optional)
dependancies: This allows you to mark other cache items as
dependant on this item.
When this item is cleared or timesout, any child will also
be cleared.
Also, any children of those children will also be cleared.
(optional)
clear: If passed and if true, will clear out the cached
item. Note that
this option will NOT recreate the cache. In other words, the
rest of
the tag isn't run (well, mostly, but don't worry).
clearAll: Removes all data from this scope. Exits the tag
immidiately.
disabled: Allows for a quick exit out of the tag. How would
this be used? You can
imagine using disabled="#request.disabled#" to allow for a
quick way to
turn on/off caching for the entire site. Of course, all
calls to the tag
would have to use the same value.
License : Use this as you will. If you enjoy it and it helps
your application,
consider sending me something from my Amazon wish list:
http://www.amazon.com/o/registry/2TCL1D08EZEYE
--->
<cfcomponent>
<cffunction name="scope_Cache" access="public"
returntype="string">
<cfargument name="cachename" type="string"
required="yes">
<cfargument name="scope" type="string" required="yes">
<cfargument name="timeout" type="string"
required="yes">
<cfprocessingdirective pageencoding="utf-8">
<!--- allow for quick exit
<cfif isDefined("arguments.disabled") and
arguments.disabled>
<cfexit method="exitTemplate">
</cfif>
<!--- Allow for cachename in case we use cfmodule --->
<cfif isDefined("arguments.cachename")>
<cfset arguments.name = arguments.cachename>
</cfif>--->
<!--- Attribute validation --->
<cfif (not isDefined("arguments.name") or not
isSimpleValue(arguments.name)) and not
isDefined("arguments.clearall")>
<cfthrow message="scopeCache: The name attribute must be
passed as a string.">
</cfif>
<cfif not isDefined("arguments.scope") or not
isSimpleValue(arguments.scope) or not
listFindNoCase("application,session,server",arguments.scope)>
<cfthrow message="scopeCache: The scope attribute must be
passed as one of: application, session, or server.">
</cfif>
<!--- The default timeout is no timeout, so we use the
year 3999. --->
<cfparam name="arguments.timeout"
default="#createDate(3999,1,1)#">
<!--- Default dependancy list --->
<cfparam name="arguments.dependancies" default=""
type="string">
<cfif not isDate(arguments.timeout) and (not
isNumeric(arguments.timeout) or arguments.timeout lte 0)>
<cfthrow message="scopeCache: The timeout attribute must
be either a date/time or a number greather zero.">
<cfelseif isNumeric(arguments.timeout)>
<!--- convert seconds to a time --->
<cfset arguments.timeout =
dateAdd("s",arguments.timeout,now())>
</cfif>
<!--- create pointer to scope --->
<cfset ptr = structGet(arguments.scope)>
<!--- init cache root --->
<cfif not structKeyExists(ptr,"scopeCache")>
<cfset ptr["scopeCache"] = structNew()>
</cfif>
<cfif isDefined("arguments.clearAll")>
<cfset structClear(ptr["scopeCache"])>
<cfexit method="exitTag">
</cfif>
<!--- This variable will store all the guys we need to
update --->
<cfset cleanup = "">
<!--- This variable determines if we run the caching.
This is used when we clear a cache --->
<cfset dontRun = false>
<cfif isDefined("arguments.clear") and arguments.clear
and structKeyExists(ptr.scopeCache,arguments.name) and
thisTag.executionMode is "start">
<cfif
structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
<cfset cleanup =
ptr.scopeCache[arguments.name].dependancies>
</cfif>
<cfset structDelete(ptr.scopeCache,arguments.name)>
<cfset dontRun = true>
</cfif>
<cfif not dontRun>
<cfif thisTag.executionMode is "start">
<!--- determine if we have the info in cache already
--->
<cfif structKeyExists(ptr.scopeCache,arguments.name)>
<cfif
dateCompare(now(),ptr.scopeCache[arguments.name].timeout) is -1>
<cfif not isDefined("arguments.r_Data")>
<cfoutput>#ptr.scopeCache[arguments.name].value#</cfoutput>
<cfelse>
<cfset caller[arguments.r_Data] =
ptr.scopeCache[arguments.name].value>
</cfif>
<cfexit>
</cfif>
</cfif>
<cfelse>
<!--- It is possible I'm here because I'm refreshing. If
so, check my dependancies --->
<cfif structKeyExists(ptr.scopeCache,arguments.name) and
structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
<cfif
structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
<cfset cleanup = listAppend(cleanup,
ptr.scopeCache[arguments.name].dependancies)>
</cfif>
</cfif>
<cfset ptr.scopeCache[arguments.name] = structNew()>
<cfif not isDefined("arguments.data")>
<cfset ptr.scopeCache[arguments.name].value =
thistag.generatedcontent>
<cfelse>
<cfset ptr.scopeCache[arguments.name].value =
arguments.data>
</cfif>
<cfset ptr.scopeCache[arguments.name].timeout =
arguments.timeout>
<cfset ptr.scopeCache[arguments.name].dependancies =
arguments.dependancies>
<cfif isDefined("arguments.r_Data")>
<cfset caller[arguments.r_Data] =
ptr.scopeCache[arguments.name].value>
</cfif>
</cfif>
</cfif>
<!--- Do I need to clean up? --->
<cfset z = 1>
<cfloop condition="listLen(cleanup)">
<cfset z = z+1><cfif z gt 100><cfthrow
message="ack"></cfif>
<cfset toKill = listFirst(cleanup)>
<cfset cleanUp = listRest(cleanup)>
<cfif structKeyExists(ptr.scopeCache, toKill)>
<cfloop index="item"
list="#ptr.scopeCache[toKill].dependancies#">
<cfif not listFindNoCase(cleanup, item)>
<cfset cleanup = listAppend(cleanup, item)>
</cfif>
</cfloop>
<cfset structDelete(ptr.scopeCache,toKill)>
</cfif>
</cfloop>
<cfreturn scope_Cache>
</cffunction>
</cfcomponent>Hi, thanks to both of you for your help. I reverted back the
custom tag and it was picked up this time - I don't know what
happened before. The functionality works as expected but I have hit
another problem and I am hoping I can tap your combined ColdFusion
wisdom to solve!!
The calendar returns leave records for staff and filters the
records using a querystring variable appended when the user clicks
on a particular month. However, what members of staff the user sees
depends on the data held in the users' session variables based on
their authority. The reason I wanted to use caching is because the
page takes a good ten seconds to run because of the use of cfloops
for the members of staff and the days of the week to dynamically
build the page. Using the custom tag would have worked if all
members of staff saw the same calendar data and could only see one
month. Can you see anyway I can speed up the page and do you think
caching is the way forward here? -
XRTSGenerator & XRTSMakeBundle resolution failed
While installing OWB, installation fails abruptly with the following logs -
<snip>
Before processing LOADJAVA Token
... I am in processLoadJavaToken ...
arguments: '-verbose' '-order' '-resolve' '-thin' '-u' 'PARIS_REP_OWNER/PARIS_REP_OWNER@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SEARCH3.INTERNAL)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=DWADM)))' '../../lib/int/naclient.jar' '../../lib/int/NameAddrIntf.jar' '../../lib/int/namsg.jar' '../../lib/int/nameAddrRts.jar' '../../../jlib/rts2.jar' '../../../jlib/share.jar'
identical: META-INF/MANIFEST.MF
creating : class oracle/wh/nas/client/NAContext
loading : class oracle/wh/nas/client/NAContext
creating : class oracle/wh/nas/client/NASvrConnection
loading : class oracle/wh/nas/client/NASvrConnection
creating : class oracle/wh/nas/client/NASvrRuntimeStatus
loading : class oracle/wh/nas/client/NASvrRuntimeStatus
creating : class oracle/wh/nas/client/NameAddr
loading : class oracle/wh/nas/client/NameAddr
creating : class oracle/wh/nas/client/SocketOpener
loading : class oracle/wh/nas/client/SocketOpener
identical: META-INF/MANIFEST.MF
creating : class oracle/wh/nas/sdk/NameAddrIntf
loading : class oracle/wh/nas/sdk/NameAddrIntf
identical: META-INF/MANIFEST.MF
creating : class oracle/wh/nas/msg/NAComponent
loading : class oracle/wh/nas/msg/NAComponent
creating : class oracle/wh/nas/msg/NAInput
loading : class oracle/wh/nas/msg/NAInput
creating : class oracle/wh/nas/msg/NAMsgUtil$ComponentInfo
loading : class oracle/wh/nas/msg/NAMsgUtil$ComponentInfo
creating : class oracle/wh/nas/msg/NAMsgUtil
loading : class oracle/wh/nas/msg/NAMsgUtil
creating : class oracle/wh/nas/msg/NAOptions
loading : class oracle/wh/nas/msg/NAOptions
creating : class oracle/wh/nas/msg/Nls
loading : class oracle/wh/nas/msg/Nls
creating : class oracle/wh/nas/msg/ParseReply
loading : class oracle/wh/nas/msg/ParseReply
identical: META-INF/MANIFEST.MF
creating : class oracle/wh/resource/nas/NameAddrExceptions
loading : class oracle/wh/resource/nas/NameAddrExceptions
creating : class oracle/wh/resource/nas/NameAddrRes
loading : class oracle/wh/resource/nas/NameAddrRes
creating : resource META-INF/MANIFEST.MF
loading : resource META-INF/MANIFEST.MF
creating : class oracle/bali/rts/tools/RTSToXRTS
loading : class oracle/bali/rts/tools/RTSToXRTS
creating : class oracle/bali/rts/tools/XRTSParser
loading : class oracle/bali/rts/tools/XRTSParser
creating : class oracle/bali/rts/tools/XRTSParser$Tuple
loading : class oracle/bali/rts/tools/XRTSParser$Tuple
creating : class oracle/bali/rts/tools/DefaultSubkeyRTSWriter
loading : class oracle/bali/rts/tools/DefaultSubkeyRTSWriter
creating : class oracle/bali/rts/tools/RTSMakeBundle
loading : class oracle/bali/rts/tools/RTSMakeBundle
creating : class oracle/bali/rts/tools/MakeLeafNodes
loading : class oracle/bali/rts/tools/MakeLeafNodes
creating : class oracle/bali/rts/tools/RTSProperties
loading : class oracle/bali/rts/tools/RTSProperties
creating : class oracle/bali/rts/tools/RTSProperties$_MutableResult
loading : class oracle/bali/rts/tools/RTSProperties$_MutableResult
creating : class oracle/bali/rts/tools/ListRTSWriter
loading : class oracle/bali/rts/tools/ListRTSWriter
creating : class oracle/bali/rts/tools/XRTSGenerator
loading : class oracle/bali/rts/tools/XRTSGenerator
creating : class oracle/bali/rts/tools/OrderedDictionary
loading : class oracle/bali/rts/tools/OrderedDictionary
creating : class oracle/bali/rts/tools/XRTSMakeBundle
loading : class oracle/bali/rts/tools/XRTSMakeBundle
creating : class oracle/bali/rts/tools/RTSWriter
loading : class oracle/bali/rts/tools/RTSWriter
creating : class oracle/bali/rts/tools/UnicodeEscapes
loading : class oracle/bali/rts/tools/UnicodeEscapes
creating : class oracle/bali/rts/tools/XRTSParser$1
loading : class oracle/bali/rts/tools/XRTSParser$1
creating : resource oracle/bali/rts/tools/Config.txt
loading : resource oracle/bali/rts/tools/Config.txt
creating : resource oracle/bali/rts/tools/LeafNodes.txt
loading : resource oracle/bali/rts/tools/LeafNodes.txt
creating : class oracle/bali/rts/DefaultSubkeyResourceBundle
loading : class oracle/bali/rts/DefaultSubkeyResourceBundle
creating : class oracle/bali/rts/DefaultSubkeyResourceBundle$1
loading : class oracle/bali/rts/DefaultSubkeyResourceBundle$1
creating : class oracle/bali/rts/EmptyResourceBundle
loading : class oracle/bali/rts/EmptyResourceBundle
creating : class oracle/bali/rts/EmptyResourceBundle$EmptyEnumeration
loading : class oracle/bali/rts/EmptyResourceBundle$EmptyEnumeration
creating : class oracle/bali/rts/MultiResourceBundle
loading : class oracle/bali/rts/MultiResourceBundle
creating : class oracle/bali/rts/SubkeyResourceBundle
loading : class oracle/bali/rts/SubkeyResourceBundle
creating : class oracle/bali/rts/SubkeyResourceBundle$EncapsulatedBundle
loading : class oracle/bali/rts/SubkeyResourceBundle$EncapsulatedBundle
creating : resource oracle/bali/rts/xmldtd/rts.dtd
loading : resource oracle/bali/rts/xmldtd/rts.dtd
creating : resource oracle/bali/rts/2_0_6
loading : resource oracle/bali/rts/2_0_6
identical: META-INF/MANIFEST.MF
creating : class oracle/bali/share/collection/LRUCache
loading : class oracle/bali/share/collection/LRUCache
creating : class oracle/bali/share/collection/LRUCache$LRUNode
loading : class oracle/bali/share/collection/LRUCache$LRUNode
creating : class oracle/bali/share/collection/SingleItemEnumeration
loading : class oracle/bali/share/collection/SingleItemEnumeration
creating : class oracle/bali/share/collection/EveryOtherEnumeration
loading : class oracle/bali/share/collection/EveryOtherEnumeration
creating : class oracle/bali/share/collection/DictionaryKeyValueEnumeration
loading : class oracle/bali/share/collection/DictionaryKeyValueEnumeration
creating : class oracle/bali/share/collection/StringKey
loading : class oracle/bali/share/collection/StringKey
creating : class oracle/bali/share/collection/CompoundEnumeration
loading : class oracle/bali/share/collection/CompoundEnumeration
creating : class oracle/bali/share/collection/ArrayEnumeration
loading : class oracle/bali/share/collection/ArrayEnumeration
creating : class oracle/bali/share/collection/ArrayMap
loading : class oracle/bali/share/collection/ArrayMap
creating : class oracle/bali/share/collection/ImmutableArray
loading : class oracle/bali/share/collection/ImmutableArray
creating : class oracle/bali/share/collection/OptimisticHashMap
loading : class oracle/bali/share/collection/OptimisticHashMap
creating : class oracle/bali/share/collection/OptimisticHashMap$Entry
loading : class oracle/bali/share/collection/OptimisticHashMap$Entry
creating : class oracle/bali/share/collection/OptimisticHashMap$Enumerator
loading : class oracle/bali/share/collection/OptimisticHashMap$Enumerator
creating : class oracle/bali/share/collection/Range
loading : class oracle/bali/share/collection/Range
creating : class oracle/bali/share/collection/Range$RangeComparator
loading : class oracle/bali/share/collection/Range$RangeComparator
creating : class oracle/bali/share/util/ClassLoaderUtils
loading : class oracle/bali/share/util/ClassLoaderUtils
creating : class oracle/bali/share/util/Timing
loading : class oracle/bali/share/util/Timing
creating : class oracle/bali/share/util/UnhandledException
loading : class oracle/bali/share/util/UnhandledException
creating : class oracle/bali/share/util/IntegerUtils
loading : class oracle/bali/share/util/IntegerUtils
creating : class oracle/bali/share/util/BooleanUtils
loading : class oracle/bali/share/util/BooleanUtils
creating : class oracle/bali/share/util/WrappingThrowable
loading : class oracle/bali/share/util/WrappingThrowable
creating : class oracle/bali/share/datatransfer/CompoundTransferable
loading : class oracle/bali/share/datatransfer/CompoundTransferable
creating : class oracle/bali/share/datatransfer/TransferUtils
loading : class oracle/bali/share/datatransfer/TransferUtils
creating : class oracle/bali/share/datatransfer/ObjectTransferable
loading : class oracle/bali/share/datatransfer/ObjectTransferable
creating : class oracle/bali/share/datatransfer/ObjectTransferable$UpFront
loading : class oracle/bali/share/datatransfer/ObjectTransferable$UpFront
creating : class oracle/bali/share/thread/TaskScheduler
loading : class oracle/bali/share/thread/TaskScheduler
creating : class oracle/bali/share/thread/TaskScheduler$TaskQueue
loading : class oracle/bali/share/thread/TaskScheduler$TaskQueue
creating : class oracle/bali/share/thread/TaskScheduler$Element
loading : class oracle/bali/share/thread/TaskScheduler$Element
creating : class oracle/bali/share/thread/TaskEvent
loading : class oracle/bali/share/thread/TaskEvent
creating : class oracle/bali/share/thread/Timer
loading : class oracle/bali/share/thread/Timer
creating : class oracle/bali/share/thread/Task
loading : class oracle/bali/share/thread/Task
creating : class oracle/bali/share/thread/SchedulerEvent
loading : class oracle/bali/share/thread/SchedulerEvent
creating : class oracle/bali/share/thread/Periodic
loading : class oracle/bali/share/thread/Periodic
creating : class oracle/bali/share/thread/SchedulerListener
loading : class oracle/bali/share/thread/SchedulerListener
creating : class oracle/bali/share/beans/JavaPropertyEditorManager
loading : class oracle/bali/share/beans/JavaPropertyEditorManager
creating : class oracle/bali/share/beans/JavaIntrospector
loading : class oracle/bali/share/beans/JavaIntrospector
creating : class oracle/bali/share/beans/GenericBeanInfo
loading : class oracle/bali/share/beans/GenericBeanInfo
creating : class oracle/bali/share/event/ListenerManager
loading : class oracle/bali/share/event/ListenerManager
creating : class oracle/bali/share/sort/StringComparator
loading : class oracle/bali/share/sort/StringComparator
creating : class oracle/bali/share/sort/Search
loading : class oracle/bali/share/sort/Search
creating : class oracle/bali/share/sort/DateComparator
loading : class oracle/bali/share/sort/DateComparator
creating : class oracle/bali/share/sort/LexiComparator
loading : class oracle/bali/share/sort/LexiComparator
creating : class oracle/bali/share/sort/Comparator
loading : class oracle/bali/share/sort/Comparator
creating : class oracle/bali/share/sort/NumberComparator
loading : class oracle/bali/share/sort/NumberComparator
creating : class oracle/bali/share/sort/Sort
loading : class oracle/bali/share/sort/Sort
creating : class oracle/bali/share/sort/BooleanComparator
loading : class oracle/bali/share/sort/BooleanComparator
creating : class oracle/bali/share/Assert
loading : class oracle/bali/share/Assert
creating : class oracle/bali/share/nls/LocaleUtils
loading : class oracle/bali/share/nls/LocaleUtils
creating : class oracle/bali/share/nls/ArrayAvailableLocaleMapper
loading : class oracle/bali/share/nls/ArrayAvailableLocaleMapper
creating : class oracle/bali/share/nls/BundleAvailableLocaleMapper
loading : class oracle/bali/share/nls/BundleAvailableLocaleMapper
creating : class oracle/bali/share/nls/StringUtils
loading : class oracle/bali/share/nls/StringUtils
creating : class oracle/bali/share/nls/LocaleMapper
loading : class oracle/bali/share/nls/LocaleMapper
creating : class oracle/bali/share/nls/AvailableLocaleMapper
loading : class oracle/bali/share/nls/AvailableLocaleMapper
creating : class oracle/bali/share/io/CompositeReader
loading : class oracle/bali/share/io/CompositeReader
creating : resource oracle/bali/share/1_1_18
loading : resource oracle/bali/share/1_1_18
skipping : resource META-INF/MANIFEST.MF
resolving: class oracle/wh/nas/client/NAContext
resolving: class oracle/wh/nas/client/NASvrConnection
skipping : class oracle/wh/nas/client/NASvrRuntimeStatus
resolving: class oracle/wh/nas/client/NameAddr
skipping : class oracle/wh/nas/client/SocketOpener
skipping : resource META-INF/MANIFEST.MF
resolving: class oracle/wh/nas/sdk/NameAddrIntf
skipping : resource META-INF/MANIFEST.MF
skipping : class oracle/wh/nas/msg/NAComponent
skipping : class oracle/wh/nas/msg/NAInput
resolving: class oracle/wh/nas/msg/NAMsgUtil$ComponentInfo
skipping : class oracle/wh/nas/msg/NAMsgUtil
skipping : class oracle/wh/nas/msg/NAOptions
skipping : class oracle/wh/nas/msg/Nls
skipping : class oracle/wh/nas/msg/ParseReply
skipping : resource META-INF/MANIFEST.MF
resolving: class oracle/wh/resource/nas/NameAddrExceptions
resolving: class oracle/wh/resource/nas/NameAddrRes
skipping : resource META-INF/MANIFEST.MF
resolving: class oracle/bali/rts/tools/RTSToXRTS
resolving: class oracle/bali/rts/tools/XRTSParser
skipping : class oracle/bali/rts/tools/XRTSParser$Tuple
resolving: class oracle/bali/rts/tools/DefaultSubkeyRTSWriter
resolving: class oracle/bali/rts/tools/RTSMakeBundle
resolving: class oracle/bali/rts/tools/MakeLeafNodes
skipping : class oracle/bali/rts/tools/RTSProperties
skipping : class oracle/bali/rts/tools/RTSProperties$_MutableResult
resolving: class oracle/bali/rts/tools/ListRTSWriter
resolving: class oracle/bali/rts/tools/XRTSGenerator
errors : class oracle/bali/rts/tools/XRTSGenerator
ORA-29521: referenced name oracle/xml/parser/v2/SAXParser could not be found ORA-29521: referenced name oracle/xml/parser/v2/XMLParser could not be foundskipping : class oracle/bali/rts/tools/OrderedDictionary
resolving: class oracle/bali/rts/tools/XRTSMakeBundle
errors : class oracle/bali/rts/tools/XRTSMakeBundle
ORA-29521: referenced name oracle/xml/parser/v2/SAXParser could not be foundskipping : class oracle/bali/rts/tools/RTSWriter
skipping : class oracle/bali/rts/tools/UnicodeEscapes
skipping : class oracle/bali/rts/tools/XRTSParser$1
skipping : resource oracle/bali/rts/tools/Config.txt
skipping : resource oracle/bali/rts/tools/LeafNodes.txt
resolving: class oracle/bali/rts/DefaultSubkeyResourceBundle
skipping : class oracle/bali/rts/DefaultSubkeyResourceBundle$1
resolving: class oracle/bali/rts/EmptyResourceBundle
skipping : class oracle/bali/rts/EmptyResourceBundle$EmptyEnumeration
skipping : class oracle/bali/rts/MultiResourceBundle
skipping : class oracle/bali/rts/SubkeyResourceBundle
skipping : class oracle/bali/rts/SubkeyResourceBundle$EncapsulatedBundle
skipping : resource oracle/bali/rts/xmldtd/rts.dtd
skipping : resource oracle/bali/rts/2_0_6
skipping : resource META-INF/MANIFEST.MF
resolving: class oracle/bali/share/collection/LRUCache
skipping : class oracle/bali/share/collection/LRUCache$LRUNode
resolving: class oracle/bali/share/collection/SingleItemEnumeration
resolving: class oracle/bali/share/collection/EveryOtherEnumeration
resolving: class oracle/bali/share/collection/DictionaryKeyValueEnumeration
resolving: class oracle/bali/share/collection/StringKey
skipping : class oracle/bali/share/collection/CompoundEnumeration
resolving: class oracle/bali/share/collection/ArrayEnumeration
resolving: class oracle/bali/share/collection/ArrayMap
resolving: class oracle/bali/share/collection/ImmutableArray
resolving: class oracle/bali/share/collection/OptimisticHashMap
skipping : class oracle/bali/share/collection/OptimisticHashMap$Entry
skipping : class oracle/bali/share/collection/OptimisticHashMap$Enumerator
resolving: class oracle/bali/share/collection/Range
skipping : class oracle/bali/share/collection/Range$RangeComparator
resolving: class oracle/bali/share/util/ClassLoaderUtils
resolving: class oracle/bali/share/util/Timing
resolving: class oracle/bali/share/util/UnhandledException
skipping : class oracle/bali/share/util/IntegerUtils
resolving: class oracle/bali/share/util/BooleanUtils
skipping : class oracle/bali/share/util/WrappingThrowable
resolving: class oracle/bali/share/datatransfer/CompoundTransferable
resolving: class oracle/bali/share/datatransfer/TransferUtils
resolving: class oracle/bali/share/datatransfer/ObjectTransferable
skipping : class oracle/bali/share/datatransfer/ObjectTransferable$UpFront
resolving: class oracle/bali/share/thread/TaskScheduler
skipping : class oracle/bali/share/thread/TaskScheduler$TaskQueue
skipping : class oracle/bali/share/thread/TaskScheduler$Element
skipping : class oracle/bali/share/thread/TaskEvent
skipping : class oracle/bali/share/thread/Timer
skipping : class oracle/bali/share/thread/Task
skipping : class oracle/bali/share/thread/SchedulerEvent
resolving: class oracle/bali/share/thread/Periodic
skipping : class oracle/bali/share/thread/SchedulerListener
resolving: class oracle/bali/share/beans/JavaPropertyEditorManager
resolving: class oracle/bali/share/beans/JavaIntrospector
skipping : class oracle/bali/share/beans/GenericBeanInfo
skipping : class oracle/bali/share/event/ListenerManager
resolving: class oracle/bali/share/sort/StringComparator
resolving: class oracle/bali/share/sort/Search
resolving: class oracle/bali/share/sort/DateComparator
resolving: class oracle/bali/share/sort/LexiComparator
skipping : class oracle/bali/share/sort/Comparator
resolving: class oracle/bali/share/sort/NumberComparator
skipping : class oracle/bali/share/sort/Sort
resolving: class oracle/bali/share/sort/BooleanComparator
skipping : class oracle/bali/share/Assert
resolving: class oracle/bali/share/nls/LocaleUtils
resolving: class oracle/bali/share/nls/ArrayAvailableLocaleMapper
resolving: class oracle/bali/share/nls/BundleAvailableLocaleMapper
resolving: class oracle/bali/share/nls/StringUtils
skipping : class oracle/bali/share/nls/LocaleMapper
skipping : class oracle/bali/share/nls/AvailableLocaleMapper
resolving: class oracle/bali/share/io/CompositeReader
skipping : resource oracle/bali/share/1_1_18
The following operations failed
class oracle/bali/rts/tools/XRTSGenerator: resolution
class oracle/bali/rts/tools/XRTSMakeBundle: resolution
exiting : Failures occurred during processing
[oracle@search3 unix]$
<snip>
Above was from stdout.
AND FROM THE Installation log file tail.
<snip>
main.TaskScheduler timer[5]20050619@22:01:50.050: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): Before processing SQL Token
main.TaskScheduler timer[5]20050619@22:01:50.050: 00> oracle.wh.service.impl.assista
nt.DatabaseEngine.display(DatabaseEngine.java:251): user = PARIS_REP_OWNER, host
= SEARCH3.INTERNAL, port = 1521, serviceName =DWADM
main.TaskScheduler timer[5]20050619@22:01:50.050: 00> oracle.wh.service.impl.assista
nt.DatabaseEngine.display(DatabaseEngine.java:251): [getConnection]: Trying with oci
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.DatabaseEngine.display(DatabaseEngine.java:251): [getConnection]: Connected with
oci
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.RuntimeInstaller.display(RuntimeInstaller.java:584): parseSqlFile() ======= ente
r file: ../../browserasst/owbb/init_apps.sql
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): fileName =../../browserasst/owbb/
init_apps.sql
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): After processing SQL token
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): % = 87.17434869739499
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): -token name = LOADJAVA; -token t
ype = 16
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): Before processing LOADJAVA Token
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): ... I am in processLoadJavaToken
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): After processing LOADJAVA Token
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): % = 88.17635270541102
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): -token name = LOADJAVA; -token t
ype = 16
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): Before processing LOADJAVA Token
main.TaskScheduler timer[5]20050619@22:01:51.051: 00> oracle.wh.service.impl.assista
nt.ProcessEngine.display(ProcessEngine.java:1056): ... I am in processLoadJavaToken
<snip>
Any clue what could be wrong?
Thanks
PoojaAfter spending many hours, I managed to find the solution to this problem. Hopefully, I can save others the time. Here is a summary of the problem and solution:
Problem: OWB installation fails unexpectedly around 86%. The java window closes without error and the stdout console reports the following:
The following operations failed
class oracle/bali/rts/tools/XRTSGenerator: resolution
class oracle/bali/rts/tools/XRTSMakeBundle: resolution
Further up in the stdout listing are two ORA-29521 errors related to the XML parser.
Solution: The XML objects are either not installed in the database or their installation is incomplete. To fix, remove the XML objects and reinstall as follows:
1. log in as sysdba ("export {SID}; sqlplus / as sysdba")
2. enter "@$ORACLE_HOME/rdbms/admin/rmxml" and press enter. Wait for it to finish.
3. enter "@$ORACLE_HOME/rdbms/admin/initxml" and press enter. Wait for it to finish.
4. exit
Be sure to remove any failed OWB repositories before trying again. This may be accomplished via the repository assistant or, if all else fails, by dropping the user and all of the roles that start with "OWB". -
Hi,
I am using groupField in Advanced Datagird, in that i want sort the date field. The date field sees like that 06/22/1986(Month/Date/Year). How i can sort it.
Regards,
SivabharathiHi,
Thank you for your reply. I tried sortComparefunction. But it's not working perfect. Look at the example.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/08/12/sorting-date-columns-in-a-datagrid/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.events.FlexEvent;
import mx.utils.ObjectUtil;
public var reportXMLList:XMLList = new XMLList();
public var listCollection:XMLListCollection ;
private var tempXML:XML ;
private function date_sortCompareFunc(itemA:Object, itemB:Object):int {
var dateA:Date = new Date(Date.parse(itemA.dob));
var dateB:Date = new Date(Date.parse(itemB.dob));
return ObjectUtil.dateCompare(dateA, dateB);
protected function init():void
tempXML = new XML(<root>
<row col1="12/27/2010"/>
<row col1="12/29/2010"/>
<row col1="01/05/2011"/>
<row col1="01/07/2011"/>
<row col1="01/31/2011"/>
<row col1="02/15/2011"/>
<row col1="02/17/2011"/>
<row col1="02/18/2011"/>
<row col1="02/25/2011"/>
<row col1="03/11/2011"/>
<row col1="03/18/2011"/>
<row col1="03/19/2011"/>
<row col1="03/21/2011"/>
<row col1="03/22/2011"/>
<row col1="03/26/2011"/>
<row col1="03/30/2011"/>
<row col1="03/30/2010"/>
<row col1="03/30/2009"/>
<row col1="03/30/2015"/>
</root>);
reportXMLList = tempXML.row;
listCollection= new XMLListCollection(reportXMLList);
]]>
</mx:Script>
<mx:AdvancedDataGrid id="dataGrid" initialize="init()" dataProvider="{listCollection}"
width="100%" height="100%">
<mx:groupedColumns>
<mx:AdvancedDataGridColumn dataField="@col1"
headerText="Date of birth:"
sortCompareFunction="date_sortCompareFunc"
/>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
</mx:Application> -
Hi everybody - kinda new here. I was hired at a web design company last year and have recently taken to learning ColdFusion - so I'm not 100% on the syntax. I always need help with if statements, so I'm hoping you guys will be willing to spread some knowledge.
Anyway to put this in context:
What I'm working on is a Calendar that allows you to register to attend an event, such as a corporate dinner, holiday party, or some such nonsense. It also processes ticket purchases through a 3rd party such as PayPal, and would look something like this when put on a web-page.
Here's the code that creates that display.
<table class="registerTablePrices" cellspacing=5>
<cfloop query="registration_types">
<cfif registration_types.esl_price gte 0>
<tr>
<td class="formlabel" nowrap>#registration_types.estName#:</td>
<td><cfinput name="regType_#registration_types.estid#" style="width:30px" value="0"/></td>
<cfif registration_types.esl_price is 0>
<td class="formlabel"> X Free</td>
<cfelse>
<td class="formlabel" style="width:90px"> X #dollarformat(registration_types.esl_price)#</td>
</cfif>
<td class="labelInfo">Enter number of attendees for this type.</td>
</tr>
</cfif>
</cfloop>
</table>
All the code says at the moment is to display events whose price is positive, or else list them as free.
Here is what I want - I want to make it so that the May 30th Late Registration will automatically be hidden if the date is BEFORE or AFTER May 30th.
I have assigned values to the registration types that I want to restrict by date...
They are registration_types.estStartDate and registration_types.estEndDate
AND the value that designates it as Restricted, registration_types.estRestricted - which would be used like this.
<cfif registration_types.estRestricted is 1>
* Then only show it between registration_types.estStartDate and registration_types.estEndDate
And that's where I run into my problem. I can't make it work with the first code you saw:
<table class="registerTablePrices" cellspacing=5>
<cfloop query="registration_types">
<cfif registration_types.esl_price gte 0>
<tr>
<td class="formlabel" nowrap>#registration_types.estName#:</td>
<td><cfinput name="regType_#registration_types.estid#" style="width:30px" value="0"/></td>
<cfif registration_types.esl_price is 0>
<td class="formlabel"> X Free</td>
<cfelse>
<td class="formlabel" style="width:90px"> X #dollarformat(registration_types.esl_price)#</td>
</cfif>
<td class="labelInfo">Enter number of attendees for this type.</td>
</tr>
</cfif>
</cfloop>
</table>
I'm going to have at least 4 special conditions going on at once and I lose it there.
If you read all that I'm sorry, it may be hard to fully understand - I appreciate any help.I wasn't sure what you wanted to do. Perhaps, this:
<cfif (registration_types.esl_price gte 0)
or (registration_types.estRestricted is 1 and ((current_date ge estStartDate) and (current_date le estEndDate)))>
You can also compare the dates using dateCompare().
<cfset current_date = dateFormat(now(), "mm/dd/yyyy") />
<cfloop query="registration_types">
<cfif (registration_types.esl_price gte 0)
or (registration_types.estRestricted is 1 and ((current_date ge estStartDate) and (current_date le estEndDate)))>
#registration_types.estName#:
<cfinput name="regType_#registration_types.estid#" value="0"/>
<cfif registration_types.esl_price is 0>
X Free
<cfelse>
X #dollarformat(registration_types.esl_price)#
</cfif>
Enter number of attendees for this type.
</cfif>
</cfloop> -
My first lecture in "Programming Distributed Components" included this code listing:
import java.util.Date;
import java.util.Comparator;
import java.io.*;
public interface LogMessage
public Date getDate();
public String getMessage();
public String getSource();
public Comparator BY_DATE_DESC = new Comparator()
public int compare(Object o1, Object o2)
LogMessage lhs = (LogMessage) o1;
LogMessage rhs = (LogMessage) o2;
int dateCompare = rhs.getDate().compareTo(lhs.getDate());
if(dateCompare == 0)//in the event that dates are equal sort by message
{ //note - this is still a descending sort.
dateCompare = rhs.getMessage().compareTo(lhs.getMessage());
return dateCompare;
Call me stupid (please don't) but I was brought up to believe that java interfaces did not contain code implementation. Has the world gone mad or just my University lecturer? Or is it me? If the above code looks correct to you what is it that I am missing in my understanding of interfaces?
ThanksI've not come across anything like this before. The
interfaces I have seen have tended to be rather simple
affairs consisting of simple contant declarations and
method signatures.They usually are. Your professor is getting fancy on you. Perhaps the point is to make you question what you think you know.
This opens up to me some other questions such as what
limitations are placed on the use of such objects? If
an object is a constant does that mean all its members
are constants? Why no use of "final" in this context -
is it already implicit in interfaces?There are no constants in Java per se. There are finals, which are variables that cannot be assigned once. A final primitve is effectively a constant and a final reference to an immutable Object (like a String) is effectively a constant (for our purposes.) All variables in interfaces are implicitly static and final. -
Query WHERE statement to compare db record date
Hello
I can't get this where statement to work. I have it now so it is not throwing any errors, but it also isn't doing what it is supposed to.
I am trying to match records date in my table with the actual calendar date, if there is a match, my cfif will take that match, and make it a link in the proper date. (it is a small calendar with the month, and the days of week with dates, each date will be normal, accept if there is a record for that date, it makes a link.
This is my code, like I said, It doesn't throw an error, but it is not working either.
My Query:
<cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
SELECT events.eventDate, events.ID AS ID
FROM events
WHERE eventDate >= #CreateODBCDate("07/12/2005")# AND eventDate = #Days#
</cfquery>
This is the cfif statement:
<cfoutput query="CaleventRec">
<cfif Days EQ '#eventdate#'>
<a href = "detail.cfm?id=#ID#">#Days#</a>
</cfif>
</cfoutput>
this is all the code together:
<cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
SELECT events.eventDate, events.ID AS ID
FROM events
WHERE eventDate >= #CreateODBCDate("07/12/2005")# AND eventDate = #Days#
</cfquery>
<!--- Set the ThisDay variable to 0. This value will remain 0 until the day of the week on which the first day of the month falls on is reached. --->
<cfset ThisDay = 0>
<!--- Loop through until the number of days in the month is reached. --->
<cfloop condition = "ThisDay LTE Days">
<tr>
<!--- Loop though each day of the week. --->
<cfloop from = "1" to = "7" index = "LoopDay">
<!--- This turns each day into a hyperlink if it is a current or future date --->
<cfoutput query="CaleventRec">
<cfif Days EQ '#eventdate#'>
<a href = "detail.cfm?id=#ID#">#Days#</a>
</cfif>
</cfoutput>
<!---
If ThisDay is still 0, check to see if the current day of the week in the loop matches the day of the week for the first day of the month.
If the values match, set ThisDay to 1.
Otherwise, the value will remain 0 until the correct day of the week is found.
--->
<cfif ThisDay IS 0>
<cfif DayOfWeek(ThisMonthYear) IS LoopDay>
<cfset ThisDay = 1>
</cfif>
</cfif>
<!---
If the ThisDay value is still 0, or is greater than the number of days in the month, display nothing in the column. Otherwise, dispplay
the day of the mnth and increment the value.
--->
<cfif (ThisDay IS NOT 0) AND (ThisDay LTE Days)>
<cfoutput>
<!--- I choose to highlight the current day of the year using an IF-ELSE. --->
<cfif (#ThisDay# EQ #currentday#) AND (#month# EQ #startmonth#) AND (#year# EQ #startyear#)>
<td align = "center" bgcolor="##FFFF99">
<cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
<font class = "calendartoday">#ThisDay#</font>
</td>
<cfelse>
<td align = "center">
<cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
<font class = "calendar">#ThisDay#</font>
</td>
</cfif>
</cfoutput>
<cfset ThisDay = ThisDay + 1>
<cfelse>
<td></td>
</cfif>
</cfloop>
</tr>
</cfloop>
I know my where statement is incorrect, I am also not sure if my cfif statement is correct either. Can anyone help me figure this out?
thank you!
CFmongerAll the rest of the code works. The only part of this that doesn't work is the trying to make a link part.
Let me show you where I am, and what I did, then maybe you will see I am closer to the solution... I think. I made this calendar so you can cycle through the months. So if you are looking at June, you see Sun - Sat and the dates for each day of the week in the month of june. You can then choose to click the next button that will bring up the month of july, and you can keep on going as long as you want.
That is one function and it working as of right now. This Calendar also shows what day of the week we are on. If it is June 16th then June 16 is yellow. This also works.NOw, what I need to do it to have my query, not only filter out the records for the month, (if we are in June, then the Query separates out the records for June, the date in my DB is set to mm/dd/yyyy) This query also needs to match it to a number, the days of the month. So, if there is a record on the 25th of June, then the 25th of June will be a link to another page using it's ID in the address line. If you go to July and there are lets say 3 records for that month, then all 3 dates will become a link to the same other page using it's ID in the url.
This is what I have now. I tied the Query into the next / prev function so it filters the month, so far it seems to work, I can do a cfdump up to the point of my cfif statement and get the proper number from the date, my cfif is not firing so If I do a dump after it, it doesn't dump anyhting.
I will post JUST the query code, then post the whole calander code so you can see it all together.
The Query / link code:
<!--- This is part of the next / prev nav to cycle through the months --->
<cfset NextMonthYear = DateAdd('m', 1, ThisMonthYear)>
<cfset NextMonth = DatePart('m', NextMonthYear)>
<!--- My Query --->
<cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
SELECT events.eventDate, events.ID AS ID
FROM events
WHERE eventDate Between #NextMonthYear# and #NextMonth#
</cfquery>
<!--- my output / cfif stement --->
<cfoutput query="CaleventRec">
<cfset comparison = DateCompare('#dateFormat(eventDate, 'dd')#', '#Days#', 'd')>
<!--- When I do a cfdump here, I get the number of the first record with a day date in the DB for the month of june
<cfdump var="#dateFormat(eventDate, 'dd')#">
<cfabort>--->
<cfif #Days# EQ ('#dateFormat(eventDate, 'dd')#')>
<!--- When I do a dump here, I do not get anyhting, no numbers it doesn't fire
<cfdump var="#eventDate#">
<cfabort>--->
<a href = "detail.cfm?id=#ID#">#Days#</a>
</cfif>
</cfoutput>
ok, now that is the part to stream in the DB info into the calander.
Here is all the code, like I said, it all works, just not making each day a link that has a record in the DB.
<!--- Declaration of the variables --->
<cfparam name = "month" default = "#DatePart('m', Now())#">
<cfparam name = "year" default = "#DatePart('yyyy', Now())#">
<cfparam name = "currentday" default = "#DatePart('d', Now())#">
<cfparam name = "startmonth" default = "#DatePart('m', Now())#">
<cfparam name = "startyear" default = "#DatePart('yyyy', Now())#">
<!--- Set a requested (or current) month/year date and determine the number of days in the month. --->
<cfset ThisMonthYear = CreateDate(year, month, '1')>
<cfset Days = DaysInMonth(ThisMonthYear)>
<!--- Set the values for the previous and next months for the back/next links.--->
<cfset LastMonthYear = DateAdd('m', -1, ThisMonthYear)>
<cfset LastMonth = DatePart('m', LastMonthYear)>
<cfset LastYear = DatePart('yyyy', LastMonthYear)>
<cfset NextMonthYear = DateAdd('m', 1, ThisMonthYear)>
<cfset NextMonth = DatePart('m', NextMonthYear)>
<cfset NextYear = DatePart('yyyy', NextMonthYear)>
<cfset PreviousDay = DateAdd('d', -1, ThisMonthYear)>
<cfset CurrentYear = DatePart('yyyy', Now())>
<table border="0" width="100%" bgcolor ="#ffffff">
<tr>
<td align = "center" valign="top">
<table border="0" width="100%" height="100%">
<tr>
<th align="center" colspan="7" bgcolor="#2b4e6e">
<cfoutput>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" align="left" valign="middle">
<cfif (LastYear lt CurrentYear) OR (LastYear lte CurrentYear AND LastMonth lt startmonth)>
<cfelse>
<a href ="index.cfm?month=#LastMonth#&year=#LastYear#" class="calNav">Prev</a></cfif></td>
<td width="72%" align="center" valign="middle"><FONT SIZE="3" face="Arial, Helvetica, sans-serif" color="##ffffff">#MonthAsString(month)# #year#</FONT></td>
<td width="13%" align="right" valign="middle">
<cfif (NextYear lt CurrentYear) OR (NextYear lte CurrentYear AND NextMonth lt startmonth)>
<cfelse>
<a href = "index.cfm?month=#NextMonth#&year=#NextYear#" class="calNav">Next</a> </cfif></td>
</tr>
</table></cfoutput></th>
</tr>
<tr>
<td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Sun</FONT></td>
<td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Mon</FONT></td>
<td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Tue</FONT></td>
<td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Wed</FONT></td>
<td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Thu</FONT></td>
<td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Fri</FONT></td>
<td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Sat</FONT></td>
</tr>
<cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
SELECT events.eventDate, events.ID AS ID
FROM events
WHERE eventDate Between #NextMonthYear# and #NextMonth#
</cfquery>
<!--- Set the ThisDay variable to 0. This value will remain 0 until the day of the week on which the first day of the month falls on is reached. --->
<cfset ThisDay = 0>
<!--- Loop through until the number of days in the month is reached. --->
<cfloop condition = "ThisDay LTE Days">
<tr>
<!--- Loop though each day of the week. --->
<cfloop from = "1" to = "7" index = "LoopDay">
<!--- This turns each day into a hyperlink if it is a current or future date --->
<cfoutput query="CaleventRec">
<cfset comparison = DateCompare('#dateFormat(eventDate, 'dd')#', '#Days#', 'd')>
<cfdump var="#dateFormat(eventDate, 'dd')#">
<cfabort>
<cfif #Days# EQ ('#dateFormat(eventDate, 'dd')#')>
<cfdump var="#eventDate#">
<cfabort>
<a href = "detail.cfm?id=#ID#">#Days#</a>
</cfif>
</cfoutput>
<!---
If ThisDay is still 0, check to see if the current day of the week in the loop matches the day of the week for the first day of the month.
If the values match, set ThisDay to 1.
Otherwise, the value will remain 0 until the correct day of the week is found.
--->
<cfif ThisDay IS 0>
<cfif DayOfWeek(ThisMonthYear) IS LoopDay>
<cfset ThisDay = 1>
</cfif>
</cfif>
<!---
If the ThisDay value is still 0, or is greater than the number of days in the month, display nothing in the column. Otherwise, dispplay
the day of the mnth and increment the value.
--->
<cfif (ThisDay IS NOT 0) AND (ThisDay LTE Days)>
<cfoutput>
<!--- I choose to highlight the current day of the year using an IF-ELSE. --->
<cfif (#ThisDay# EQ #currentday#) AND (#month# EQ #startmonth#) AND (#year# EQ #startyear#)>
<td align = "center" bgcolor="##FFFF99">
<cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
<font class = "calendartoday">#ThisDay#</font>
</td>
<cfelse>
<td align = "center">
<cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
<font class = "calendar">#ThisDay#</font>
</td>
</cfif>
</cfoutput>
<cfset ThisDay = ThisDay + 1>
<cfelse>
<td></td>
</cfif>
</cfloop>
</tr>
</cfloop>
</table>
</td>
</tr>
</table>
It is kind of complicated and this is why I need help. Maybe I am wrong in the variables I am pulling, but like I say in my comments, so far I pulled the day part of the month I am in out of the records up until my cfif stement.Can this be done with what I have done so far? No need to rewrite the whole calander, just the part with the query if I miss what you are saying. -
Finding duplicates within a date range. SQL help please!!
I have a table of records and I am trying to query the duplicate emails that appear within a given date range but cant figure it out.
There records that it returns are not all duplicates withing the given date range. HELP!!
Here is my query.
Thanks in advance.
SELECT cybTrans.email, cybTrans.trans_id, cybTrans.product_number, cybTrans.*
FROM cybTrans
WHERE (((cybTrans.email) In (SELECT [email] FROM [cybTrans] As Tmp GROUP BY [email] HAVING Count(*)>1 ))
AND ((cybTrans.product_number)='27')
AND ((cybTrans.appsystemtime)>'03-01-2010')
AND ((cybTrans.appsystemtime)<'03-05-2010')
ORDER BY cybTrans.email;Yet another method...
<cfset start_date = DateFormat('01/01/2007',
'mm/dd/yyyy')>
<cfset end_date = DateFormat('09/30/2009',
'mm/dd/yyyy')>
<cfset start_year = DatePart('yyyy', start_date)>
<cfset end_year = DatePart('yyyy', end_date)>
<cfset schoolyear_start = '09/01/'>
<cfset schoolyear_end = '06/30/'>
<cfset count = 0>
<cfloop index="rec" from="#start_year#"
to="#end_year#">
<cfset tmp_start = DateFormat('#schoolyear_start##rec#',
'mm/dd/yyyy')>
<cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
'mm/dd/yyyy')>
<cfif DateCompare(tmp_start,start_date) gt -1 and
DateCompare(tmp_end, end_date) eq -1>
<cfset count = count + 1>
</cfif>
</cfloop>
<cfoutput>
<br>There are #count# school year periods between
#start_date# and #end_date#
</cfoutput>
Maybe you are looking for
-
Finder crashes when I try to access airport extreme 2tb
As of this afternoon when I try to access my airport extreme 2TB through Finder, Finder either crashes or becomes unresponsive. Any ideas why?
-
Customized products online shop with business catalyst
Hello, I'd like to create an online shop with business catalyst ni which my clients would be able to customized my products with text and photos. Do you know any way of doing that? Of course, i'm looking for something not too expensive and working we
-
Export procedure for intrastat purposes
Dear all, In Tcode Z*** is showing sales documents for which export procedure for intrastat purposes is no longer automatically determined in some case.Please let me know the possible reasons. Regards, Praveen
-
I have a Power Mac G5 Dual 2.7GHz, L2 Cache 512K per processor, Frontside bus - 1.35GHz, with 8GB of Ram. I was wondering how I could speed up this computer? It is constantly running the processor cores at 50% to 100% when doing the simplest task as
-
Flash Player 12 install problems - Opera 12 & FF26
Latest Flash Player (12.0.0.43), Win 8.1 x64 Pro - With Opera 12.16, the McAfee box wouldn't say unchecked. - With FF26, the install hung at second step. - With Opera webkit version (19 Next), the install process falsely says Google Chrome installed