Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Service Pages List Configuration Items

Highlighted
fgssl2
Regular Collector

Service Pages List Configuration Items

Hi,

I'm trying to create a listconfigurationitems.jsp file. It's the same as for service calls but it returns the ci's that a user uses. I know how to get the fields I want but I don't know how to fill out the v vector with the ci's. For service calls the function below is being called:

v = bean.servicecalls_full_list(); -- or restricted, depending on the type of list the user wants

But what about for Configuration Items? How can I get them?

Thanks in advance,
F
12 REPLIES
Vasily Kamenev
Honored Contributor

Re: Service Pages List Configuration Items

HI
How you like get CIs? What the restiction you like use: by Service, by Owner ...?

Vasily
fgssl2
Regular Collector

Re: Service Pages List Configuration Items

Hi,

I'm trying to have both this cases: one view that presents the ci's that are used by the person who logged in, and one view that presents the ci's used by the organization from wich the person who logged in is manager.

Thank you,
F
Vasily Kamenev
Honored Contributor

Re: Service Pages List Configuration Items

Hi
Add in you code
session = bean.sd_session();
IConfigurationItemWhere ciListWhere = session.getConfigurationItemHome().createConfigurationItemWhere();
ciListWhere.addCriteriumOnUsers(value);
IConfigurationItem ciList[] = session.getConfigurationItemHome().findConfigurationItem( ciListWhere );

Where value must be defined before by loggen IPerson.

Vasily
fgssl2
Regular Collector

Re: Service Pages List Configuration Items

Hi Vasily,

I inserted the code you wrote on lines 57 to 60 (see attach)

Can you tell me how can I get the IPerson object of the person who logged in and insert it in the variable "user"? Or where can I find the API that indicates me the methods for the bean?

Sorry but I'm new to java programming :(

Thank you,
F
Vasily Kamenev
Honored Contributor

Re: Service Pages List Configuration Items

Hi
bean.current_user_person();

Vasily
fgssl2
Regular Collector

Re: Service Pages List Configuration Items

Hi Vasily,

Thanks for your reply. By the way, where can I find the API for the bean methods like that "current_user_person()"? I searched in the API that comes with Service Desk and I didn't find those..

Anyway, I changed the code but I'm getting some errors. I attached the code and the errors... can you help me out?

Thank you very much..
F
fgssl2
Regular Collector

Re: Service Pages List Configuration Items

Hi Vasily,

I changed this:

session = bean.sd_session();
IConfigurationItemWhere ciListWhere = session.getConfigurationItemHome().createConfigurationItemWhere();
ciListWhere.addCriteriumOnUsers(user);
IConfigurationItem v[] = session.getConfigurationItemHome().findConfigurationItem ( ciListWhere );


to this:

//session = bean.sd_session();
IConfigurationItemWhere ciListWhere = bean.sd_session().getConfigurationItemHome().createConfigurationItemWhere();
ciListWhere.addCriteriumOnUsers(user);
IConfigurationItem v[] = bean.sd_session().getConfigurationItemHome().findConfigurationItem ( ciListWhere );

and now I get only this error:

C:\Program Files\Hewlett-Packard\OpenView\service desk 4.5\service pages\work\localhost\sd-sp45\ListServiceCalls$jsp.java:409: Exception com.hp.itsm.ssp.beans.NoViewException is never thrown in the body of the corresponding try statement.
} catch (NoViewException nvexc) {
^
1 error, 1 warning


What does this mean?

Thank you,
F
Vasily Kamenev
Honored Contributor

Re: Service Pages List Configuration Items

What in line 409 in your source?

Vasily
fgssl2
Regular Collector

Re: Service Pages List Configuration Items

Well the source code has 147 lines so I don't understand that. Anyway I think the error is when I do the catches of the tries:

<%
} catch (Throwable ignore) { ; }

} //end of if (v != null) {

} catch (Throwable e) {

e.printStackTrace();

%> <%= SdClientBean.filter_html_string(e.getMessage()) %> <%

}

%>

Thanks,
F
Vasily Kamenev
Honored Contributor

Re: Service Pages List Configuration Items

HI
look in file work\localhost\sd-sp45\ListServiceCalls$jsp.java:409
That other file, rebuild by Tomcat.

Vasily
fgssl2
Regular Collector

Re: Service Pages List Configuration Items

Hi Vasily,

Line 409 is a blank line.. then it comes line 410 to 418 (end of file):


} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}

I'm getting desperate here :(

Thanks,
F
fgssl2
Regular Collector

Re: Service Pages List Configuration Items

Hi,

I'm not able to get this to work.. can anybody help me out and check in the attach why this code returns error?

Thank you,
F
//Add this to "OnDomLoad" event