• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Clob类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.isis.applib.value.Clob的典型用法代码示例。如果您正苦于以下问题:Java Clob类的具体用法?Java Clob怎么用?Java Clob使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Clob类属于org.apache.isis.applib.value包,在下文中一共展示了Clob类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: exportAsXml

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(semantics = SemanticsOf.SAFE)
public Clob exportAsXml(
        final ToDoItem toDoItem,
        String fileName
) {
    if(!fileName.endsWith(".xml")) {
        fileName += ".xml";
    }

    final XmlSnapshotService.Builder builder = xmlSnapshotService.builderFor(toDoItem);
    builder.includePath("dependencies");
    builder.includePath("similarTo");

    final XmlSnapshotService.Snapshot snapshot = builder.build();

    return new Clob(
            fileName,
            "application/xml",
            snapshot.getXmlDocumentAsString());
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:21,代码来源:ExportAsXmlContributions.java


示例2: happyCase

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Test
public void happyCase() throws Exception {

    // given
    final String expected = Resources.toString(Resources.getResource(getClass(), "expected.json"), Charsets.UTF_8);

    // when
    final Clob clob = developerUtilitiesService.downloadLayout(demoObject);

    // then
    final CharSequence chars = clob.getChars();
    final String actual = chars.toString();

    System.out.println(actual);
    assertThat(actual, is(expected));
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:17,代码来源:DeveloperUtilitiesServiceProgrammaticIntegTest.java


示例3: execute

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Override
protected void execute(final ExecutionContext ec) {

    defaultParam("numberToCreate", ec, 3);
    defaultParam("name", ec, fake.name().firstName());


    for (int k = 0; k < getNumberToCreate(); k++) {
        final String str = getName() + "-" + k;

        final BlobClobObject object;
        try {
            final Blob blob = newBlob(str, "application/pdf", "rick-mugridge-paper.pdf");
            final Blob image = newBlob(str, "image/jpeg", "flowers.jpg");
            final Clob clob = newClob(str, "application/rtf", "sample.rtf");

            object = blobClobObjects.createBlobClobObject(str, blob, image, clob);
            objects.add(object);
            ec.addResult(this, object);

        } catch (final IOException e) {
            throw new RuntimeException(e);
        }
    }
}
 
开发者ID:isisaddons,项目名称:isis-app-kitchensink,代码行数:26,代码来源:BlobClobObjectsFixture.java


示例4: createBlobClobObject

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@MemberOrder(sequence = "30")
public BlobClobObject createBlobClobObject(
        @ParameterLayout(named="Name")
        final String name,
        @ParameterLayout(named="Some blob") @Parameter(optionality=Optionality.OPTIONAL)
        final Blob blob,
        @ParameterLayout(named="Some image") @Parameter(optionality= Optionality.OPTIONAL)
        final Blob image,
        @ParameterLayout(named="Some clob") @Parameter(optionality=Optionality.OPTIONAL)
        final Clob clob) {
    final BlobClobObject obj = container.newTransientInstance(BlobClobObject.class);
    obj.setName(name);

    obj.setSomeBlob(blob);
    obj.setSomeImage(image);
    obj.setSomeClob(clob);

    container.persistIfNotAlready(obj);
    return obj;
}
 
开发者ID:isisaddons,项目名称:isis-app-kitchensink,代码行数:21,代码来源:BlobClobObjects.java


示例5: validateNewClobTemplate

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
public TranslatableString validateNewClobTemplate(
        final DocumentType proposedType,
        final LocalDate proposedDate,
        final String name,
        final String fileSuffix,
        final ApplicationTenancy proposedApplicationTenancy,
        final Clob clob,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy,
        final boolean previewOnly) {

    final DocumentSort documentSort = DocumentSort.CLOB;

    return validateNewTemplate(
            proposedType, proposedDate, proposedApplicationTenancy, contentRenderingStrategy,
            documentSort);

}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:DocumentTemplateMenu.java


示例6: createClob

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Programmatic
public DocumentTemplate createClob(
        final DocumentType type,
        final LocalDate date,
        final String atPath,
        final String fileSuffix,
        final boolean previewOnly,
        final Clob clob,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy) {
    final DocumentTemplate document =
            new DocumentTemplate(
                    type, date, atPath,
                    fileSuffix, previewOnly, clob,
                    contentRenderingStrategy,
                    subjectText, subjectRenderingStrategy);
    repositoryService.persistAndFlush(document);
    return document;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:21,代码来源:DocumentTemplateRepository.java


示例7: exportAsXml

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(semantics = SemanticsOf.SAFE)
public Clob exportAsXml(Project project, String fileName) {
    if (!fileName.endsWith(".xml")) {
        fileName += ".xml";
    }

    XmlSnapshotService.Builder builder = xmlSnapshotService.builderFor(project);
    builder.includePath("opportunityStatus");
    XmlSnapshotService.Snapshot snapshot = builder.build();
    return new Clob(fileName, "application/xml", snapshot.getXmlDocumentAsString());
}
 
开发者ID:bibryam,项目名称:semat,代码行数:12,代码来源:ExportAsXmlContributions.java


示例8: downloadMetaModel

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(
        domainEvent = DownloadMetaModelEvent.class,
        semantics = SemanticsOf.SAFE,
        restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
        cssClassFa = "fa-download"
)
@MemberOrder(sequence="500.600.1")
public Clob downloadMetaModel() {
    return developerUtilitiesService.downloadMetaModel();
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:13,代码来源:DeveloperUtilitiesServiceMenu.java


示例9: downloadLayout

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
/**
 * Download the JSON layout of the domain object's type.
 */
@Action(
        domainEvent = DownloadLayoutEvent.class,
        semantics = SemanticsOf.SAFE,
        restrictTo = RestrictTo.PROTOTYPING
)
@ActionLayout(
        contributed = Contributed.AS_ACTION,
        cssClassFa = "fa-download"
)
@MemberOrder(sequence="500.900")
public Clob downloadLayout(final Object domainObject) {
    return developerUtilitiesService.downloadLayout(domainObject);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:17,代码来源:DeveloperUtilitiesServiceContributions.java


示例10: updateSomeClob

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(semantics=SemanticsOf.IDEMPOTENT)
public BlobClobObject updateSomeClob(
        @Parameter(optionality=Optionality.OPTIONAL, fileAccept =".txt")
        final Clob clob) {
    setSomeClob(clob);
    return this;
}
 
开发者ID:isisaddons,项目名称:isis-app-kitchensink,代码行数:8,代码来源:BlobClobObject.java


示例11: newClobTemplate

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(semantics = SemanticsOf.NON_IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_NEITHER)
@MemberOrder(sequence = "2")
public DocumentTemplate newClobTemplate(
        final DocumentType type,
        @ParameterLayout(named = "Date", describedAs = "Date that this template comes into effect")
        final LocalDate date,
        @Parameter(optionality = Optionality.OPTIONAL, maxLength = NameType.Meta.MAX_LEN)
        @ParameterLayout(named = "Name", describedAs = "Optional, will default to the file name of the uploaded Clob")
        final String name,
        @Parameter(maxLength = DocumentTemplate.FileSuffixType.Meta.MAX_LEN)
        @ParameterLayout(named = "File suffix", describedAs = "The file suffix for any documents created from this template")
        final String fileSuffix,
        final ApplicationTenancy applicationTenancy,
        @Parameter(optionality = Optionality.OPTIONAL)
        final Clob clob,
        final RenderingStrategy contentRenderingStrategy,
        @Parameter(maxLength = DocumentTemplate.NameTextType.Meta.MAX_LEN)
        @ParameterLayout(named = "Subject text")
        final String subjectText,
        @ParameterLayout(named = "Subject rendering strategy")
        final RenderingStrategy subjectRenderingStrategy,
        @ParameterLayout(named = "Preview only?")
        final boolean previewOnly) {

    final DocumentTemplate template = documentTemplateRepository.createClob(
            type, date, applicationTenancy.getPath(), fileSuffix, previewOnly, clob, contentRenderingStrategy, subjectText,
            subjectRenderingStrategy);
    if(name != null) {
        template.setName(name);
    }
    return template;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:34,代码来源:DocumentTemplateMenu.java


示例12: downloadPaymentFile

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(
        semantics = SemanticsOf.SAFE,
        command = CommandReification.DISABLED,
        publishing = Publishing.DISABLED
)
public Clob downloadPaymentFile(
        final PaymentBatch paymentBatch,
        @Nullable final String documentName) {
    final String documentNameToUse = documentName != null ? documentName : paymentBatch.fileNameWithSuffix("xml");
    return factoryService.mixin(PaymentBatch.downloadPaymentFile.class, paymentBatch).act(documentNameToUse);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:12,代码来源:PaymentBatchManager.java


示例13: act

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(contributed= Contributed.AS_ACTION)
public Clob act(final String documentName) {
    Document document = paymentBatch.convertToXmlDocument();
    String xml = jaxbService.toXml(document);
    return new Clob(documentName, "text/xml", xml);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:8,代码来源:PaymentBatch.java


示例14: upsertDocumentTemplateForTextHtmlWithApplicability

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
private void upsertDocumentTemplateForTextHtmlWithApplicability(
        final DocumentType docType,
        final LocalDate templateDate,
        final String atPath,
        final String nameSuffixIfAny,
        final String contentText,
        final RenderingStrategy contentRenderingStrategy,
        final String nameText,
        final RenderingStrategy nameRenderingStrategy,
        final Class<?> domainClass,
        final Class<? extends RendererModelFactory> rendererModelFactoryClass,
        final Class<? extends AttachmentAdvisor> attachmentAdvisorClass,
        final ExecutionContext executionContext) {

    final Clob clob = new Clob(buildTemplateName(docType, nameSuffixIfAny, ".html"), "text/html", contentText);
    final DocumentTemplate documentTemplate = upsertDocumentClobTemplate(
            docType, templateDate, atPath,
            ".html",
            false,
            clob, contentRenderingStrategy,
            nameText, nameRenderingStrategy,
            executionContext);

    mixin(DocumentTemplate._applicable.class, documentTemplate).applicable(domainClass, rendererModelFactoryClass, attachmentAdvisorClass);

    // TODO: push down to incode document; for now this is a work-around that the 'DocumentTemplate#applicable' mixin isn't a full 'upsert'
    final Applicability applicability = existingApplicability(documentTemplate, domainClass.getName());
    applicability.setRendererModelFactoryClassName(rendererModelFactoryClass.getName());
    applicability.setAttachmentAdvisorClassName(attachmentAdvisorClass.getName());

    executionContext.addResult(this, documentTemplate);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:33,代码来源:DocumentTypeAndTemplatesFSForInvoicesUsingSsrs.java


示例15: upsertDocumentClobTemplate

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
protected DocumentTemplate upsertDocumentClobTemplate(
        final DocumentType documentType,
        final LocalDate date,
        final String atPath,
        final String fileSuffix,
        final boolean previewOnly,
        final Clob clob,
        final RenderingStrategy contentRenderingStrategy,
        final String nameText, final RenderingStrategy nameRenderingStrategy,
        ExecutionContext executionContext) {

    DocumentTemplate documentTemplate = documentTemplateRepository
            .findByTypeAndAtPathAndDate(documentType, atPath, date);

    if(documentTemplate != null) {
        documentTemplate.setFileSuffix(fileSuffix);
        documentTemplate.setPreviewOnly(previewOnly);
        documentTemplate.modifyClob(clob);
        documentTemplate.setContentRenderingStrategy(contentRenderingStrategy);
        documentTemplate.setNameText(nameText);
        documentTemplate.setNameRenderingStrategy(nameRenderingStrategy);
    } else {
        documentTemplate =
                documentTemplateRepository.createClob(
                        documentType, date, atPath,
                        fileSuffix, previewOnly, clob,
                        contentRenderingStrategy,
                        nameText, nameRenderingStrategy);
    }
    return executionContext.addResult(this, documentTemplate);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:32,代码来源:DocumentTemplateFSAbstract.java


示例16: downloadAsClob

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Programmatic
public Clob downloadAsClob(final Document document) {
    try {
        final URL url = new URL(document.getExternalUrl());

        final HttpURLConnection httpConn = openConnection(url);
        if (httpConn == null) {
            return null;
        }

        final String contentType = httpConn.getContentType();

        final MimeType mimeType = determineMimeType(contentType);
        if (mimeType == null) {
            return null;
        }

        final Charset charset = determineCharset(contentType);
        if (charset == null) {
            return null;
        }
        httpConn.disconnect();

        final CharSource charSource = Resources.asCharSource(url, charset);
        final String chars = charSource.read();

        return new Clob(document.getName(), mimeType.getBaseType(), chars);
    } catch (IOException e) {
        messageService.warnUser(TranslatableString.tr(
                "Could not download from URL"),
                UrlDownloadService.class, "downloadExternalUrlAsClob");
        return null;
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:35,代码来源:UrlDownloadService.java


示例17: DocumentTemplate

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
public DocumentTemplate(
        final DocumentType type,
        final LocalDate date,
        final String atPath,
        final String fileSuffix,
        final boolean previewOnly,
        final Clob clob,
        final RenderingStrategy contentRenderingStrategy,
        final String subjectText,
        final RenderingStrategy subjectRenderingStrategy) {
    super(type, atPath);
    modifyClob(clob);
    init(type, date, atPath, fileSuffix, previewOnly, contentRenderingStrategy, subjectText, subjectRenderingStrategy);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:15,代码来源:DocumentTemplate.java


示例18:

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(
        semantics = SemanticsOf.IDEMPOTENT,
        domainEvent = ActionDomainEvent.class
)
@ActionLayout(contributed = Contributed.AS_ACTION)
public DocumentTemplate $$(
        @ParameterLayout(named = "File")
        final Clob clob
) {
    documentTemplate.setMimeType(clob.getMimeType().toString());
    documentTemplate.setClobChars(clob.getChars().toString());
    return documentTemplate;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:14,代码来源:DocumentTemplate_uploadClob.java


示例19: Clob

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(
        semantics = SemanticsOf.SAFE,
        domainEvent = ActionDomainEvent.class
)
@ActionLayout(named = "Download")
public Clob $$() {
    return new Clob(document.getName(), document.getMimeType(), document.getText());
}
 
开发者ID:estatio,项目名称:estatio,代码行数:9,代码来源:DocumentAbstract_downloadTextAsClob.java


示例20:

import org.apache.isis.applib.value.Clob; //导入依赖的package包/类
@Action(
        semantics = SemanticsOf.SAFE,
        domainEvent = ActionDomainEvent.class
)
@ActionLayout(named = "Download")
public Clob $$() {
    return urlDownloadService.downloadAsClob(document);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:9,代码来源:Document_downloadExternalUrlAsClob.java



注:本文中的org.apache.isis.applib.value.Clob类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NoSuchDirectoryException类代码示例发布时间:2022-05-23
下一篇:
Java NOP类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap