当前位置: 首页>>代码示例>>Java>>正文


Java UIVerbatim.make方法代码示例

本文整理汇总了Java中uk.org.ponder.rsf.components.UIVerbatim.make方法的典型用法代码示例。如果您正苦于以下问题:Java UIVerbatim.make方法的具体用法?Java UIVerbatim.make怎么用?Java UIVerbatim.make使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uk.org.ponder.rsf.components.UIVerbatim的用法示例。


在下文中一共展示了UIVerbatim.make方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: emitItem

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
/**
 * @param tofill
 * @param templateItem
 * @param index
 * @param templateItemOTPBinding 
 * @param templateId 
 */
private void emitItem(UIContainer tofill, EvalTemplateItem templateItem, int index, Long templateId, String templateItemOTPBinding ) {
    UIBranchContainer radiobranch = UIBranchContainer.make(tofill,
            "itemRowBlock:", templateItem.getId().toString()); //$NON-NLS-1$
    UIOutput.make(radiobranch, "hidden-item-id", templateItem.getId().toString());
    UIOutput.make(radiobranch, "item-block-num", Integer.toString(index));
    UIVerbatim.make(radiobranch, "item-block-text", FormattedText.convertFormattedTextToPlaintext(templateItem.getItem().getItemText()));
    UIInternalLink removeChildItem = UIInternalLink.make(radiobranch,	"child-remove-item", 
            new ItemViewParameters(RemoveItemProducer.VIEW_ID, (Long)null, templateItem.getId(), templateId) );
    removeChildItem.decorate(new UIFreeAttributeDecorator("templateItemId", templateItem.getId().toString()));
    removeChildItem.decorate(new UIFreeAttributeDecorator("templateId", templateId.toString()));
    removeChildItem.decorate(new UIFreeAttributeDecorator("OTP", templateItemOTPBinding));
    removeChildItem.decorate(new UITooltipDecorator(UIMessage.make("modifytemplate.item.delete")));

    UIInternalLink.make(radiobranch,	"child-ungroup-item", UIMessage.make("modifytemplate.group.ungroup"),
            new ItemViewParameters(RemoveItemProducer.VIEW_ID, (Long)null, templateItem.getId(), templateId) );
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:24,代码来源:ModifyTemplateItemsProducer.java

示例2: fillComponents

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters arg1,
		ComponentChecker arg2) {
	
	String[] parms = new String[] {userBean.getEmail()};
	boolean validatingAccounts = serverConfigurationService.getBoolean("siteManage.validateNewUsers", true);
	
	if (!validatingAccounts) {
		UIMessage.make(tofill,"message","confirm",parms);
	} else {
		UIMessage.make(tofill,"message","confirm.validate",parms);
	}
	// Get the instructions from the tool placement.
	Placement placement = toolManager.getCurrentPlacement();
	String supportInstructions = placement == null ? "" :  placement.getConfig().getProperty("supportInstructions");
	if(supportInstructions != null && !"".equals(supportInstructions)){
		UIVerbatim.make(tofill, "supportMessage", supportInstructions);
	}else if (serverConfigurationService.getString("mail.support", null) != null) {
		UIMessage.make(tofill, "supportMessage", "supportMessage");
		UILink.make(tofill, "supportEmail",serverConfigurationService.getString("mail.support", ""),"mailto:" + serverConfigurationService.getString("mail.support", ""));
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:22,代码来源:ConfirmProducer.java

示例3: fill

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {

        EmailViewParameters emailViewParams = (EmailViewParameters) viewparams;
        if (emailViewParams.templateId == null 
                && emailViewParams.emailType == null) {
            throw new IllegalArgumentException("At least templateId or emailType must be set before accessing the preview email view");
        }

        UIVerbatim.make(tofill, "email_templates_fieldhints", UIMessage.make("email.templates.field.names"));

        // get the email template by the templateId or from the evaluation
        EvalEmailTemplate emailTemplate = null;
        if (emailViewParams.templateId != null) {
            emailTemplate = evaluationService.getEmailTemplate(emailViewParams.templateId);
        }
        if (emailTemplate == null 
                && emailViewParams.emailType != null) {
            // get either the template associated with the eval or the default one
            emailTemplate = evaluationService.getEmailTemplate(emailViewParams.evaluationId, emailViewParams.emailType);
        }

        if (emailViewParams.evaluationId != null) {
            // we are working with an evaluation so add edit controls

            // use a get form to submit to the editing page
            UIForm form = UIForm.make(tofill, "previewEmailForm",
                    new EmailViewParameters(ModifyEmailProducer.VIEW_ID, emailViewParams.templateId, 
                            emailViewParams.emailType, emailViewParams.evaluationId) );
            UIMessage.make(form, "modifyEmailTemplate", "previewemail.modify.button");
        }

        UIOutput.make(tofill, "emailSubject", emailTemplate.getSubject() );
        UIVerbatim.make(tofill, "emailMessage", new LineBreakResolver().resolveBean(emailTemplate.getMessage()) );

        UIMessage.make(tofill, "close-button", "general.close.window.button");
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:37,代码来源:PreviewEmailProducer.java

示例4: emitItem

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
/**
 * @param tofill
 * @param templateItem
 * @param index
 */
private void emitItem(UIContainer tofill, EvalTemplateItem templateItem, int index) {
    UIBranchContainer radiobranch = UIBranchContainer.make(tofill,
            "itemRow:", templateItem.getId().toString()); //$NON-NLS-1$
    UIOutput.make(radiobranch, "hidden-item-id", templateItem.getId().toString());
    UIOutput.make(radiobranch, "item-num", Integer.toString(index));
    UIVerbatim.make(radiobranch, "item-text", templateItem.getItem().getItemText());
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:13,代码来源:ModifyBlockProducer.java

示例5: fillComponents

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewParams, ComponentChecker checker) {
    	
	GroupImportViewParameters params = (GroupImportViewParameters) viewParams;
    	
	UIBranchContainer content = UIBranchContainer.make(tofill, "content:");
	UIVerbatim.make(content, "import1.instr.req.1", messageLocator.getMessage("import1.instr.req.1"));
	UIVerbatim.make(content, "import1.instr.req.2", messageLocator.getMessage("import1.instr.req.2"));
	UIVerbatim.make(content, "import1.instr.req.3", messageLocator.getMessage("import1.instr.req.3"));
	UIForm uploadForm = UIForm.make(content, "uploadform");
	UIInput.make(uploadForm, "groupuploadtextarea", "#{SiteManageGroupSectionRoleHandler.groupUploadTextArea}");
	UICommand.make(uploadForm, "continue", messageLocator.getMessage("import1.continue"), "#{SiteManageGroupSectionRoleHandler.processUploadAndCheck}");
	UICommand cancel = UICommand.make(uploadForm, "cancel", messageLocator.getMessage("cancel"), "#{SiteManageGroupSectionRoleHandler.processCancel}");
	cancel.parameters.add(new UIDeletionBinding("#{destroyScope.resultScope}"));
    
	frameAdjustingProducer.fillComponents(tofill, "resize", "resetFrame");

	//process any messages
	tml = handler.messages;
	if (tml.size() > 0) {
		for (int i = 0; i < tml.size(); i ++ ) {
			UIBranchContainer errorRow = UIBranchContainer.make(tofill,"error-row:", Integer.toString(i));
			TargettedMessage msg = tml.messageAt(i);
			if (msg.args != null )
			{
				UIMessage.make(errorRow,"error", msg.acquireMessageCode(), (Object[]) msg.args);
			}
			else
			{
				UIMessage.make(errorRow,"error", msg.acquireMessageCode());
			}
		}
	}
	    
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:35,代码来源:GroupImportStep1Producer.java

示例6: fillComponents

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {
	TrackerViewParameters params = (TrackerViewParameters) viewparams;

               if (!simplePageBean.canReadPage())
	    return;

               UIOutput.make(tofill, "html").decorate(new UIFreeAttributeDecorator("lang", localeGetter.get().getLanguage()))
	    .decorate(new UIFreeAttributeDecorator("xml:lang", localeGetter.get().getLanguage()));        

	Long itemId = params.getItemId();

	SimplePageItem i = simplePageToolDao.findItem(itemId);

	SimplePage page = simplePageBean.getCurrentPage();

	if (i.getPageId() != page.getPageId()) {
	    log.info("LinkTracker asked to track item not in current page");
	    return;
	}

	if (i != null && simplePageBean.isItemAvailable(i)) {

	    simplePageBean.track(itemId, null);

	    String URL = params.getURL();
	    if (lessonBuilderAccessService.needsCopyright(i.getSakaiId()))
		URL = "/access/require?ref=" + URLEncoder.encode("/content" + i.getSakaiId()) + "&url=" + URLEncoder.encode(URL.substring(7));

	    String js = "window.location = \"" + StringEscapeUtils.escapeJavaScript(URL) + "\"";
	    if (params.getRefresh())
		js = "window.top.opener.location.reload(true);" + js;
	    UIVerbatim.make(tofill, "redirect", js);

	} else {

	    UIOutput.make(tofill, "error", messageLocator.getMessage("simplepage.error"));
	    UIOutput.make(tofill, "errormsg", messageLocator.getMessage("simplepage.complete_required"));
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:40,代码来源:LinkTrackerProducer.java

示例7: fillComponents

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {

        UIMessage.make(tofill, "page-title", "blogwow.add_edit.title");

        BlogEntryParams params = (BlogEntryParams) viewparams;

        String entryLocator = "EntryLocator";
        String entryOTP = null;
        boolean newentry = false;
        if (params.entryid == null) {
            entryOTP = entryLocator + "." + EntryLocator.NEW_1;
            newentry = true;
        } else {
            entryOTP = entryLocator + "." + params.entryid;
        }

        navBarRenderer.makeNavBar(tofill, "navIntraTool:", VIEW_ID);

        if (newentry) {
            UIMessage.make(tofill, "add-entry-header", "blogwow.add_edit.addheader");
        } else {
            UIMessage.make(tofill, "add-entry-header", "blogwow.add_edit.editheader");
        }

        UIForm form = UIForm.make(tofill, "edit-blog-entry-form");

        UIMessage.make(form, "title-label", "blogwow.add_edit.title");
        UIInput.make(form, "title-input", entryOTP + ".title");

        UIInput blogtext = UIInput.make(form, "blog-text-input:", entryOTP + ".text");
        richTextEvolver.evolveTextInput(blogtext);

        UIMessage.make(form, "privacy-instructions", "blogwow.add_edit.accesstext");

        String[] privacyRadioValues = new String[] {
                BlogConstants.PRIVACY_GROUP_LEADER,
                BlogConstants.PRIVACY_GROUP,
                BlogConstants.PRIVACY_PUBLIC };
        String[] privacyRadioLabelKeys = new String[] {
                "blogwow.add_edit.private",
                "blogwow.add_edit.sitemembers",
                "blogwow.add_edit.public" };

        /*
         * Commenting this out for BW-95
        boolean isDraft = false;
        if (params.entryid != null) {
        	BlogWowEntry entry = entryLogic.getEntryById(params.entryid, externalLogic.getCurrentLocationId());
        	if (entry.getPrivacySetting().equals(BlogConstants.PRIVACY_PRIVATE)) {
        		isDraft = true;
        	}
        }
        */
        
        UISelect privacyRadios;
        // If this is a new entry or draft select default privacy setting
        if (newentry) {
            privacyRadios = UISelect.make(form, "privacy-radio-holder", privacyRadioValues, privacyRadioLabelKeys,
                   entryOTP + ".privacySetting", externalLogic.getEntryViewableSetting()).setMessageKeys();
        } else {
            privacyRadios = UISelect.make(form, "privacy-radio-holder", privacyRadioValues, privacyRadioLabelKeys,
                entryOTP + ".privacySetting").setMessageKeys();
        }

        String selectID = privacyRadios.getFullID();
        UISelectChoice.make(form, "instructors-only-radio", selectID, 0);
        UIVerbatim.make(form, "instructors-only-label", messageLocator.getMessage("blogwow.add_edit.private"));

        UISelectChoice.make(form, "all-members-radio", selectID, 1);
        UIVerbatim.make(form, "all-members-label", messageLocator.getMessage("blogwow.add_edit.sitemembers"));

        UISelectChoice.make(form, "public-viewable-radio", selectID, 2);
        UIVerbatim.make(form, "public-viewable-label", messageLocator.getMessage("blogwow.add_edit.public"));

        UICommand.make(form, "publish-button", UIMessage.make("blogwow.add_edit.publish"), entryLocator + ".publishAll");
        UICommand.make(form, "save-button", UIMessage.make("blogwow.add_edit.save"), entryLocator + ".saveAll");
        UICommand.make(form, "cancel-button", UIMessage.make("blogwow.add_edit.cancel"));
    }
 
开发者ID:sakaicontrib,项目名称:blogwow,代码行数:79,代码来源:AddEntryProducer.java

示例8: fillComponents

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {
    String currentUserId = externalLogic.getCurrentUserId();

    BlogRssViewParams params = (BlogRssViewParams) viewparams;
    String blogId = params.blogId;
    String locationId = params.locationId;

    List<BlogWowEntry> entries = new ArrayList<BlogWowEntry>();
    // get the entries for a single blog or a group of blogs depending on what is passed in
    if (blogId != null) {
        BlogWowBlog blog = blogLogic.getBlogById( blogId );
        UIOutput.make(tofill, "channel-title", blog.getTitle());
        UIOutput.make(tofill, "channel_link", externalLogic.getBlogUrl(blogId));
        entries = entryLogic.getAllVisibleEntries(blogId, currentUserId, null, true, 0, 10);                        
    } else if (locationId != null) {
        UIOutput.make(tofill, "channel-title", externalLogic.getLocationTitle(locationId));
        // TODO - Add direct linking to site
        //UIOutput.make(tofill, "channel_link", externalLogic.getBlogUrl(locationId));
        List<BlogWowBlog> blogs = blogLogic.getAllVisibleBlogs(locationId, null, true, 0, 10);
        String[] blogIds = new String[blogs.size()];
        for (int i=0; i<blogs.size(); i++) {
            blogIds[i] = (blogs.get(i)).getId();
        }
        entries = entryLogic.getAllVisibleEntries(blogIds, currentUserId, null, true, 0, 10);                        
    }

    Date publishDate = null;
    for (int i = 0; i < entries.size(); i++) {
        BlogWowEntry entry = entries.get(i);
        UIBranchContainer rssitem = UIBranchContainer.make(tofill, "item:", i+"");
        UIOutput.make(rssitem, "item-title", entry.getTitle());
        UIOutput.make(rssitem, "creator", entry.getOwnerId());
        UIOutput.make(rssitem, "item_link", externalLogic.getBlogEntryUrl(entry.getId()));
        if (publishDate == null ||
                entry.getDateModified().before(publishDate)) {
            publishDate = entry.getDateModified();
        }
        UIOutput.make(rssitem, "item_publish_date", rfc822Format.format(entry.getDateModified()));

        String desc = "<![CDATA[" 
            + ( entry.getText().length() < 200 
                    ? entry.getText().substring(0, entry.getText().length())
                            : entry.getText().substring(0, 200)) 
                            + "]]>";
        String content = "<![CDATA[" + entry.getText() + "]]>";
        UIVerbatim.make(rssitem, "description", desc);
        UIVerbatim.make(rssitem, "content" ,content);
    }

    if (publishDate == null) { publishDate = new Date(); }
    UIOutput.make(tofill, "channel_publish_date", rfc822Format.format(publishDate));
}
 
开发者ID:sakaicontrib,项目名称:blogwow,代码行数:53,代码来源:BlogRSSProducer.java

示例9: renderItem

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public UIJointContainer renderItem(UIContainer parent, String ID, String[] bindings, EvalTemplateItem templateItem, int displayNumber, boolean disabled, Map<String, Object> renderProperties) {

        UIJointContainer container = new UIJointContainer(parent, ID, COMPONENT_ID);

        UIBranchContainer textoptions = UIBranchContainer.make(container, "textDisplay:");
        if ( renderProperties.containsKey(ItemRenderer.EVAL_PROP_RENDER_INVALID) ) {
            textoptions.decorate( new UIStyleDecorator("validFail") ); // must match the existing CSS class
        } else if ( renderProperties.containsKey(ItemRenderer.EVAL_PROP_ANSWER_REQUIRED) ) {
            textoptions.decorate( new UIStyleDecorator("compulsory") ); // must match the existing CSS class
        }

        if (displayNumber <= 0) displayNumber = 0;
        String initValue = null;
        if (bindings[0] == null) initValue = "";

        String naBinding = null;
        if (bindings.length > 1) {
            naBinding = bindings[1];
        }
        Boolean naInit = null;
        if (naBinding == null) naInit = Boolean.FALSE;

        UIOutput.make(container, "itemNum", displayNumber+"" );
        UIVerbatim.make(container, "itemText", templateItem.getItem().getItemText());

        if ( templateItem.getUsesNA() ) {
            UIBranchContainer branchNA = UIBranchContainer.make(container, "showNA:");
            branchNA.decorators = new DecoratorList( new UIStyleDecorator("na") ); // must match the existing CSS class
            UIBoundBoolean checkbox = UIBoundBoolean.make(branchNA, "itemNA", naBinding, naInit);
            UIMessage.make(branchNA, "descNA", "viewitem.na.desc").decorate( new UILabelTargetDecorator(checkbox) );
        }

        UIInput textarea = UIInput.make(container, "essayBox", bindings[0], initValue); //$NON-NLS-2$

        Map<String, String> attrmap = new HashMap<>();
        attrmap.put("rows", templateItem.getDisplayRows().toString());
        // disabling the textbox is undesireable -AZ
        //		if (disabled) {
        //			attrmap.put("disabled", "true"); //$NON-NLS-2$		
        //		}
        textarea.decorators = new DecoratorList( new UIFreeAttributeDecorator(attrmap) );

        return container;
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:45,代码来源:TextRenderer.java

示例10: fill

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {

        SwitchViewParams svp = (SwitchViewParams) viewparams;

        String currentUserId = commonLogic.getCurrentUserId();
        boolean userAdmin = commonLogic.isUserAdmin(currentUserId);

        //top links here
        navBarRenderer.makeNavBar(tofill, NavBarRenderer.NAV_ELEMENT, this.getViewID());

        // ability to control the listing of templates that appear (i.e. enable more than default templates)
        boolean showDefaults = false;
        if (userAdmin) {
            // default to showing the default templates
            if (svp.switcher == null) {
                svp.switcher = DEFAULTS;
            }
            UIBranchContainer switchBranch = UIBranchContainer.make(tofill, "showSwitch:");
            UIInternalLink defaultLink = UIInternalLink.make(switchBranch, "showDefaultsLink",
                    UIMessage.make("controlemailtemplates.show.defaults.link"),
                    new SwitchViewParams(ControlEmailTemplatesProducer.VIEW_ID, DEFAULTS));
            UIInternalLink otherLink = UIInternalLink.make(switchBranch, "showOthersLink", 
                    UIMessage.make("controlemailtemplates.show.others.link"),
                    new SwitchViewParams(ControlEmailTemplatesProducer.VIEW_ID, OTHERS));
            if (svp.switcher.equals(DEFAULTS)) {
                showDefaults = true;
                defaultLink.decorate(CLASS_DECORATOR);
            } else {
                showDefaults = false;
                otherLink.decorate(CLASS_DECORATOR);
            }
        }

        // Get all the email templates for the user
        List<EvalEmailTemplate> templatesList = evaluationService.getEmailTemplatesForUser(currentUserId, null, showDefaults);
        if (templatesList.isEmpty()) {
            UIMessage.make(tofill, "templatesList_none", "controlemailtemplates.no.templates");
        }
        for (int i = 0; i < templatesList.size(); i++) {
            EvalEmailTemplate emailTemplate = templatesList.get(i);

            UIBranchContainer templatesBranch = UIBranchContainer.make(tofill, "templatesList:", i+"");
            UIOutput.make(templatesBranch, "template_number", (i + 1)+"");
            UIOutput.make(templatesBranch, "template_title", emailTemplate.getDefaultType());
            UIMessage.make(templatesBranch, "template_subject", "controlemailtemplates.subject", 
                    new Object[] {emailTemplate.getSubject()});
            UIVerbatim.make(templatesBranch, "template_text", new LineBreakResolver().resolveBean(emailTemplate.getMessage()) );


            boolean canControl = evaluationService.canControlEmailTemplate(currentUserId, null, emailTemplate.getId());
            if ( canControl ) {
                UIInternalLink.make(templatesBranch, "modify_link", 
                        UIMessage.make("general.command.edit"), 
                        new EmailViewParameters(ModifyEmailProducer.VIEW_ID, emailTemplate.getId(), emailTemplate.getType(), null) );
            } else {
                UIMessage.make(templatesBranch, "modify_link_disabled", "general.command.edit");
            }

            if ( canControl && 
                    emailTemplate.getDefaultType() == null ) {
                UIForm form = UIForm.make(templatesBranch, "removeForm");
                UICommand command = UICommand.make(form, "removeCommand");
                command.addParameter( new UIDeletionBinding(EMAIL_TEMPLATE_LOCATOR + emailTemplate.getId()) );
            } else {
                UIMessage.make(templatesBranch, "remove_link_disabled", "general.command.delete");
            }
        }
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:69,代码来源:ControlEmailTemplatesProducer.java

示例11: fill

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {

        ExpertItemViewParameters expertItemViewParameters = (ExpertItemViewParameters) viewparams;
        Long templateId = expertItemViewParameters.templateId;
        Long categoryId = expertItemViewParameters.categoryId;
        Long objectiveId = expertItemViewParameters.objectiveId;

        UIMessage.make(tofill, "page-title", "expert.items.page.title"); //$NON-NLS-1$ //$NON-NLS-2$

        UIInternalLink.make(tofill, "modify-template", UIMessage.make("modifytemplate.page.title"), //$NON-NLS-1$ //$NON-NLS-2$
                new TemplateViewParameters(ModifyTemplateItemsProducer.VIEW_ID, templateId) );

        // create a copy of the VP and then set it to the right view (to avoid corrupting the original)
        ExpertItemViewParameters eivp = (ExpertItemViewParameters) expertItemViewParameters.copyBase();
        eivp.viewID = ExpertCategoryProducer.VIEW_ID;

        UIMessage.make(tofill, "expert-items", "expert.expert.items");
        UIInternalLink.make(tofill, "expert-items-category-link", UIMessage.make("expert.category"), eivp ); //$NON-NLS-1$ //$NON-NLS-2$
        UIMessage.make(tofill, "expert-items-items", "expert.items");

        UIInternalLink.make(tofill, "choose-category-1-link", UIMessage.make("expert.choose.category"), eivp ); //$NON-NLS-1$ //$NON-NLS-2$

        eivp.viewID = ExpertObjectiveProducer.VIEW_ID;

        UIInternalLink.make(tofill, "expert-items-objective-link", UIMessage.make("expert.objective"), eivp ); //$NON-NLS-1$ //$NON-NLS-2$

        UIInternalLink.make(tofill, "choose-objective-2-link", UIMessage.make("expert.choose.objective"), eivp ); //$NON-NLS-1$ //$NON-NLS-2$
        UIMessage.make(tofill, "choose-items-3", "expert.choose.items");

        UIMessage.make(tofill, "category", "expert.category");
        EvalItemGroup category = authoringService.getItemGroupById(categoryId);
        UIOutput.make(tofill, "category-current", category.getTitle() );
        UIMessage.make(tofill, "objective", "expert.objective");
        EvalItemGroup objective = authoringService.getItemGroupById(objectiveId);
        UIOutput.make(tofill, "objective-current", objective.getTitle() );
        UIMessage.make(tofill, "items", "expert.items");
        UIMessage.make(tofill, "items-instructions", "expert.items.instructions");
        UIMessage.make(tofill, "expert-items-summary", "expert.items.summary");
        UIMessage.make(tofill, "description", "expert.description");

        UIForm form = UIForm.make(tofill, "insert-items-form");
        
        UIBranchContainer expertItemHeaderBranch = UIBranchContainer.make(tofill, "expert-item-header-row:");     	
       	UIMessage.make(expertItemHeaderBranch, "expert-item-col", "expert.items");
       	UIBranchContainer selectAllBranch = UIBranchContainer.make(expertItemHeaderBranch, "select-all-col:");

        // loop through all expert items
        List<EvalItem> expertItems = authoringService.getItemsInItemGroup(objectiveId, true);
        for (int i = 0; i < expertItems.size(); i++) {
            EvalItem expertItem = (EvalItem) expertItems.get(i);
            UIBranchContainer items = UIBranchContainer.make(form, "expert-item-list:", expertItem.getId().toString());
            if (i % 2 == 0) {
                items.decorators = new DecoratorList( new UIStyleDecorator("itemsListOddLine") ); // must match the existing CSS class
            }

            UIBoundBoolean checkbox = UIBoundBoolean.make(items, "insert-item-checkbox", "#{expertItemsBean.selectedIds." + expertItem.getId() + "}");
            UILabelTargetDecorator.targetLabel(UIOutput.make(items, "item-label"), checkbox);
            UIVerbatim.make(items, "item-text", expertItem.getItemText()); //$NON-NLS-1$
            if (expertItem.getScale() != null) {
                UIOutput.make(items, "item-scale", ScaledUtils.makeScaleText(expertItem.getScale(), 0)); //$NON-NLS-1$
            }
            if (expertItem.getExpertDescription() != null) {
                UIVerbatim.make(items, "item-expert-desc", expertItem.getExpertDescription()); //$NON-NLS-1$
            }
        }

        // create the cancel button
        UIMessage.make(tofill, "cancel-button", "expert.items.cancel");

        // create the Insert Items button
        UICommand addItemsCommand = UICommand.make(form, "insert-items-command", UIMessage.make("expert.items.insert"), //$NON-NLS-1$
        "#{expertItemsBean.processActionAddItems}"); //$NON-NLS-1$
        addItemsCommand.parameters.add(new UIELBinding("#{expertItemsBean.templateId}", templateId)); //$NON-NLS-1$
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:75,代码来源:ExpertItemsProducer.java

示例12: fill

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {

    	// local variables used in the render logic
        String currentUserId = commonLogic.getCurrentUserId();

        /*
         * top links here
         */
        navBarRenderer.makeNavBar(tofill, NavBarRenderer.NAV_ELEMENT, this.getViewID());

        ChooseItemViewParameters itemViewParameters = (ChooseItemViewParameters) viewparams;
        Long templateId = itemViewParameters.templateId;
        String searchString = itemViewParameters.searchString;
        if (searchString == null) searchString = "";

        UIInternalLink.make(tofill, "modify-items-link", UIMessage.make("items.page.title"), //$NON-NLS-2$
                new SimpleViewParameters(ControlItemsProducer.VIEW_ID));

        UIInternalLink.make(tofill, "modify-template-link", UIMessage.make("modifytemplate.page.title"), //$NON-NLS-2$
                new TemplateViewParameters(ModifyTemplateItemsProducer.VIEW_ID, templateId) );

        if (searchString.length() > 0) {
            UIMessage.make(tofill, "search-current", "existing.items");
            UIOutput.make(tofill, "search-current-value", searchString);
        }

        // loop through all existing items
        List<EvalItem> existingItems = authoringService.getItemsForUser(currentUserId, null, null, false);
        UIForm form = UIForm.make(tofill, "insert-items-form");

        if (existingItems.size() > 0) {
            UIForm searchForm = UIForm.make(tofill, "search-form", itemViewParameters);
            UIMessage.make(searchForm, "search-command", "items.search.command" );
            UIInput.make(searchForm, "search-box", "#{searchString}");

            for (int i = 0; i < existingItems.size(); i++) {
                EvalItem item = (EvalItem) existingItems.get(i);
                UIBranchContainer items = UIBranchContainer.make(form, "item-list:", item.getId().toString());
                if (i % 2 == 0) {
                    items.decorators = new DecoratorList( new UIStyleDecorator("itemsListOddLine") ); // must match the existing CSS class
                }

                UIBoundBoolean checkbox = UIBoundBoolean.make(items, "insert-item-checkbox", "#{expertItemsBean.selectedIds." + item.getId() + "}");
                UILabelTargetDecorator.targetLabel(UIOutput.make(items, "item-label"), checkbox);
                UIVerbatim.make(items, "item-text", item.getItemText());
                if (item.getScale() != null) {
                    String scaleText = item.getScale().getTitle() + " (";
                    for (int j = 0; j < item.getScale().getOptions().length; j++) {
                        scaleText += (j==0?"":",") + item.getScale().getOptions()[j];
                    }
                    scaleText += ")";
                    UIOutput.make(items, "item-scale", scaleText);
                } else {
                    UIOutput.make(items, "item-scale", item.getClassification());
                }
                if (item.getDescription() != null) {
                    UIOutput.make(items, "item-desc", item.getExpertDescription());
                }
            }

            // create the Insert Items button
            UICommand addItemsCommand = UICommand.make(form, "insert-items-command", UIMessage.make("expert.items.insert"),
            "#{expertItemsBean.processActionAddItems}");
            addItemsCommand.parameters.add(new UIELBinding("#{expertItemsBean.templateId}", templateId));

            // create the top cancel link
            UIInternalLink.make(form, "cancel-items", UIMessage.make("items.cancel"), 
                    new TemplateViewParameters(ModifyTemplateItemsProducer.VIEW_ID, templateId) );
        } else {
            UIMessage.make(form, "no-items", "no.list.items");
        }

        // create the bottom cancel link
        UIInternalLink.make(form, "cancel-items-bottom", UIMessage.make("items.cancel"), 
                new TemplateViewParameters(ModifyTemplateItemsProducer.VIEW_ID, templateId) );
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:77,代码来源:ExistingItemsProducer.java

示例13: fill

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {

        // local variables used in the render logic
        String currentUserId = commonLogic.getCurrentUserId();

        /*
         * top links here
         */
        navBarRenderer.makeNavBar(tofill, NavBarRenderer.NAV_ELEMENT, this.getViewID());

        ExpertItemViewParameters expertItemViewParameters = (ExpertItemViewParameters) viewparams;
        Long templateId = expertItemViewParameters.templateId;

        UIMessage.make(tofill, "page-title", "expert.category.page.title"); //$NON-NLS-1$ //$NON-NLS-2$

        UIInternalLink.make(tofill, "modify-template", UIMessage.make("modifytemplate.page.title"), //$NON-NLS-1$ //$NON-NLS-2$
                new TemplateViewParameters(ModifyTemplateItemsProducer.VIEW_ID, templateId) );

        // create a copy of the VP and then set it to the right view (to avoid corrupting the original)
        ExpertItemViewParameters eivp = (ExpertItemViewParameters) expertItemViewParameters.copyBase();

        UIMessage.make(tofill, "expert-items-category", "expert.category");

        UIMessage.make(tofill, "choose-category-1", "expert.choose.category");
        UIMessage.make(tofill, "choose-objective-2", "expert.choose.objective");
        UIMessage.make(tofill, "choose-items-3", "expert.choose.items");

        UIMessage.make(tofill, "category", "expert.category");
        UIMessage.make(tofill, "category-instructions", "expert.category.instructions");
        UIMessage.make(tofill, "category-list-summary", "expert.category.list.summary");

        UIMessage.make(tofill, "description", "expert.description");

        // set the VP to the correct target for objectives
        eivp.viewID = ExpertObjectiveProducer.VIEW_ID;

        // loop through all non-empty expert categories
        List<EvalItemGroup> expertCategories = authoringService.getItemGroups(null, currentUserId, false, true);
        for (int i = 0; i < expertCategories.size(); i++) {
            EvalItemGroup category = (EvalItemGroup) expertCategories.get(i);
            UIBranchContainer categories = UIBranchContainer.make(tofill, "expert-category-list:", category.getId().toString());
            if (i % 2 == 0) {
                categories.decorators = new DecoratorList( new UIStyleDecorator("itemsListOddLine") ); // must match the existing CSS class
            }

            eivp.categoryId = category.getId();
            UIInternalLink.make(categories, "category-title-link", category.getTitle(), eivp); //$NON-NLS-1$
            if (category.getDescription() != null && category.getDescription().length() > 0) {
                UIVerbatim.make(categories, "category-description", category.getDescription()); //$NON-NLS-1$
            } else {
                UIMessage.make(categories, "category-no-description", "expert.no.description"); //$NON-NLS-1$
            }
        }

        // create the cancel button
        UIMessage.make(tofill, "cancel-button", "expert.items.cancel");
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:58,代码来源:ExpertCategoryProducer.java

示例14: fillComponents

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {
	GradeGradebookItemViewParams params = (GradeGradebookItemViewParams) viewparams;

	if (params.contextId == null || params.assignmentId == null ||  params.userId == null){
		//DO something
		return;
	}
	
	// Firefox absolutely completely refuses to not cache this page for some reason.
	// Even with the meta's in the HTML.  -SWG  ASNN-293
	httpServletResponse.setHeader("Pragma", "no-cache");
	httpServletResponse.setHeader("Cache-Control", "no-cache");
	httpServletResponse.setDateHeader("Expires", 0 );
	
	if (!gradebookService.isUserAbleToGradeItemForStudent(params.contextId, params.assignmentId, params.userId)) {
	    UIMessage.make(tofill, "permissions_error", "gradebook.authorizationFailed.permissions_error");
	    return;
	}
	
	//get Options
	GradeDefinition gradeDef = gradebookService.getGradeDefinitionForStudentForItem(params.contextId, params.assignmentId, params.userId);
	Assignment assignment = gradebookService.getAssignment(params.contextId, params.assignmentId);
	Long gradebookId = ((Gradebook) gradebookService.getGradebook(params.contextId)).getId();
	
	String grade = "";
	String comment = "";
	int gradeEntryType;
	if (gradeDef != null) {
	    grade = gradeDef.getGrade();
	    comment = gradeDef.getGradeComment();
	    gradeEntryType = gradeDef.getGradeEntryType();
	} else {
	    gradeEntryType = gradebookService.getGradeEntryType(params.contextId);
	}
	
    String student_name = "";
    try{
        User user = userDirectoryService.getUser(params.userId);
        student_name = user.getDisplayName();
    } catch(UserNotDefinedException ex) {
        	return;
    }
        
	UIMessage.make(tofill, "heading", "gradebook.grade-gradebook-item.heading", new Object[]{ assignment.getName(), student_name } );
    
    //Start Form
    UIForm form = UIForm.make(tofill, "form");
    
    if (gradeEntryType == GradebookService.GRADE_TYPE_POINTS){
    	UIVerbatim.make(form, "points_label", messageLocator.getMessage("gradebook.grade-gradebook-item.points_label",
    		new Object[]{ reqStar }));
    	UIMessage.make(form, "points_out_of", "gradebook.grade-gradebook-item.points_out_of", new Object[]{ assignment.getPoints()});
    } else if (gradeEntryType == GradebookService.GRADE_TYPE_PERCENTAGE){
    	UIVerbatim.make(form, "points_label", messageLocator.getMessage("gradebook.grade-gradebook-item.percentage_label",
        		new Object[]{ reqStar }));
    	//show percent sign
    	UIMessage.make(form, "percent_sign", "gradebook.grade-gradebook-item.percent_sign");
    } else if (gradeEntryType == GradebookService.GRADE_TYPE_LETTER){
    	UIVerbatim.make(form, "points_label", messageLocator.getMessage("gradebook.grade-gradebook-item.letter_label",
        		new Object[]{ reqStar }));
    }
    
    // add the grade info now. the UIInputs only pass along the parameter info
    // if there is a change to the value. this gets the old values in there
    // and then they will be overwritten if there is an input value set
    form.parameters.add( new UIELBinding("#{AssignmentGradeRecordBean.enteredGrade}", grade));
    form.parameters.add( new UIELBinding("#{AssignmentGradeRecordBean.commentText}", comment));

    UIInput.make(form, "score", "#{AssignmentGradeRecordBean.enteredGrade}", grade);
    UIInput.make(form, "commentText", "#{AssignmentGradeRecordBean.commentText}", comment);

    form.parameters.add( new UIELBinding("#{AssignmentGradeRecordBean.gradebookId}", gradebookId));
    form.parameters.add( new UIELBinding("#{AssignmentGradeRecordBean.studentId}", params.userId));
    form.parameters.add( new UIELBinding("#{AssignmentGradeRecordBean.assignmentId}", params.assignmentId));
    
    //Action Buttons
    UICommand.make(form, "submit", UIMessage.make("gradebook.grade-gradebook-item.submit"), "#{AssignmentGradeRecordBean.processActionSubmitGrade}");
    UICommand.make(form, "cancel", UIMessage.make("gradebook.grade-gradebook-item.cancel"), "#{AssignmentGradeRecordBean.processActionCancel}");
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:80,代码来源:GradeGradebookItemProducer.java

示例15: evolveTextInput

import uk.org.ponder.rsf.components.UIVerbatim; //导入方法依赖的package包/类
public UIJointContainer evolveTextInput(UIInput toevolve) {
	String height = this.height;
	String width = this.width;

	// dig out the size decorators and adjust the editor size.
	// TODO: If you know a cleaner way, please replace this block!

    if (toevolve.decorators != null)
	for (Iterator<UIDecorator> decorators = toevolve.decorators.iterator(); decorators.hasNext();) {
		UIDecorator decorator = decorators.next();
		if (decorator instanceof UIFreeAttributeDecorator) {
			if (((UIFreeAttributeDecorator) decorator).attributes.get("height") != null) {
				height = String.valueOf(((UIFreeAttributeDecorator) decorator).attributes.get("height"));
			} else if (((UIFreeAttributeDecorator) decorator).attributes.get("width") != null) {
				width = String.valueOf(((UIFreeAttributeDecorator) decorator).attributes.get("width"));
			}
		}
	}

	UIContainer parent = toevolve.parent;
	toevolve.parent.remove(toevolve);
	UIJointContainer joint = new UIJointContainer(parent, toevolve.ID, COMPONENT_ID);

	joint.decorators = toevolve.decorators;

	toevolve.ID = SEED_ID; // must change ID while unattached
	joint.addComponent(toevolve);
	//(03:15:52 PM) Noah Botimer: call it like this: sakai.editor.launch('myawesometextarea', {height: 400, width: 600});
	//(03:16:04 PM) Noah Botimer: don't specify the width unless you have to
	String options = "{noop:0";
	if (height != null) {
		options += ",height:" + height;
	}
	if (width != null) {
		options += ",width:" + width;
	}
	options += "}";
	String js = HTMLUtil.emitJavascriptCall("sakai.editor.launch", new String[] { toevolve.getFullID(), options });
	UIVerbatim.make(joint, "textarea-js", js);

	return joint;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:43,代码来源:SakaiRichTextEvolver.java


注:本文中的uk.org.ponder.rsf.components.UIVerbatim.make方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。