本文整理汇总了Java中org.sakaiproject.component.cover.ServerConfigurationService.getPortalUrl方法的典型用法代码示例。如果您正苦于以下问题:Java ServerConfigurationService.getPortalUrl方法的具体用法?Java ServerConfigurationService.getPortalUrl怎么用?Java ServerConfigurationService.getPortalUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sakaiproject.component.cover.ServerConfigurationService
的用法示例。
在下文中一共展示了ServerConfigurationService.getPortalUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTag
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* @inheritDoc
*/
protected String getTag(String title, boolean shouldUseHtml)
{
StringBuilder buf = new StringBuilder();
if (shouldUseHtml) {
buf.append("<br/><hr/><br/>");
String portalUrl = "<a href=\"" + ServerConfigurationService.getPortalUrl() + "\" >" + ServerConfigurationService.getPortalUrl() + "<a/>";
buf.append( MessageFormat.format( rb.getString("automsg1"),
new Object[]{ServerConfigurationService.getString("ui.service", "Sakai"),
portalUrl, title} ));
buf.append( "<br/>" + rb.getString("automsg2")+"<br/>" );
}
else {
buf.append("\n----------------------\n" );
buf.append( MessageFormat.format( rb.getString("automsg1"),
new Object[]{ServerConfigurationService.getString("ui.service", "Sakai"),
ServerConfigurationService.getPortalUrl(), title} ));
buf.append( "\n" + rb.getString("automsg2") + "\n" );
}
return buf.toString();
}
示例2: getEntityUrl
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public String getEntityUrl(Reference ref)
{
//Just return a URL to the top of the page based on the item's pageId and toolId
long id = idFromRef(ref.getReference());
SimplePageItem item = simplePageToolDao.findItem(id);
String URL = "";
if (item != null) {
URL = item.getURL();
if (URL == null || "".equals(URL) ) {
//Return a default as portal tool page for now
SimplePage currentPage = simplePageToolDao.getPage(item.getPageId());
URL = ServerConfigurationService.getPortalUrl()+"/site/"+currentPage.getSiteId()+"/page/"+currentPage.getToolId();
}
}
return URL;
}
示例3: getStatementForGrade
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private LRS_Statement getStatementForGrade(String studentUid, String forumTitle, double score)
throws UserNotDefinedException {
LRS_Actor instructor = learningResourceStoreService.getActor(SessionManager.getCurrentSessionUserId());
LRS_Verb verb = new LRS_Verb(SAKAI_VERB.scored);
LRS_Object lrsObject = new LRS_Object(ServerConfigurationService.getPortalUrl() + "/forums", "received-grade-forum");
HashMap<String, String> nameMap = new HashMap<String, String>();
nameMap.put("en-US", "User received a grade");
lrsObject.setActivityName(nameMap);
HashMap<String, String> descMap = new HashMap<String, String>();
descMap.put("en-US", "User received a grade for their forum post: " + forumTitle);
lrsObject.setDescription(descMap);
User studentUser = UserDirectoryService.getUser(studentUid);
LRS_Actor student = learningResourceStoreService.getActor(studentUser.getId());
student.setName(studentUser.getDisplayName());
LRS_Statement statement = new LRS_Statement(student, verb, lrsObject, getLRS_Result(score), null);
return statement;
}
示例4: getPodfeedGenerator
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Returns the global feed generator string.
*
* @param siteId
* The site id to get the feed description from
*
* @return String
* The global feed generator string.
*/
public String getPodfeedGenerator(String siteId) {
// Generator consists of 3 parts, first 2 pulled from sakai.properties:
// ui.service - institution name
// version.service - version number for the instance
// last part is url of this instance
final String localSakaiName = ServerConfigurationService.getString("ui.service","Sakai"); //localsakainame
final String versionNumber = ServerConfigurationService.getString("version.service", "?");//dev
final String portalUrl = ServerConfigurationService.getPortalUrl(); //last part exactly http://
final String generatorString = localSakaiName + " " + versionNumber + " " +
portalUrl.substring(0, portalUrl.lastIndexOf("/")+1);
return generatorString;
}
示例5: handleReturnUrl
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
protected void handleReturnUrl(HttpServletRequest request, HttpServletResponse response)
throws IOException
{
String lti_errorlog = request.getParameter("lti_errorlog");
if ( lti_errorlog != null ) log.error(lti_errorlog);
String lti_errormsg = request.getParameter("lti_errormsg");
if ( lti_errormsg != null ) log.error(lti_errormsg);
String lti_log = request.getParameter("lti_log");
if ( lti_log != null ) log.info(lti_log);
String lti_msg = request.getParameter("lti_msg");
if ( lti_msg != null ) log.info(lti_msg);
String message = rb.getString("outcome.tool.finished");
String gotMessage = "false";
if ( lti_msg != null ) {
message = rb.getString("outcome.tool.lti_msg") + " " + lti_msg;
gotMessage = "true";
} else if ( lti_errormsg != null ) {
message = rb.getString("outcome.tool.lti_errormsg") + " " + lti_errormsg;
gotMessage = "true";
}
String rpi = request.getPathInfo();
if ( rpi.length() > 11 ) rpi = rpi.substring(11);
String portalUrl = ServerConfigurationService.getPortalUrl();
portalUrl = portalUrl + rpi;
String output = returnHTML.replace("URL",portalUrl);
output = output.replace("GOTMESSAGE",gotMessage);
output = output.replace("MESSAGE",message);
output = output.replace("CLOSETEXT",rb.getString("outcome.tool.close.window"));
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println(output);
}
示例6: getStatementForUserReadViewed
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private LRS_Statement getStatementForUserReadViewed(String subject, String target) {
LRS_Actor student = learningResourceStoreService.getActor(SessionManager.getCurrentSessionUserId());
String url = ServerConfigurationService.getPortalUrl();
LRS_Verb verb = new LRS_Verb(SAKAI_VERB.interacted);
LRS_Object lrsObject = new LRS_Object(url + "/forums", "viewed-" + target);
HashMap<String, String> nameMap = new HashMap<String, String>();
nameMap.put("en-US", "User viewed " + target);
lrsObject.setActivityName(nameMap);
HashMap<String, String> descMap = new HashMap<String, String>();
descMap.put("en-US", "User viewed " + target + " with subject: " + subject);
lrsObject.setDescription(descMap);
return new LRS_Statement(student, verb, lrsObject);
}
示例7: determineBaseURL
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private URL determineBaseURL() {
String siteId = ToolManager.getCurrentPlacement().getContext();
String toolId = ToolManager.getCurrentPlacement().getId();
try {
return new URL(ServerConfigurationService.getPortalUrl() + "/site/" + siteId + "/tool/" + toolId + "/");
} catch (MalformedURLException e) {
throw new PASystemException("Couldn't determine tool URL", e);
}
}
示例8: getStatementForUserReadPvtMsg
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private LRS_Statement getStatementForUserReadPvtMsg(String subject) {
LRS_Actor student = learningResourceStoreService.getActor(SessionManager.getCurrentSessionUserId());
String url = ServerConfigurationService.getPortalUrl();
LRS_Verb verb = new LRS_Verb(SAKAI_VERB.interacted);
LRS_Object lrsObject = new LRS_Object(url + "/privateMessage", "read-private-message");
HashMap<String, String> nameMap = new HashMap<String, String>();
nameMap.put("en-US", "User read a private message");
lrsObject.setActivityName(nameMap);
HashMap<String, String> descMap = new HashMap<String, String>();
descMap.put("en-US", "User read a private message with subject: " + subject);
lrsObject.setDescription(descMap);
return new LRS_Statement(student, verb, lrsObject);
}
示例9: getStatementForUserSentPvtMsg
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private LRS_Statement getStatementForUserSentPvtMsg(String subject, SAKAI_VERB sakaiVerb) {
LRS_Actor student = learningResourceStoreService.getActor(SessionManager.getCurrentSessionUserId());
String url = ServerConfigurationService.getPortalUrl();
LRS_Verb verb = new LRS_Verb(sakaiVerb);
LRS_Object lrsObject = new LRS_Object(url + "/privateMessage", "send-private-message");
HashMap<String, String> nameMap = new HashMap<String, String>();
nameMap.put("en-US", "User sent a private message");
lrsObject.setActivityName(nameMap);
HashMap<String, String> descMap = new HashMap<String, String>();
descMap.put("en-US", "User sent a private message with subject: " + subject);
lrsObject.setDescription(descMap);
return new LRS_Statement(student, verb, lrsObject);
}
示例10: getSiteBaseUrl
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private String getSiteBaseUrl() {
return ServerConfigurationService.getPortalUrl() + "/" +
ServerConfigurationService.getString("portal.handler.default", "site") +
"/";
}
示例11: htmlContent
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* @inheritDoc
*/
protected String htmlContent(Event event)
{
StringBuilder buf = new StringBuilder();
String newline = "<br />\n";
// get the message
Reference ref = entityManager.newReference(event.getResource());
AnnouncementMessage msg = (AnnouncementMessage) ref.getEntity();
AnnouncementMessageHeader hdr = (AnnouncementMessageHeader) msg.getAnnouncementHeader();
// use either the configured site, or if not configured, the site (context) of the resource
String siteId = (getSite() != null) ? getSite() : ref.getContext();
// get a site title
String title = siteId;
String url = ServerConfigurationService.getPortalUrl()+ "/site/"+ siteId;
try
{
Site site = siteService.getSite(siteId);
title = site.getTitle();
url = site.getUrl(); // Might have a better URL.
}
catch (Exception ignore)
{
log.warn("Failed to load site: {} for: {}", siteId, event.getResource());
}
// Now build up the message text.
if (AnnouncementService.SECURE_ANNC_ADD.equals(event.getEvent()))
{
buf.append(rb.getFormattedMessage("noti.header.add", new Object[]{title, url}));
}
else
{
buf.append(rb.getFormattedMessage("noti.header.update", new Object[]{title, url}));
}
buf.append(" " + rb.getString("at_date") + " ");
buf.append(hdr.getDate().toStringLocalFull());
buf.append(newline);
buf.append(msg.getBody());
buf.append(newline);
// add any attachments
List<Reference> attachments = hdr.getAttachments();
if (attachments.size() > 0)
{
buf.append(newline + rb.getString("Attachments") + newline);
for (Iterator<Reference> iAttachments = attachments.iterator(); iAttachments.hasNext();)
{
Reference attachment = (Reference) iAttachments.next();
String attachmentTitle = attachment.getProperties().getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME);
buf.append("<a href=\"" + attachment.getUrl() + "\">");
buf.append(attachmentTitle);
buf.append("</a>" + newline);
}
}
return buf.toString();
}
示例12: plainTextContent
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
@Override
protected String plainTextContent(Event event) {
StringBuilder buf = new StringBuilder();
String newline = "\n\r";
// get the message
Reference ref = entityManager.newReference(event.getResource());
AnnouncementMessage msg = (AnnouncementMessage) ref.getEntity();
AnnouncementMessageHeader hdr = (AnnouncementMessageHeader) msg.getAnnouncementHeader();
// use either the configured site, or if not configured, the site (context) of the resource
String siteId = (getSite() != null) ? getSite() : ref.getContext();
String url = ServerConfigurationService.getPortalUrl()+ "/site/"+ siteId;
// get a site title
String title = siteId;
try
{
Site site = siteService.getSite(siteId);
title = site.getTitle();
}
catch (Exception ignore)
{
}
// Now build up the message text.
if (AnnouncementService.SECURE_ANNC_ADD.equals(event.getEvent()))
{
buf.append(FormattedText.convertFormattedTextToPlaintext(rb.getFormattedMessage("noti.header.add", new Object[]{title,url})));
}
else
{
buf.append(FormattedText.convertFormattedTextToPlaintext(rb.getFormattedMessage("noti.header.update", new Object[]{title,url})));
}
buf.append(" " + rb.getString("at_date") + " ");
buf.append(hdr.getDate().toStringLocalFull());
buf.append(newline);
buf.append(FormattedText.convertFormattedTextToPlaintext(msg.getBody()));
buf.append(newline);
// add any attachments
List attachments = hdr.getAttachments();
if (attachments.size() > 0)
{
buf.append(newline + rb.getString("Attachments") + newline);
for (Iterator iAttachments = attachments.iterator(); iAttachments.hasNext();)
{
Reference attachment = (Reference) iAttachments.next();
String attachmentTitle = attachment.getProperties().getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME);
buf.append(attachmentTitle + ": " +attachment.getUrl() + newline);
}
}
return buf.toString();
}
示例13: getMCPageURL
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Returns the URL using a helper to go to MC home page directly.
*
* @return String A URL so the user can click to go to Message Center.
* Needed since tool could possibly by in MyWorkspace
*/
private String getMCPageURL(String siteId) {
ToolConfiguration mcTool = null;
String url = null;
try {
String toolId = "";
final Site site = getSite(siteId);
if (isMessageForumsPageInSite(site)) {
toolId = DiscussionForumService.MESSAGE_CENTER_ID;
}
else if (isForumsPageInSite(site)) {
toolId = DiscussionForumService.FORUMS_TOOL_ID;
}
else if (isMessagesPageInSite(site)) {
toolId = DiscussionForumService.MESSAGES_TOOL_ID;
}
mcTool = site.getToolForCommonId(toolId);
if (mcTool != null) {
if (toolId == DiscussionForumService.MESSAGE_CENTER_ID) {
url = ServerConfigurationService.getPortalUrl() + "/directtool/"
+ mcTool.getId() + "/sakai.messageforums.helper.helper/main";
}
else if (toolId == DiscussionForumService.FORUMS_TOOL_ID) {
url = ServerConfigurationService.getPortalUrl() + "/directtool/"
+ mcTool.getId() + "/sakai.messageforums.helper.helper/discussionForum/forumsOnly/dfForums";
}
else if (toolId == DiscussionForumService.MESSAGES_TOOL_ID) {
url = ServerConfigurationService.getPortalUrl() + "/directtool/"
+ mcTool.getId() + "/sakai.messageforums.helper.helper/privateMsg/pvtMsgHpView";
}
}
}
catch (IdUnusedException e) {
// Weirdness since site ids used gotten from SiteService
log.error("IdUnusedException while trying to check if site has MF tool.");
}
return url;
}
示例14: buildEditContext
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
* Build the context for the edit site mode.
*/
private String buildEditContext(SessionState state, Context context)
{
// get the site to edit
context.put("tlang", rb);
Site site = (Site) state.getAttribute("site");
context.put("site", site);
// name the html form for user edit fields
context.put("form-name", "site-form");
// get alias base path
String aliasBaseUrl = ServerConfigurationService.getPortalUrl() + Entity.SEPARATOR + "site" + Entity.SEPARATOR;
boolean displaySiteAlias = displaySiteAlias();
String alias;
context.put("displaySiteAlias", Boolean.valueOf(displaySiteAlias));
if (displaySiteAlias)
{
alias = getSiteAlias(site!=null?site.getReference():"");
if (alias != null) {
String urlAliasFull = aliasBaseUrl + alias;
context.put(FORM_URL_ALIAS_FULL, urlAliasFull);
}
context.put(FORM_URL_BASE, aliasBaseUrl);
context.put(FORM_URL_ALIAS, alias);
}
// build the menu
// we need the form fields for the remove...
Menu bar = new MenuImpl();
if (site!= null && SiteService.allowRemoveSite(site.getId()))
{
bar.add(new MenuEntry(rb.getString("sitact.remsit"), null, true, MenuItem.CHECKED_NA, "doRemove", null));
}
bar.add(new MenuEntry(rb.getString("sitact.savas"), null, true, MenuItem.CHECKED_NA, "doSaveas_request", null));
context.put(Menu.CONTEXT_MENU, bar);
return "_edit";
}
示例15: getBaseURL
import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private String getBaseURL()
{
return ServerConfigurationService.getPortalUrl()+"/tool/"+placementId;
}